I’m having trouble with a script I’m working on, that will allow certain Self Actions (trading in this case) to be enabled, only when the player is in a certain place on the map.
I’m using a “dome†script in my mission.sqm file, to detect that the player is in the proper place to enable the self actions. Some lines of the dome script ...
name="dome";
expActiv="dome = [] execVM ""Trade\trade.sqf"";";
expDesactiv="terminate dome; canTrade = false; titleText [""You've left the dome"", ""PLAIN DOWN"", 3];";
When the player enters the dome the trade.sqf script runs ...
titleText ["You've entered the dome.","PLAIN DOWN"]; titleFadeOut 5;
canTrade = true;
In my fn_selfActions.sqf I have ...
if (canTrade) then {
- trade self actions are here -
}
The dome is working fine and I get the “You’ve entered the dome†and “You’ve left the dome†messages when testing.
The self action enabling is working fine and I can only access the trade self actions when I enter the dome.
What isn’t working is setting the global variable “canTrade†to “false†when the player exits the dome. When you exit the dome, the self actions are still enabled.
I try to set it to false in the dome script line ...
expDesactiv="terminate dome; canTrade = false; titleText [""You've left the dome"", ""PLAIN DOWN"", 3];";
But obviously, I’m doing something wrong J
How do I get the global variable “canTrade†set to “false†when a player exits the dome, so that the IF statement in my fn_selfActions.sqf will disable the trade self actions?
Thanks for any help.
** I figured it out, I needed to cancel the self actions
**
I’m using a “dome†script in my mission.sqm file, to detect that the player is in the proper place to enable the self actions. Some lines of the dome script ...
name="dome";
expActiv="dome = [] execVM ""Trade\trade.sqf"";";
expDesactiv="terminate dome; canTrade = false; titleText [""You've left the dome"", ""PLAIN DOWN"", 3];";
When the player enters the dome the trade.sqf script runs ...
titleText ["You've entered the dome.","PLAIN DOWN"]; titleFadeOut 5;
canTrade = true;
In my fn_selfActions.sqf I have ...
if (canTrade) then {
- trade self actions are here -
}
The dome is working fine and I get the “You’ve entered the dome†and “You’ve left the dome†messages when testing.
The self action enabling is working fine and I can only access the trade self actions when I enter the dome.
What isn’t working is setting the global variable “canTrade†to “false†when the player exits the dome. When you exit the dome, the self actions are still enabled.
I try to set it to false in the dome script line ...
expDesactiv="terminate dome; canTrade = false; titleText [""You've left the dome"", ""PLAIN DOWN"", 3];";
But obviously, I’m doing something wrong J
How do I get the global variable “canTrade†set to “false†when a player exits the dome, so that the IF statement in my fn_selfActions.sqf will disable the trade self actions?
Thanks for any help.
** I figured it out, I needed to cancel the self actions