Hello,
I need to get a Self-defined variable to make some conditional judgments in a Threaded child script. The promble is that the variable is in a Non-threaded child script. How can I get the variable between these two child script?
Sincerely,
Darkb1ue
how to get a variable from an Non-threaded child script to Threaded child script
Re: how to get a variable from an Non-threaded child script to Threaded child script
There are many possibilities:
- you can set a signal in one script (e.g. with sim.setStringSignal, and other signal functions) in one script, and read (or wait for) the signal value in the other thread (sim.getStringSignal, etc...)
- you can write data to a custom data block (sim.writeCustomDataBlock) to read it from another script
- you can use sim.callScriptFunction to call the function of another script
- you can use sim.broadcastMsg to send an event that can be delivered to the sysCall_msg callback
- other ways mentioned in Messaging/interfaces/connectivity