Community Forum

onUpdate

Forum Overview >> Scripting

CategoryScripting
Created04.02.2021 17:57


Ded Berrod (Berrod) 04.02.2021 17:57
Hello. Please help me on this issue:
how to make the "onUpdate" function be called in a similar way as in the Motorized specialization? I mean:
1. if the motor is running (self.spec_motorized.isMotorStarted = true) - the "onUpdate" function is called constantly.
2. if the motor does not work (self.spec_motorized.isMotorStarted = false) - the "onUpdate" function is not called.
or another example in the Enterable specialization:
1. if the player is inside the vehicle (self.spec_enterable.isControlled = true) - the "onUpdate" function is called constantly.
2. if the player left the vehicle (self.spec_enterable.isControlled = false) - the "onUpdate" function is not called.

In other words, I need a flag that works in a similar way.

Bilbo Beutlin (BBeutlin) 04.02.2021 23:54
This is a combination of eventListeners in function registerEventListeners() with raiseActive().
The 'raiseActive' triggers the associated eventListener. So the related onFunction is only processed if needed.

You'll find many examples in the specialization LUA codes.

Ded Berrod (Berrod) 05.02.2021 00:37
Thank you for quick answer.
The two days of torture are over. Everything worked out!!

sjalt 20.02.2021 09:35
Hey There,
where can I find or extract the vanilla LUA codes?

Bilbo Beutlin (BBeutlin):"...You'll find many examples in the specialization LUA codes."

SOLVED:
After installing the Remote Debugger the scripts can be found at:
%programfiles%\GIANTS Software\GIANTS_Remote_Debugger_8.0.2\gameSources

Maybe different depending on install location and debugger version.


Note: Log in to post. Create a new account here.