OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: BensTooCool on 30 Mar 2007, 21:07:07

Title: cant get this script to work
Post by: BensTooCool on 30 Mar 2007, 21:07:07
I'm rubbish at doing scripts, I got some examples and tutorials but I couldn't get this to work properly, could someone please correct it for me  :)

Code: [Select]
if (ob0==true && obj1==true && obj2==true) then
  {
    EndGame1 = true;
  }
else
  {
    EndGame2 = true;
};

p.s. I saved it as .sqf and then I loaded the script using a trigger act field "[this] exec file.sqf"
Title: Re: cant get this script to work
Post by: Cheetah on 30 Mar 2007, 21:20:15
And if you call it with:

call { [] exec "file.sqf"; };

or

script = [] exec "file.sqf";
Title: Re: cant get this script to work
Post by: BensTooCool on 30 Mar 2007, 21:50:57
I tried call { [] exec "file.sqf"; }; but it still give me the same errors when I executed the script.
Title: Re: cant get this script to work
Post by: Cheetah on 30 Mar 2007, 21:53:30
Did you try the script = ..
and could you write down the errors?
Title: Re: cant get this script to work
Post by: Mandoble on 30 Mar 2007, 22:17:42
[] execVM "whatever.sqf"
Title: Re: cant get this script to work
Post by: BensTooCool on 30 Mar 2007, 22:41:35
The error I get is:

'if (obj0|#| == true && obj1|#| == true && obj2|#| == true) then'
Entry, Display (dialog), control
Error: Type, Expexted, Number String object side, group, text, config


I tried script = [] exec "file.sqf"; and [] execVM "whatever.sqf" but that just give me the message Type Nothing, Expected Any
Title: Re: cant get this script to work
Post by: BensTooCool on 31 Mar 2007, 01:42:07
got it working  :good:
Title: Re: cant get this script to work
Post by: D_P_ on 31 Mar 2007, 03:50:07
isn't using a trigger easier?  :confused:
Title: Re: cant get this script to work
Post by: Mandoble on 31 Mar 2007, 04:11:55
Code: [Select]
if (ob0 && obj1 && obj2) then
  {
    EndGame1 = true;
  }
else
  {
    EndGame2 = true;
};