Help - Search - Members - Calendar
Full Version: Script Question
The Nexus Forums > Specific Games > Morrowind > Morrowind Plug-Ins > TES Construction Set
Povuholo
Hi my mod is in the last stage: checking! And everything works fine, except one thing. When the player goes through a door to an other cell, a dead body is supposed to appear somewhere in another cell. But... if the player goes through the door multiple times, the body also appears on the spot multiple times! So what is the probably very simple line i need to add to my script to let it only happen once?
Switch
The typical thing is to do a doonce variable. So like:

CODE
If ( deadbody == 1 )
     Return
EndIf

Scriptey stuff

Set deadbody to 1


Basically the script will stop running as soon as the condition is met.
Theta Orionis
Switch is right about the DoOnce condition, but if you still want the player to be able to enter the cell after the first time, when the body has been placed, you'll have to take that into account.

First, declare your new variable - eg

short deadbody


Then add an extra if/else/endif condition

If ( OnActivate == 1 )
If ( deadbody == 0 )
[your code about placing the body etc]
Set deadbody to 1
Else
Activate
Endif
Endif


That should only place the body once while still allowing the player to enter the cell after the first time...
Povuholo
Thanks, it's working now. The mod is going to get released really soon smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.