Jump to content
Sign in to follow this  
iceman77

Multiple same addaction on untit

Recommended Posts

Hi, I was working on a mission that involves aquiring/canceling a mission via speaking with an npc using addaction.My problem is that multiple same actions appear on the scroll menu. I have 2 addactions iam trying to workout.

1.) "Sabotage Mission" uses the mission1.sqf

2.) "Cancel Sabatoge Mission"uses the cancelmission1.sqf

Iam basically trying to spawn a DAC zone via the addaction ID "sabatoge".Once this addaction has been used iam trying to delete the "sabatoge" addaction and replace it with ID "cancel" addaction. multiple same actions endup on the scroll menu once i activate the mission, cancel it and then activate it again.

I have a unit placed on the map named CO. In his init field i have

sabotage = co addAction ["Sabotage Mission","mission1.sqf"]

Then i have some sqf files in my mission folder named mission1.sqf and cancelmission1.sqf

//mission1.sqf
_Zone1 = ["z1",[7,0,0],[5,1,50,50],[1,1,50,30],[],[],[0,10,0,0]];
[(position mission1),1000,1000,0,-108.555,_Zone1] call DAC_fNewZone;
co removeaction sabotage;
Cancel = co addAction ["Cancel Mission","cancelmission1.sqf"]

//cancelmission.sqf
["z1"] call DAC_fDeleteZone;
co removeaction cancel;
sabatoge = co addaction ["Sabatoge Mission","mission1.sqf"];

any help would be appreciated.

Share this post


Link to post
Share on other sites

Sorry, I might not have understood what you're asking here? If you're just wanting to remove the action from the player's menu use this:

Put this in the mission init.sqf

act1 = co addAction ["Sabotage Mission","mission1.sqf"]

Then at the end of the mission1.sqf add

co removeAction act1;

Share this post


Link to post
Share on other sites

Well, I have achieved using the addaction and also removing it. Basically, I have a map where a variety of missions are going to be avalible via addaction menu on an object (officer npc). I want the ability to accept a mission and cancel the accepted mission.

What iam trying to achieve here:

#1 addaction Mission Accept - this addaction runs a script that spawns my objectives / enemy units/markers and then also removes the addaction "mission accept' from the officer and adds a new addaction:

#2 addaction Cancel Mission - wich deletes/removes current objectives/units/markers etc and then also removes the "cancel mission" addaction and re-adding the "mission accept" addaction...

over and over... rinse and repeat.

my problem is that i get Multiple addactions on the scroll menu

example:

Mission Accept

Mission Accept

Mission Accept

Cancel Mission

Cancel Mission

Cancel Mission

how do i fix this so everytime i add an addaction and also remove an addaction the scroll menu dosent get filled up with multiple same addactions?

Share this post


Link to post
Share on other sites

Do you want multiple missions to be available at once, or do you want to make it so that only one mission can be accepted at a time?

Share this post


Link to post
Share on other sites
Do you want multiple missions to be available at once, or do you want to make it so that only one mission can be accepted at a time?

this coop will have diff npcs you can aquire objectives from. each npc will have ~ 3-5 missions chooseable. But, i want no more than 1 mission active at all times out of all npcs.

For now though, just to simplify things I want to be able to add the addaction and remove it reliably on just 1 npc and just for 1 mission...for now.

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  

×