Moving to a valid location
-
ValasImogen
- Posts: 4
- Joined: Sun Dec 09, 2012 6:58 pm
Moving to a valid location
I'm looking to spawn a monster at a random location, which I've got, however it has the possibility to spawn them in the walls. I can fix this by white-listing the valid tiles, but I'm wondering if there is a shortcut way to just move the spawned creature to the nearest valid location?
Re: Moving to a valid location
JKos framework has an isWall function that works in the level the party is (http://sites.google.com/site/jkosgrimrock2/home)
Otherwise there'll be an isWall function in the next version of the game.
With those, you can pick a tile at random, then if it is a wall either repeat or look around the tile until you find a non-wall one.
Otherwise there'll be an isWall function in the next version of the game.
With those, you can pick a tile at random, then if it is a wall either repeat or look around the tile until you find a non-wall one.
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org