OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: LCD on 24 Aug 2007, 09:26:50

Title: solved : changing golobal varies usin scripts
Post by: LCD on 24 Aug 2007, 09:26:50
is dere anyway 2 change a global variable using script ?

like i wanna set da vari true so i use

[variname] execVM "true.sqf"

da text in true.sqf

Code: [Select]
private ["vari"];

_vari = _this select 0;
_vari = true;

now i know dis wont work... also dis is not my script :P but its quick example 2 show wat i mean :D

LCD OUT
Title: Re: changing golobal varies usin scripts
Post by: Cheetah on 24 Aug 2007, 09:56:20
Hmm, as far as I know, you can always change variables, even without using a script?

Just do:

variable = true;

Or do I miss something specific you need for the script?
Title: Re: changing golobal varies usin scripts
Post by: LCD on 24 Aug 2007, 09:58:27
acualy... i wanna change (usin da same script) difrent variables... like evertime i send it avarible it does some calculations nd change da variable itself....

LCD OUT
Title: Re: changing golobal varies usin scripts
Post by: Cheetah on 24 Aug 2007, 10:25:34
Code: [Select]
//Syntax: call { ["variableName"] execVM "true.sqf"; };

_var = _this select 0;
call compile format ["%1 = true;",_var];
hint format ["%1 = %2",_var,variable];

Example mission attached.
Title: Re: changing golobal varies usin scripts
Post by: LCD on 24 Aug 2007, 10:35:25
it works...  :good:

thanks

LCD OUT