Articulate Vlish Eric-Ihrno Posted October 9, 2004 Share Posted October 9, 2004 Thanks to everyone who weighed in about my special irem script. Now I need help with a creature/terain script. I want to make a creature that can get back up again after dying (after a few turns delay). The initial idea was to make the creature script place a custom terrain (corpse) when the creature dies. The custom terrain would then run a script that waits for a few turns before erasing itself and using place_monster to bring back the creature. The problem is, my corpse script runs fine, but only on corpses I place in the editor. It won't work for ones created by a creature script. Is there any way to place a new terrain script while the game is running? I guess I could make the town or scenario script handle this, but it would be rather clumsy as I'd need a separate call in START_STATE for each resurrecting creature. Link to comment Share on other sites More sharing options...
Well-Actually War Trall Fort Posted October 10, 2004 Share Posted October 10, 2004 Unfortunately, you can't place terrain scripts dynamically as far as I know. I haven't tried placing a terrain with an inherent, attached terrain script while the game was running, so I encourage you to try that. How many monsters will have this self-resurrection ability? If the amount of monsters is less than 15, I think it would still be viable to put the script into the START_STATE of the town. Generally, script efficiency is not a huge, noticeable problem when it runs in combat mode, or after an important event (at least you have a reason for the slowdown). Therefore, if you can just make the code run after a creature dies, then things would work out. This might have been what you were trying to do with your original idea. If you activate and deactivate a certain terrain script that performs this resurrection function at the appropriate times, then everything should run pretty efficiently. By deactivate I mean change its script mode to 0 (only run every 8 turns when party is nearby). There could be multiple counters, variables, and SDFs for when, what, and where to resurrect the creatures. Since this might become complex if you have too many creatures, then you could have counterpart creatures with scripts that can keep running after the initial creature has died. Of course, you are using extra creature slots, but there are always limits. Placing the corpses will be difficult graphically unless you make sure that the creatures won't wander off to other types of floors and terrain. Link to comment Share on other sites More sharing options...
Articulate Vlish Eric-Ihrno Posted October 10, 2004 Author Share Posted October 10, 2004 Thank you. There should be less than 15 creatures, so I'll go ahead and take your advice. The dungeon they're in will be a cave with a pretty simple floor, so the corpses shouldn't be a problem. I'll just have to make sure they can't knock down walls by dying on them. Link to comment Share on other sites More sharing options...
Garrulous Glaahk Isaac Posted October 10, 2004 Share Posted October 10, 2004 Quote: Originally written by Eric-Ihrno:Is there any way to place a new terrain script while the game is running? No. I wish it was possible. Link to comment Share on other sites More sharing options...
Well-Actually War Trall Fort Posted October 10, 2004 Share Posted October 10, 2004 Make sure the room that the zombies are in only have exterior type walls. You might be able to make an easter egg out of it, though. You kill a creature in the right place and a wall explodes! Link to comment Share on other sites More sharing options...
Recommended Posts