Sorry for the uninformative title, it was the simplest and quickest I could come up with at this time of day/night.
After posting
here about better elevators I decided I'd make them and have been at it since then - lots of fun figuring things out, etc.
However I've hit a snag that I'd rather get help with than try to figure out by making things up til it seems to work. I'm not very knowledgeable about tables; I don't know how to use them except for adding things to them and calling things in them.
Preamble aside this is what I'm trying to do. My intent should be pretty clear to anyone who takes a look at the script.
So, I'm trying to find the closest node to self (this node). My guess was that the best way to do this was to create a table with all the nodes in it (which is probably more efficient in general and should probably done for actors affected by this too) and use that to compare every value and figure out which is closest. Unfortunately I'm not very knowledgeable or comfortable with tables so I don't really know how to do that. You can see my attempt on line 28. As I said what I want to achieve is finding the closest node above, below, to the left of and to the right of self. This would then be compared with the distance values to determine if the node is close enough that it counts as attached for the purposes of waypoints and removing movator effects.
Also, to anyone clever, if they can come up with a way to get waypoint actors to be able to have more advanced direction movement that'd be great. For one, I'm not sure how I would get C shapes to work, which'd be the basis of pretty much anything more advanced. For an example of what I mean there, getting something like this to work:
Attachment:
Example.bmp [ 392.55 KiB | Viewed 3703 times ]
Here the only passage leads in the opposite direction of the waypoint, what I have can't handle that at all and the only idea I can come up with is setting up four new movement modes for any node with only one node next to it. The modes would then keep the actor going in the direction it's moving until can change movement direction by 90 degrees. All in all I'd love to not have to do that
Anyway, here's the rte (ignore the sprites ripped from unitec and mappack). Feel free to mess around with it if you want or make something far better based loosely off it, though if you do that some credit would be nice.
The script and object that you should use is MovatorHub since the other ones have outdated scripts attached and are just for testing (hence the names). That said, the 5X one (and larger sizes that are yet to come) will actually be used once this is working.