Jump to content
PDG.Jake

Editing Noob: Demolition Objective (Pleas Help)

Recommended Posts

I have been looking for a couple of days and I have not found anything that currently works in the @3Den editor for a demolition objective. 
What I want to happen:

-Player is assigned task "destroy weapon cache"

-Player Places charge to destroy objective

-Player detonates charge

-Task "destroy weapon cache" marked successful/complete 

- player moves to next objective.
What I need:

Some sort of module, task, trigger, etc. that can allow me to destroy an ammo box and complete an objective.

  • Like 2

Share this post


Link to post
Share on other sites

That's easy brotha!

Assuming you already know how to set up a task with modules, (and if you don't check THIS LINK OUT) link a trigger to the "Set task state" module (set to Succeeded) with this in the condition field:

!alive demoObjective1

where "demoObjective1" is the name of your weapon cache.

Done man!

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

I will give this a shot and provide feed back. Thanks much.

  • Like 2

Share this post


Link to post
Share on other sites

This TOTALY did the trick. I am new to editing and it took me a minuet to walk through the steps but I got it. Thanks man!

  • Like 2

Share this post


Link to post
Share on other sites
On 2/22/2018 at 10:41 AM, PDG.Jake said:

This TOTALY did the trick. I am new to editing and it took me a minuet to walk through the steps but I got it. Thanks man!

 

You could also utilize global variables and killed eventhandlers to give your missions a better feel, since the trigger fires as soon as the object is destroyed.

Would be a next step up from basic triggers and can become second nature once you get used on how to set it up.

Small example:

 

//ammo crate init field:

//this will wait 5 seconds after the object has been destroyed, before setting the flag to true
this addEventHandler ["Killed",{


	_delay = _this spawn {
	params ["_killed","_killer","_instigator"];

	sleep 5;
	missionNamespace setVariable ["TAG_flag_AmmoCrate1Destroyed",true,true];

	};


}];


//now in your trigger that sets the task to completed simply put this in the condition field:

missionNamespace getVariable ["TAG_flag_AmmoCrate1Destroyed",false];//if flag does not exist this returns false

 

I also recommend to move away from modules, triggers and other editor stuff once you figured out the basics, since .sqf allows for very complex non linear missions in terms of dynamic task creation/objective handling and replayability.

Take this as an example:

 

Mission Prancing Pterodactyl

Objectives:

  • Free the hostage
  • Grab the suitcase
  • Eliminate all hostiles

Now in a linear mission you could do all 3 tasks in any specific order and no repercussions, easily done in the editor.

 

Assume you have to eliminate all hostiles and free the hostage before picking up the suitcase, otherwise the suitcase could blow up.

The hostage could also be killed by the hostiles if it took you more than 5 minutes to enter the room where the hostage is held captive.

 

Imagine having to do this in the editor alone, a nightmare of triggers and setTaskstate modules, fairly simple using scripting.

 

Here's a small example of such a linear mission done through scripting, you could easily turn it into the example mentioned before by just adding some checks, could do this on the weekend if you're interested.

 

Cheers

  • Like 4
  • Thanks 3

Share this post


Link to post
Share on other sites
3 hours ago, Grumpy Old Man said:

You could also utilize global variables and killed eventhandlers to give your missions a better feel, since the trigger fires as soon as the object is destroyed.

Would be a next step up from basic triggers and can become second nature once you get used on how to set it up.

 

3 hours ago, Grumpy Old Man said:

I also recommend to move away from modules, triggers and other editor stuff once you figured out the basics, since .sqf allows for very complex non linear missions in terms of dynamic task creation/objective handling and replayability.

Take this as an example:

 

Mission Prancing Pterodactyl

Objectives:

  • Free the hostage
  • Grab the suitcase
  • Eliminate all hostiles

Now in a linear mission you could do all 3 tasks in any specific order and no repercussions, easily done in the editor.

 

Assume you have to eliminate all hostiles and free the hostage before picking up the suitcase, otherwise the suitcase could blow up.

The hostage could also be killed by the hostiles if it took you more than 5 minutes to enter the room where the hostage is held captive.

 

Imagine having to do this in the editor alone, a nightmare of triggers and setTaskstate modules, fairly simple using scripting.

 

Here's a small example of such a linear mission done through scripting, you could easily turn it into the example mentioned before by just adding some checks, could do this on the weekend if you're interested.

 

Cheers

ABSOLUTELY YESSSS!!!

That is the way to go, and the way I prefer, but the dude seam pretty new to Arma so I keep it as simple as possible for him.

@PDG.Jake   If you can, follow the path Grumpy Old Man  showed you. that' the way to go.       

  • Like 2

Share this post


Link to post
Share on other sites
16 hours ago, zagor64bz said:

 

ABSOLUTELY YESSSS!!!

That is the way to go, and the way I prefer, but the dude seam pretty new to Arma so I keep it as simple as possible for him.

@PDG.Jake   If you can, follow the path Grumpy Old Man  showed you. that' the way to go.       

Will do, I actually have ~ 2,000 hrs on arma as a pointman for my milsim. I have about 8 hours in the editor prior to making this mission. Thank you guys so much for all your help.

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, PDG.Jake said:

Will do, I actually have ~ 2,000 hrs on arma as a pointman for my milsim.

Ops, sorry for that brotha!

Nevertheless, with almost 5000 hrs I feel like  a noob myself..LOL..we all learn something new every day man.

  • Like 1

Share this post


Link to post
Share on other sites
On 2/22/2018 at 4:52 AM, Grumpy Old Man said:

 

You could also utilize global variables and killed eventhandlers to give your missions a better feel, since the trigger fires as soon as the object is destroyed.

Would be a next step up from basic triggers and can become second nature once you get used on how to set it up.

Small example:

 


//ammo crate init field:

//this will wait 5 seconds after the object has been destroyed, before setting the flag to true
this addEventHandler ["Killed",{


	_delay = _this spawn {
	params ["_killed","_killer","_instigator"];

	sleep 5;
	missionNamespace setVariable ["TAG_flag_AmmoCrate1Destroyed",true,true];

	};


}];


//now in your trigger that sets the task to completed simply put this in the condition field:

missionNamespace getVariable ["TAG_flag_AmmoCrate1Destroyed",false];//if flag does not exist this returns false

 

I also recommend to move away from modules, triggers and other editor stuff once you figured out the basics, since .sqf allows for very complex non linear missions in terms of dynamic task creation/objective handling and replayability.

Take this as an example:

 

Mission Prancing Pterodactyl

Objectives:

  • Free the hostage
  • Grab the suitcase
  • Eliminate all hostiles

Now in a linear mission you could do all 3 tasks in any specific order and no repercussions, easily done in the editor.

 

Assume you have to eliminate all hostiles and free the hostage before picking up the suitcase, otherwise the suitcase could blow up.

The hostage could also be killed by the hostiles if it took you more than 5 minutes to enter the room where the hostage is held captive.

 

Imagine having to do this in the editor alone, a nightmare of triggers and setTaskstate modules, fairly simple using scripting.

 

Here's a small example of such a linear mission done through scripting, you could easily turn it into the example mentioned before by just adding some checks, could do this on the weekend if you're interested.

 

Cheers

@Grumpy Old Man Hello GOM, I need to do as you suggest and move away from modules, triggers, etc. The "small example" you originally provided has expired. Anything you can point me to that does the same?

Share this post


Link to post
Share on other sites
5 hours ago, Grumpy Old Man said:

Hey,

just try the link again, I reuploaded the file.

 

Cheers

Got it, thanks GOM!

Share this post


Link to post
Share on other sites

Hey there, a wee bit (or more than just that) late to reply but I believe you could get away without the need to use a trigger here. I might be wrong but I believe if you go the Grumpy-Old-Man's way (event handler approach) you could skip the trigger and set the task to "COMPLETE" inside the event handler.

 

Adapting Grumpy-Old-Man's code this could potentially look like

// Ammo crate init field:

// This will wait 5 seconds after the object has been destroyed, before setting the flag to true
this addEventHandler ["Killed",{
	// "Spawn" code to allow for delay
	_delay = _this spawn {
	sleep 5; // Wait for 5 seconds

	// Set the task to SUCCEEDED
	["yourTaskID", "SUCCEEDED"] call BIS_fnc_taskSetState;
	};
}];

This, of course, implies that you have to first give the task a "name", which is trivial and can be done easily from the editor (where I assume you create the task) at the TaskID of the task.

 

Please note that this is not tested and I may be missing something here (as is usually the case 😅), so treat with caution and make sure to test before use.

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, ZaellixA said:

Hey there, a wee bit (or more than just that) late to reply but I believe you could get away without the need to use a trigger here. I might be wrong but I believe if you go the Grumpy-Old-Man's way (event handler approach) you could skip the trigger and set the task to "COMPLETE" inside the event handler.

:yeahthat:

Another benefit of the event handlers' usage is increased performance.

IIRC, triggers are constantly checked, while event handler "fire" only when the event actually happens. In a large mission with a lot of triggers that could help a lot, and make a difference in FPS.

  • Like 1

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

×