Tighern McDonnell Posted September 22, 2018 Share Posted September 22, 2018 Having a hard time wraping my head around how to script this... I have three separate objects that need to be used in order to talk to one object. each one will use llWhisper on the same channel. the message is different for each one. I need to make the main object listen for each command. once step one is done then it needs to listen for step two and then step three. If a different object is used or the items are used out of order it needs to "error out" (make a different effect) Link to comment Share on other sites More sharing options...
Myrmidon Hasp Posted September 22, 2018 Share Posted September 22, 2018 (edited) You need to keep track of which step you're on. You need to test for the correct message and then advance step if true. You need to reset the step you're on when an incorrect message is received. You need to trigger the ultimate effect when step three is complete. So you'll need something like this in your listen event: integer step; if(step == 3 ) DoTheThing(); if(step == 2 && message == "step3") ++step; if(step == 1 && message == "step2") ++step; if(step == 0 && message == "step1") ++step; else step = 0; You'll probably want to initialize step to zero outside of the listen event as a global so it doesn't get reset each time there's a received message. Edit: forgot to mention some caveats Edited September 22, 2018 by Myrmidon Hasp Link to comment Share on other sites More sharing options...
Tighern McDonnell Posted September 22, 2018 Author Share Posted September 22, 2018 Excellent. I was hoping it was something simple like that. Will try this and see how things go. 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