Quote:
Originally Posted by Raeiphon
Right, another question:
Does GS2 have some sort of semaphore I can use to tell a specific function to idle and wait until data from the server is received? I figured I could do this by setting a while loop which runs a 'idle' task until a onActionServerside -> onActionClientside bounce retrieves the data and updates the variable controlling the while loop, simultaneously ending the idling session and returning the function with the proper data.
Pretty rudimentary stuff, but I'm terrified of trying it out in fear that there's no anti-infinite loop control on the server end, and that ****ing around with this stuff will lag the server I'm currently on to ****. Normally in Python I'd just thread major functions or aspects and plonk semaphores whereever I needed them - I'm not sure if GS2 has the functionality with threading at all
|
The object variable maxlooplimit prevents infinite loops on that object's script, the default loop limit is 10,000 but it can be changed.
And the function waitfor(object, eventname, time); may be what you're looking for. The function halts the function calling it and waits for the specified event on the specified object for the specified amount of time. If the time runs out then waitfor() returns false, otherwise returns true if the event it's waiting for happens.
I created a class for weapons that wraps triggerserver() and triggerclient() and allows functions to be called on the other side and wait for their return value. The script is in the Code Gallery.
Quote:
Originally Posted by Novo
I don't think you're ready to experiment with dynamic executional programming. In the majority of the cases, you don't need dynamic execution. Using them makes debugging harder and encourages unconventional hacks rather than well-thought-out solutions.
|
What is this dynamic executional programming you're talking about?