Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
|
07-21-2004 09:47
Does the code only visit state entry when it is first put down? (or when you change the code.)
So lets say someone buys an object. Does it goto state entry run when they first put it down? Then if it does will it ever visit it again?
|
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
|
07-21-2004 10:02
the state_entry event for a particular state is "fired" or executed each and every time the state (the state that the state_entry event is in) is "entered".
The default state is entered by any of the following...
1. Calling llResetScript (or resetting the script from another script using llResetOtherScript) 2. Saving the script 3. Resetting the script 4. Calling "state default" somewhere in your code, but outside the default state.
state_entry isn't "fired" when you rez an object (drag it from your inventory to the ground). Use the on_rez event instead.
|
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
|
07-21-2004 10:04
The state_entry event is called whenever the state is entered. The default state is entered when - The script is compiled (successfully  ) - The code "state default;" is called So the short answer to your question is "just the one time, assuming you're not playing with states"
_____________________
Sarcasm meter: 0 |-----------------------*-| 10 Rating: Awww Jeeze!
|
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
|
07-21-2004 10:06
Damn my human legs!
Also, I thought that Hank's number 4 was "fixed" recently, and that the state_entry event is called when switching to the same state now.
_____________________
Sarcasm meter: 0 |-----------------------*-| 10 Rating: Awww Jeeze!
|
Grim Lupis
Dark Wolf
Join date: 11 Jul 2003
Posts: 762
|
07-21-2004 12:03
From: someone Originally posted by Wednesday Grimm Also, I thought that Hank's number 4 was "fixed" recently, and that the state_entry event is called when switching to the same state now. Actually, they did the opposite, counter-intuitive approach. If you call state default from inside the default state, then neither state_exit nor state_entry fires now, whereas before the state_exit would fire, but not the state_entry.
_____________________
Grim
"God only made a few perfect heads, the rest of them he put hair on." -- Unknown
|