Moving to a valid location

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
ValasImogen
Posts: 4
Joined: Sun Dec 09, 2012 6:58 pm

Moving to a valid location

Post by ValasImogen »

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?
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: Moving to a valid location

Post by Xanathar »

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.
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
Post Reply