Looping in Papyrus?

Post » Wed Feb 12, 2014 4:52 pm

More beginner questions. My real goal is to set up a script to watch for a certain external variable "A" to exceed a certain amount, at which point it will kick in. When it kicks in, it will change another variable "B" over the span of 20 seconds. When variable "A" returns below the threshold, variable "B" will change back, again over the span of 20 seconds.

As far as I can tell, the only way I'm going to be able to get this to work is with loops. One loop to check the status of "A" every half second or so, and another loop to control the value of "B" as it changes over the 20-second span. Sometimes it feels like a given scripting language is needlessly obfuscated. I could get this done in Basic in like three minutes. In any event, I do not know what kind of syntax I should be using to cause a script to loop back upon itself so certain checks or modifications can be repeatedly made.

User avatar
Lynne Hinton
 
Posts: 3388
Joined: Wed Nov 15, 2006 4:24 am

Post » Wed Feb 12, 2014 5:24 pm

Event (theevent)  while (something) ; this is your loop       ; do what you want inside your loop  enWhileEndEvent
User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am


Return to V - Skyrim