Home   Help Search Login Register  

Author Topic: scripts after saving (solved)  (Read 2590 times)

0 Members and 1 Guest are viewing this topic.

Offline maxjoiner

  • Members
  • *
  • I love ArmA2 Editor
scripts after saving (solved)
« on: 23 Jul 2011, 19:23:25 »
Hi, I've a problem.
In My mission after the save when I reloaded the saving my custom scripts don't work!  >:(
Ex: Init unit: nul = [this] execVM "light.sqf";
or: trigger: nul = [player] execVM "light.sqf";
and also the scripts in init.sqf don't work!
Somebody can help me!   :weeping:
« Last Edit: 24 Jul 2011, 11:28:17 by maxjoiner »

Offline Pirin

  • Members
  • *
Re: scripts after saving
« Reply #1 on: 24 Jul 2011, 03:38:10 »
I'm still real fuzzy about savegame compatible scripting, but do setVariables work?  If so you can have a trigger that sets the actual light on or off via the state of a variable.  So set the variable to on in init.sqf, the trigger detects this and turns the light on.  During play the variable sets to off, the trigger turns off the light.  You save.  Come back into the game and the init isn't run again, but since the variable says the light should be off the trigger turns the light off post save?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: scripts after saving
« Reply #2 on: 24 Jul 2011, 09:48:33 »
@maxjoiner:

Two things need clarifying:
1. You say you save a mission, do you mean you save a mission while playing (press ESC - Save Game) it or do you mean you save a mission in the editor?
2. You say the scripts don't work, how exactly? Error messages?

EDIT:
Hmm, if the script is a short non-looping script, it has already been executed via a trigger and run through, and then the game is saved the trigger will not be run again after the savegame reload because it already has done it's job.

Also, there has been in the past savegame incompatability with a few of the scripting commands, at least setObjectTexture and animate "don't work" in OFP (CWA) and A1; as in their states don't get saved in a savegame (dunno what's the situation with A2). IIRC the same problem was with the command switchLight.
« Last Edit: 24 Jul 2011, 09:57:48 by h- »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline maxjoiner

  • Members
  • *
  • I love ArmA2 Editor
Re: scripts after saving
« Reply #3 on: 24 Jul 2011, 10:17:20 »
@Pirin
Thanks for your reply.

@h-
Thanks for your reply.

I solved thanks at Wiggum!  :good:

http://forums.bistudio.com/showthread.php?t=122714




« Last Edit: 24 Jul 2011, 11:26:45 by maxjoiner »