steph Arnott Posted January 28, 2016 Share Posted January 28, 2016 Sorry if the seems a bit dumb. In a script does events have a priority order, as in i should put some at the begining at lesser priority at the mid or end or does it make no difference. I understand the system stacks them, not the right terminology i know. Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 28, 2016 Share Posted January 28, 2016 Nope. Order is not important. You could put your state_entry event last and the state_exit event first, if you like, and it wouldn't make any difference. Script execution only enters an event if it is triggered by some action. When it is triggered, execution passes to the event and stays there until all steps in the event have finished. You cannot interrupt an event. If there is currently no trigger, and the actions of the most recent event have finished, the script just sits there idly waiting for the next trigger. That's not a dumb question at all, BTW. This is right at the heart of what makes LSL a unique language, and what can make it hard for scripters with experience in other languages to get started here. EDIT: You may be thinking of the script's event queue. If script execution is in an event and two or more triggering actions occur, the script cannot respond to any of them right away, so they are saved in the event queue. As far as I know, execution from the event queue is prioritized on a first in- first served basis. Link to comment Share on other sites More sharing options...
steph Arnott Posted January 28, 2016 Author Share Posted January 28, 2016 Is that event that is triggered removed fron the que. OK , a abc bricks in a line, c is invoke so removed and goes to the end, or is that just wrong? It the even que i can not get. Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 28, 2016 Share Posted January 28, 2016 You were typing while I was adding my EDIT note. Yes, as far as I understand, the first event in the queue gets executed first, then the second one, and so on. Usually that's only important if you have an event with a delay (like a dataserver event) and the possibility of having someone send it several triggering actions while it is busy. Link to comment Share on other sites More sharing options...
steph Arnott Posted January 28, 2016 Author Share Posted January 28, 2016 ah, i get that, to be honest thought the script ran top to bottom, had reservations about that. So in thicko lang one has a set of canned instructions that can be picked on a need to basis. ADDED, "thicko lang" this refers to me, no one else. Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 28, 2016 Share Posted January 28, 2016 That's essentially it, Steph. Events are executed on a need basis, not according to any predetermined order. That's very different from any language I had used before I came to SL, so it took some getting used to. 1 Link to comment Share on other sites More sharing options...
steph Arnott Posted January 28, 2016 Author Share Posted January 28, 2016 Thankyou, i was some what being crippled on it (not like that analogy), had an idea but was not confident. HUGGS Link to comment Share on other sites More sharing options...
Dora Gustafson Posted January 28, 2016 Share Posted January 28, 2016 For what it is worth: the state_entry event has priority over other events A state_entry event on the event queue will be the event to handle first :smileysurprised::smileyvery-happy: 1 Link to comment Share on other sites More sharing options...
steph Arnott Posted January 28, 2016 Author Share Posted January 28, 2016 Makes sense, thankyou Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now