Spawning new tiles

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
Emera Nova
Posts: 146
Joined: Wed Jun 11, 2014 1:31 am

Spawning new tiles

Post by Emera Nova »

So I'm currently attempting to make it so a certain creature spawns in lava tiles under it as it walks around.. The biggest issue I'm having right now is making it only spawn 1 of these tiles in and not stacking if its moved back on top of an area its already been on. (The burn damage ends up stacking due to the tile being placed a second or third time.) On top of that it also creates more particles that dont need to be there.

Any suggestions for what Im trying to do here?
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Spawning new tiles

Post by zimberzimber »

You could check for objects in the tile its about to spawn lava before it does.
I can't really give you the full function for checking right now because I'm on the phone, but the green herder in my asset pack uses a similar function for when spawning poison clouds while moving.
My asset pack [v1.10]
Features a bit of everything! :D
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Spawning new tiles

Post by minmay »

Use Map:entitiesAt() to see if there is already a wall_fire object there.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply