Find closest tileset name?

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
User avatar
Danny
001 Forum Master
 
Joined: Tue Jul 12, 2011 7:14 am

Find closest tileset name?

Postby Danny » Fri Feb 26, 2016 8:38 am

How would i find the closest tile to the main actors X, Y and Z based on tile name. So i could check the closest tileset "Floor Tileset" with the name "Metal" for example.

Thanks.

User avatar
RamchuK_Ntertainment
Ultimate 001 Member
 
Joined: Tue Sep 29, 2009 10:50 pm
Location: Seattle, Washington

Re: Find closest tileset name?

Postby RamchuK_Ntertainment » Fri Feb 26, 2016 10:50 am

Unfortunately there is no function for that and will likely not be, but you can develop your own system that would take note of all tiles with a particular name and their coordinates, then compare entries by always choosing/keeping the smallest distance from a location to the tile. This would only be reasonable and appropriate if you run this check within a certain proximity, to an extent, as it would require a study of a square grid. The best thing to do would be to find a way to use invisible actors as markers at tiles and make use of the 'Closest Actor' functions. You can always do more research on data searches, but this topic is still under heavy development, thus I would suggest to just make use of what's available and save yourself from the potential complexities.
Travesty: 3D Survival - WIP >>> Forum Topic
University of Washington (BABA)
-REGT- Ramchuk Entertainment Games Team
Strategy/Action/Adventure
Copyrighted©2008-2017

User avatar
Danny
001 Forum Master
 
Joined: Tue Jul 12, 2011 7:14 am

Re: Find closest tileset name?

Postby Danny » Sat Feb 27, 2016 4:01 pm

Okay closest actor thing seems best, however when the actor moves to the closest actor how would i then make it move to the next closest actor and ignore then actor its next to? Because i want it to go to the closest actor but then once it reaches that actor i want it to seek out the next closest actor but i don't want it getting stuck on the first closest actor.

I also can not delete these actors, i am using them as desination points, so deleting them once the actor reaches them is not an option.

User avatar
RamchuK_Ntertainment
Ultimate 001 Member
 
Joined: Tue Sep 29, 2009 10:50 pm
Location: Seattle, Washington

Re: Find closest tileset name?

Postby RamchuK_Ntertainment » Sat Feb 27, 2016 7:52 pm

You'd need to run the check under relay circumstances, so instead of simply finding the closest actor to the main actor, you'd need to find the closest actor to the main actor's closest actor. Assuming you're using a specific actor template for tile actors, you can do this by checking the distance between the main actor and the closest actor before deciding if the relay check is necessary.

Assume Actor.Main as the main actor; Actor.Tile_1 as the first tile actor and Actor.Tile_2 as the second tile actor as necessary.

1) Use a Comparison Branch to check the distance between Actor.Main and the closest tile actor; IF the two actors are close, that means that the main actor is already near or at a tile actor - go to #2. IF the actors are far, use the closest actor as the tile that you need to move to.
2) Check the closest actor (Actor.Tile_2) to Actor.Main's closest actor (Actor.Tile_1); that's the closest location where you need to move.

NOTE: The distance to check for depends on your needs, but it should be fairly close from what I'm assuming that you need. Something like +-6 pixels would work if you want to be rather precise. This, however, depends on how far apart your tile actors are. With the method I described you're relaying the first closest actor if you're already really close to one, so all should work as intended.
Travesty: 3D Survival - WIP >>> Forum Topic
University of Washington (BABA)
-REGT- Ramchuk Entertainment Games Team
Strategy/Action/Adventure
Copyrighted©2008-2017

User avatar
evs
001 Admirer
 
Joined: Tue May 08, 2012 5:27 pm
Location: Perth, Australia

Re: Find closest tileset name?

Postby evs » Fri Mar 04, 2016 3:08 pm

Ramchucks onto it.. i had a few ideas to perhaps elaborate on that too.. You can have also an actor which LOOKS exactly like a tile (use mostly tiles, then one tileactor where you want your waypoint) then You can make a specific actor template for that type of tileactor. that will allow you to search for the closest tileactor of that type (or multiple types). not sure if that helps finding the NEXT one though.. let me think.. actually not sure if that helps at al.. it seemed good a moment ago ^^?


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron