Jump to content
Sign in to follow this  
FelixK44

Part of script not working?

Recommended Posts

//Halo2.sqs

[Player,10000]exec "Modules\Halo2\Scripts\HALO_init.sqs";

_unit addWeapon "ACE_Earplugs";

_unit addWeapon "ACE_GlassesGasMask_US";

[_unit] execFSM "x\ace\addons\sys_goggles\use_earplug.fsm";

[_unit, "ACE_GlassesGasMask_US"] execFSM "x\ace\addons\sys_goggles\use_glasses.fsm";

_action = _unit addaction ["TEST2","Modules\HALO2\scripts\RemoveGear.sqs"];

exit

//RemoveGear.sqs (different file)

[_unit] execFSM "x\ace\addons\sys_goggles\remove_glasses.fsm";

_unit removeWeapon "ACE_GlassesGasMask_US";

_action = _unit removeAction ["Remove HALO Gear", "Modules\Halo2\scripts\RemoveGear.sqs"];

Well, I'm trying to create a Lite HALO script. Everything works up until the bolded line for some reason the action isn't added to the unit, and I'm really not sure what the problem is? :(

Edited by FelixK44
more info

Share this post


Link to post
Share on other sites

Not quite sure, it may be something to do with SQS's compatibility with FSM, or lack-there-of in this case?

Share this post


Link to post
Share on other sites

EDIT: Script is working now!

I have a question tho...in two of my scripts _unit = player; will the "player" thing work in MP also does "player" mean the player activating the script or all human players?

//Halo3.sqf

_unit = player;

_action = _unit addaction ["Remove HALO Gear","Modules\HALO2\scripts\RemoveGear.sqf"];

//RemoveGear.sqf

_unit = player;

[_unit] execFSM "x\ace\addons\sys_goggles\remove_glasses.fsm";

_unit removeWeapon "ACE_GlassesGasMask_US";

_action2 = _unit removeAction ["Remove HALO Gear", "Modules\Halo2\scripts\RemoveGear.sqs"];

Edited by FelixK44

Share this post


Link to post
Share on other sites

Player means the character of the client the script is running on.

Share this post


Link to post
Share on other sites

Have another problem and didn't want to start a new thread... this script is working but its adding the action even if the unit doesn't have the correct weapon what am I doing wrong?

if(isDedicated) exitWith{};

WaitUntil{not isNull player};

//Specify weapons

_weapons = ["ACE_ANPRC77","ACE_PRC119","ACE_PRC119_MAR","ACE_PRC119_ACU","ACE_P159_RD90","ACE_P159_RD54","ACE_P159_RD99","ACE_P168_RD90"];

_weapon = "false";

if(count _weapons > 0) then {

{_weapon = _weapon + " || player hasWeapon " + str _x} foreach _weapons;

} else{_weapon = "true"};

_callingrequirements = _weapon;

player addAction ["<t color=#FFCC00'>Call Artillery</t>", "Artillery1.sqf","],-1,false,true,"" _callingrequirements];

Share this post


Link to post
Share on other sites

Try this version of it out, there were several errors in the script that I have made some fixes.

if(isDedicated || isServer) exitWith{};
WaitUntil{!isNull player};

//Specify weapons
_weapons = ["ACE_ANPRC77","ACE_PRC119","ACE_PRC119_MAR","ACE_P RC119_ACU","ACE_P159_RD90","ACE_P159_RD54","ACE_P1 59_RD99","ACE_P168_RD90"];

_weapon = false;
if(count _weapons > 0) then {
{
	_bag = unitBackpack player;
	_class = typeOf _bag;
	if(_class == _x) exitWith{_weapon = true};
} foreach _weapons;
} else{
_weapon = false;
};

_callingrequirements = _weapon;


player addAction ["<t color='#FFCC00'>Call Artillery</t>", "Artillery1.sqf",""],-1,false,true,"" _callingrequirements];

Post back the results!

Goodluck

-Bigshot

Share this post


Link to post
Share on other sites

The script works thanks bigshotking! :o

Going to post script for "Radio Requirements" just encase someone else wants to use it! just edit these parts pxs_satcom_oa\init_satellite.sqf and Operate Satcom for custom name/script.

if(isDedicated) exitWith{};
WaitUntil{not isNull player};

//Specify weapons
_RadioWeapons = ["ACE_ANPRC77","ACE_PRC119","ACE_PRC119_MAR","ACE_P RC119_ACU","ACE_P159_RD90","ACE_P159_RD54","ACE_P1 59_RD99","ACE_P168_RD90"];

_RadioWeapon = "false";
if(count _weapons > 0) then {
{_RadioWeapon = _RadioWeapon + " || player hasWeapon " + str _x} foreach _RadioWeapons;
} else{_RadioWeapon = "true"};

_RadioRequirement = _RadioWeapon;


player addAction ["<t color='#FFCC00'>Operate SATCOM</t>", "pxs_satcom_oa\init_satellite.sqf[", ""], 1, true,true,"", _RadioRequirement];

Edited by FelixK44

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  

×