Jump to content
Sign in to follow this  
gokitty1199

question about threading

Recommended Posts

with the new scripting language, for example lets say i wanted to have a while loop run. would that while loop interfere/hold up anything else from running, or do you have to make a new thread for it? i saw something regarding createThread and i was curious.

Share this post


Link to post
Share on other sites

If you want to have a while loop with pauses in between each call, try to use the CallLater function and set the time in ms you want to have and repeating to true. It would be

GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(this.OnUpdate, 3000, true);

This will call the OnUpdate function in this class every 3 seconds.

I don't know much about threading in DayZ. You can try to find it out ^^

LBmaster

Share this post


Link to post
Share on other sites
8 hours ago, lbmaster said:

If you want to have a while loop with pauses in between each call, try to use the CallLater function and set the time in ms you want to have and repeating to true. It would be

GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(this.OnUpdate, 3000, true);

This will call the OnUpdate function in this class every 3 seconds.

I don't know much about threading in DayZ. You can try to find it out ^^

LBmaster

thank you sir, i had someone explain it some to me in the discord but this is also helpful, seems theres multiple ways to set yourself up to do it. thank you!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×