Jump to content
Sign in to follow this  
Havoc Company

Script Locality issue with ACE_NUKE

Recommended Posts

Hey all,

I'm making a PVP mission where OPFOR arm a nuclear device with Bluefor having to disarm it.

Init.sqf

_object = (_this select 0);

publicVariable disableStatus;

disableStatus = false;

publicVariable armStatus;

armStatus = false;

publicVariable n_armed;

n_armed = false;

armAction = _object addAction["Arm Bomb","rScripts\EnableBomb.sqs"];

disarmAction = _object addAction["Disarm Bomb","rScripts\DisableBomb.sqs"];

exit;

if armStatus = false;

then

{

n_armed = true;

armStatus = true;

gamelogic1 globalChat "BOMB HAS BEEN ARMED - 20 MINUTES UNTIL DETONATION";

}

else

{

exit;

}

;disarmAction = _object addAction["Disarm Bomb","rScripts\DisableBomb.sqs"]

;

if armStatus = true;

then

{

gamelogic1 globalChat "Bomb is being disarmed, this will take 10 seconds";

disarmStatus = true;

;n_armed = false

;armStatus = false

}

else

{

exit;

}

exit

Trigger contains the NUKE command

Condition n_armed

Statement:

["ACE_B61_50", (getPosATL nuke_location)] call ACE_fnc_NuclearGroundBurst;deleteVehicle b_win;deleteVehicle disarmTrigger;

Game Logics

nuke_location

The NUKE trigger activates as I get the text message assigned to it, however the nuke will not explode.

Share this post


Link to post
Share on other sites
Did you define the unit you called nuke_location?

Hey Echo, what do you mean by this? In the init.sqf? If so how would I do it?

Share this post


Link to post
Share on other sites

Your if statements are wrong.

with "=" you assign something. If you want to check something you have to use "==".

And between the if and then you cant place a ";".

Read this:

http://community.bistudio.com/wiki/Control_Structures#if-Statement

and this

http://community.bistudio.com/wiki/Control_Structures#SQS_syntax_.28deprecated.29

also in sqs scripts you cant use multiline commands.

Share this post


Link to post
Share on other sites

SNIP.

Hey Michael,

Cheers for the heads up on syntaxing, as mentioned the scripts are firing at the moment, and setting the variable to true. I know this due to the fact that the trigger containing the nuke fires and gives the "OPFOR WIN" message, but the nuke does not explode.

Will edit the sqs anyway to fit in with the correct syntax.

Share this post


Link to post
Share on other sites
Or learn the sqf syntax. If I look at your code I would recommend learning sqf. Your code looks at the moment more like sqf than sqs ;)

Maybe that helps you:

http://community.bistudio.com/wiki/SQS_to_SQF_conversion

Yeah more used to coding in Java / VB.NET syntax... so SQS is just a pain in the ass.

Any idea of the locality issue though? Could be an ACE bug but I'm not sure.

Edited by rexehuk

Share this post


Link to post
Share on other sites

PublicVariable the n_armed. A script that is called via addaction is local to the caller. So the n_armed var will only be true on this client.

But the ace nuke must be called serverside.

E: of course after setting it to true

E2: are you testing in editor? then it should work without the publicVariable (but for MP you need it!). could you post the updated scripts?

Edited by MichaelGER

Share this post


Link to post
Share on other sites

I've confirmed it's not an issue with my scripts... redone it all with triggers and it still just says "OPFOR WINS" which is the text event for my nuke trigger, but still no nuke.

Trigger is:

["ACE_B61_50", (getPosATL nuke_location)] call ACE_fnc_NuclearGroundBurst;

nuke_location exists as a INVISIBLE H, deleted the game logic named as nuke_location to try the H instead, but still no joy...

Really doing my head in trying to get what should of been a very simple mission working properly. It works testing in the SP and MP editor, but does no work on the dedi.

I have the server game logic on the map also, any ideas? :butbut:

**EDIT** Finally working...

Edited by rexehuk

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  

×