[SCRIPT] Mind-boggling "SetEntityCallbackFunc" issue - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: [SCRIPT] Mind-boggling "SetEntityCallbackFunc" issue (/thread-48421.html) |
Mind-boggling "SetEntityCallbackFunc" issue - Slanderous - 05-27-2016 I'm working on a script triggered after player picks up two items. What I used are two PHP Code: SetEntityCallbackFunc Here is the broken piece of code: PHP Code: void OnStart() Any ideas? Thanks ahead of time RE: Mind-boggling "SetEntityCallbackFunc" issue - Romulator - 05-27-2016 Try adding the variable before check();. You're getting your desired output of 2, but it's doing the check before. First pass: Check Local Var = 0, so don't check. Local Var = 1. Check Local Var = 1, so don't check. Local Var = 2. RE: Mind-boggling "SetEntityCallbackFunc" issue - Slanderous - 05-27-2016 (05-27-2016, 12:54 AM)Romulator Wrote: Try adding the variable before check();. You're getting your desired output of 2, but it's doing the check before. Thanks, that worked like a charm! Had no clue that the solution was so simple. RE: Mind-boggling "SetEntityCallbackFunc" issue - Romulator - 05-27-2016 No problem mate The main thing to remember that code is sequential, practically always working top-down. Closing~ :3 |