Jump to content
Sign in to follow this  
Asung

Troubleshooting, Can't get a replace an add action.

Recommended Posts

Hello,

I am having trouble getting something working in my mission. If anyone could give me some pointers or solutions I would be greatful. Here is the situation:

There is a IED under a table named "Dis1". There is a radio named "r1".

"r1" in the init has : " this addaction ["Gather AM/FM Radio parts","trap.sqf"]; "

Trap.sqf creates a grenade that blows up when the add action is used on r1.

Underneath the radio the IED is supposed to let the player know to be onguard and that interacting with the radio might be a trap. The IED can be defused and removed / moved (not sure if the IED script deletes the IED or not if defuse is sucessful, but the object disapears). It currently has the following in the init: " nul0 = [this,1] execVM "scripts\IEDdetect\IEDdetect_add.sqf"; "

I want to make it so that after the IED is defused, the addaction on the radio is removed and replaced by " r1 addaction ["Gather AM/FM Radio parts","baseradio.sqf"] " which does activate trap.sqf but rather baseradio.sqf

Any ideas?

Thanks,

Alex

Share this post


Link to post
Share on other sites

add this to the r1 script:

trap =

add this to the defuse script

r1 removeaction trap;

r1 addaction ["Gather AM/FM Radio parts","baseradio.sqf"];

Share this post


Link to post
Share on other sites

Hey,

I think that would work, but I don't know if i should modify the IED script as I have a lot of IEDs on the map. If I make that change to the script won't defusing any bomb on the map make the new addaction appear on r1?

---------- Post added at 01:58 AM ---------- Previous post was at 01:53 AM ----------

Heres something I tried, maybe theres a syntax error.

I made a trigger with the following properties:

-axis a = 0, axis b = 0

-Activation = none

-present

-condition dis != nil

-on act: r1 addaction ["Gather Disarmed AM/FM Radio parts","baseradio.sqf"]; r1 removeaction action1;

Properties of r1:

init: action1 = this addaction ["Gather AM/FM Radio parts","trap.sqf"];

Properties of dis1: nul0 = [this,1] execVM "scripts\IEDdetect\IEDdetect_add.sqf";

What I want this to do is this:

-If add action on radio "Gather AM/FM Radio Parts" is used without defusing the IED and making it disapear then trap.sqf will play

-If the IED/dis1 is defused, then the add action on the radio will be replaced with "Gather defused AM/FM radio parts" and will play baseradio.sqf

Thoughts?

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  

×