SeaLyon
July 16th, 2010, 12:03 PM
Hi,
This is probably a stupid question, but I need some help with it. I have some LUA code that needs to use Voice:Speak to say some things and then trigger a girder event to start another action. I have several things that need to be said with different event triggers fired at the end of each specific saying. The problem I'm having is that girder appears to be pending the events until the script ends, firing all the ends at once. Here is some LUA code that demonstrates the problem (at least on my machine -- WinXP SP3). When this runs, it says the 2 sayings and THEN fires the event, instead of saying the first saying, firing the event, and then saying the second saying.
speech = {"",
"Say something.",
}
print ("START #5")
for _,v in ipairs(speech) do Voice:Speak(v, 0) end
print ("DONE #5")
-- <SEND ROBO_WAKEUP IR COMMAND>
gir.TriggerEvent("ROBO_39",18)
speech = {"",
"Say Something Else.",
}
print ("START #5b")
for _,v in ipairs(speech) do Voice:Speak(v, 0) end
print ("DONE #5b")
Is this the way girder should be processing this code? Does the script processor & event generator code run on the same thread? Is that what is causing the pending of the event? How can I get the event to fire in sync with what my script is doing since that's what I need? Also, I'm just using a girder event (#18), instead of creating my own user-defined event number, will that cause me any problems?
Thanks,
Chris
This is probably a stupid question, but I need some help with it. I have some LUA code that needs to use Voice:Speak to say some things and then trigger a girder event to start another action. I have several things that need to be said with different event triggers fired at the end of each specific saying. The problem I'm having is that girder appears to be pending the events until the script ends, firing all the ends at once. Here is some LUA code that demonstrates the problem (at least on my machine -- WinXP SP3). When this runs, it says the 2 sayings and THEN fires the event, instead of saying the first saying, firing the event, and then saying the second saying.
speech = {"",
"Say something.",
}
print ("START #5")
for _,v in ipairs(speech) do Voice:Speak(v, 0) end
print ("DONE #5")
-- <SEND ROBO_WAKEUP IR COMMAND>
gir.TriggerEvent("ROBO_39",18)
speech = {"",
"Say Something Else.",
}
print ("START #5b")
for _,v in ipairs(speech) do Voice:Speak(v, 0) end
print ("DONE #5b")
Is this the way girder should be processing this code? Does the script processor & event generator code run on the same thread? Is that what is causing the pending of the event? How can I get the event to fire in sync with what my script is doing since that's what I need? Also, I'm just using a girder event (#18), instead of creating my own user-defined event number, will that cause me any problems?
Thanks,
Chris