Jump to content
Sign in to follow this  
Patriot123

Trouble with SetVariable and creating marker on map

Recommended Posts

1) I make MP map. In map when create vehicles, script doing: _vehicle setvariable["asd",true,true]; After some time all variables in all objects is reset! Why? In map they not edited, only readed! Help!

2) When map is start create global markers on map. After some time (> 90 minuts) all markers is lost. Why? (((

PS: Sorry for my English.

Share this post


Link to post
Share on other sites

Did you die in any way or did anything happen to the vehicle?

Share this post


Link to post
Share on other sites

Are other people JIPing and calling the setVariable code again?

Share this post


Link to post
Share on other sites
Did you die in any way or did anything happen to the vehicle?

No, vehicle no die. Player not die too.

Are other people JIPing and calling the setVariable code again?

No, setVariable use only when vehicle crreating, then in loop use getvariable.

I set variable in setVehicleInit and processInitCommands. Can this wrong work or anew run processInitCommands for vehicle?

_newvehobj = _class createVehicle "skoda";

_newvehobj setpos _pos;

_newvehobj setdir _dir;

_newvehobj setVehicleInit '

this setVariable ["tuning", 0, true];

this setVariable ["nitro", false, true];

this setVariable ["siren", false, true];

this setVariable ["trunk", [], true];

clearWeaponCargo this;

clearMagazineCargo this;

';

processInitCommands;

Share this post


Link to post
Share on other sites

Try

setvehicleinit {
//stuff
};

instead. Multiple lines always have to be defined via {} else it wont work.

Share this post


Link to post
Share on other sites
Try

setvehicleinit {
//stuff
};

instead. Multiple lines always have to be defined via {} else it wont work.

I mean, that

_newvehobj = _class createVehicle "skoda";
_newvehobj setpos _pos;
_newvehobj setdir _dir;
_newvehobj setVehicleInit '
this setVariable ["tuning", 0, true];
this setVariable ["nitro", false, true];
this setVariable ["siren", false, true];
this setVariable ["trunk", [], true];
clearWeaponCargo this; 
clearMagazineCargo this;
';
processInitCommands;

- its create vehicle, its work and variables too. Then, after some time player doing: _some_vcl setvariable["nitro",true,true]; , _some_vcl setvariable["tuning",5,true]; - its work too, but after some time if doing: _result = _some_vcl getvariable "tuning"; for this vehicle, _result will be is initial value: 0 instead of 5. And its for all variables for all vehicles. I think that the again vehicle will reinitialize with initial values. May be need reset or clear line for setVehicleInit?? Or not use setVehicleInit and use _vcl setvariable only :)

Edited by Patriot123

Share this post


Link to post
Share on other sites
No, vehicle no die. Player not die too.

No, setVariable use only when vehicle crreating, then in loop use getvariable.

I set variable in setVehicleInit and processInitCommands. Can this wrong work or anew run processInitCommands for vehicle?

_newvehobj = _class createVehicle "skoda";

_newvehobj setpos _pos;

_newvehobj setdir _dir;

_newvehobj setVehicleInit '

this setVariable ["tuning", 0, true];

this setVariable ["nitro", false, true];

this setVariable ["siren", false, true];

this setVariable ["trunk", [], true];

clearWeaponCargo this;

clearMagazineCargo this;

';

processInitCommands;

All of those commands in the vehicle init are available with a global version (in fact setVariable is basically broadcasted from all machines).

Just change the clearWeapon/MagazineCargo to Global and remove vehicle init and processInitCommands and you'd have the exact same results.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×