bad biscut Posted February 16, 2010 Share Posted February 16, 2010 It is a simple showmessage script activated by a trigger but whenever I walk into the trigger the message plays again. How do I get it to only show once? Link to comment Share on other sites More sharing options...
nosisab Posted February 16, 2010 Share Posted February 16, 2010 It is a simple showmessage script activated by a trigger but whenever I walk into the trigger the message plays again. How do I get it to only show once?If you need to keep the trigger the simpler way is to use a quest script variable, it is able to keep values between sessions, actually it works like a global variable for your mod. Any quest in your mod can do the trick, you can use one already there or create a dummy one just to host the script. That quest does not even need to be active, you can just terminate it immediately. To access the variable you need to prefix it with the quest name, like: set MyQuest.MyQuestVar to 1. Where the MyQuestVar is the variable defined inside the quest script. To clarify, that variable can be accessed for read and write from any script inside your mod and is persistent, the value is not lost between game sessions. Link to comment Share on other sites More sharing options...
Cipscis Posted February 16, 2010 Share Posted February 16, 2010 There's no need to use a global or remote variable for this - just use a local one. Here's my post from the other thread thread (this thread was double-posted):Add a variable to store whether or not the message has been shown, and use a conditional statement to prevent it from being shown again:int bDoOnce Begin OnTriggerEnter player if bDoOnce == 0 set bDoOnce to 1 ShowMessage MyMessage endif EndCipscis Link to comment Share on other sites More sharing options...
nosisab Posted February 16, 2010 Share Posted February 16, 2010 There's no need to use a global or remote variable for this - just use a local one. Here's my post from the other thread thread (this thread was double-posted):Add a variable to store whether or not the message has been shown, and use a conditional statement to prevent it from being shown again:int bDoOnce Begin OnTriggerEnter player if bDoOnce == 0 set bDoOnce to 1 ShowMessage MyMessage endif EndCipscisare you sure? local variables loses the values between sessions and that may be what is happening to the OP. Link to comment Share on other sites More sharing options...
Cipscis Posted February 16, 2010 Share Posted February 16, 2010 I'm sure. Local variables do not lose their values between sessions. Perhaps you're thinking of something else? Cipscis Link to comment Share on other sites More sharing options...
buddah Posted February 16, 2010 Share Posted February 16, 2010 One thread on this is enough. But it looks like a double topic post, so I will close this one. Buddah Link to comment Share on other sites More sharing options...
Recommended Posts