Jump to content
Sign in to follow this  
HeroesandvillainsOS

Would anyone be willing to help a newbie make a simple HVT task (for MP)?

Recommended Posts

Well...it's not simple to me. :)

Been messing around with YouTube and whatnot and all the guides are pretty old.

I have a series of MP ALiVE missions I want to release soon. They're basic insurgencies and pretty module based. In the final mission, I want there to be an optional task to assassinate a HVT. I have an office building set up for him and I have him placed on the map but what to do after that I really am not sure.

I'd like the task to be visible to all playable units. I don't need anything fancy and I don't need the mission to end when he gets killed. I just would like to have the task show up in the tasks section on the menu and the task to complete when he is dead. The mission is designed for a dedicated server.

Any help or any link that's relevant with the new Eden editor would be great.

Share this post


Link to post
Share on other sites

you need to create HVT server side and task side(WEST) server side too.

For tasking use bis functions .

Everything you need  is here.

 

To set task you need :

 

BIS_fnc_taskCreate

 

and

 

BIS_fnc_taskSetState

 

When HVT is killed update task with

 

BIS_fnc_taskSetState.

 

If you want to delete task after that use

 

BIS_fnc_deleteTask

 

So easy is that

 

Architecture:

 

  • create HVT server side
  • create task using BIS_fnc_taskCreate
  • add "killed" eventhandler to HVT
  • add code to HVT "killed" eventhandler which would update task when HVT is killed
  • task enemy group that they would not just stay study there. Use CBA add task function (is awesome IMHO)
  • Like 1

Share this post


Link to post
Share on other sites

Thanks Davidoss.

Yikes. None of that makes any sense to me at all. Could you give me an example of how to implement something or a relevant video I can watch (I comprehend things much better when I see it)?

Or would there be a simpler way to accomplish this via a trigger or whatnot?

Share this post


Link to post
Share on other sites

For example, here's a video that uses a trigger to create a kill HVT task:

This is done in Eden.

Is there any reason this wouldn't work in MP?

Basically, it uses the "!alive unitname" method, which is synced to a task module and task succeeded module; all synced to the player units. That seems a lot simpler than what was linked here but I realize MP missions are a totally different beast.

Share this post


Link to post
Share on other sites

Well, give it a try and tell us if it works for you! It can equally well work or not, it's hard to tell in advance.

 

 

 

There's two ways missions are made for ArmA:

Either you rely on the editor and work it all out using the provided modules

OR

You use the editor only for the basics (placing units/objects), and do all the rest in script files (.sqf) .

 

Davidoss describes the latter way. Most veteran mappers/modders go for the script approach, because it is WAY more versatile and powerful, if you know what you're doing. I actually believe many started with the first approach, but inevitably stumbled upon issues they couldn't solve inside the editor, forcing them to learn sqf.

That's why many of the sqf mappers/modders can't really help you much with the editor modules, they simply are not using them.

 

If you are new to Multiplayer mapping, there's a very important concept you have to learn: Locality. An excellent tutorial (and learning resource in general) is KillzoneKid's page.

 

In your specific case, the big question is: Are the created/added/updated tasks local to each player or synchronized globally? Again, Biwiki tells you what's up. Tasks are created local for each player. So you as a mapper have to ensure that the tasks are created for everyone. This is fairly easy for missions where everyone plays together from start to finish, but is much trickier for missions that allow Join-In-Progress (JIP).

 

If you rather want to stick with modules, see if it works for you (and feel free to report back here, people - me included - are always eager to learn!).

If you want to script, and the task should be given from the start of the mission, this would be a simple approach:

Add this to your init.sqf:

[west,["task1"],["Kill this super important officer!","Eliminate HVT","hvtmarker"],hvt,true,2,true] call BIS_fnc_taskCreate; // This creates the task at the start of the mission.

hvt addMPEventHandler ["MPKilled", {
// This event handler is added to the object named hvt (placed in editor). The code inside the curly brackets will only execute when the condition MPKilled is true. The condition simply means "hvt is no longer alive".
    ["task1", "SUCCEEDED",true] spawn BIS_fnc_taskSetState; // If hvt is dead, we update the task to show it was completed successfully.
}];
Assumption is:

Your team plays as west.

The HVT unit is named "hvt".

Code is not tested, but should be easy enough to make it work if errors occur.

  • Like 1

Share this post


Link to post
Share on other sites

Well, give it a try and tell us if it works for you! It can equally well work or not, it's hard to tell in advance.   There's two ways missions are made for ArmA:Either you rely on the editor and work it all out using the provided modulesORYou use the editor only for the basics (placing units/objects), and do all the rest in script files (.sqf) . Davidoss describes the latter way. Most veteran mappers/modders go for the script approach, because it is WAY more versatile and powerful, if you know what you're doing. I actually believe many started with the first approach, but inevitably stumbled upon issues they couldn't solve inside the editor, forcing them to learn sqf.That's why many of the sqf mappers/modders can't really help you much with the editor modules, they simply are not using them. If you are new to Multiplayer mapping, there's a very important concept you have to learn: Locality. An excellent tutorial (and learning resource in general) is KillzoneKid's page. In your specific case, the big question is: Are the created/added/updated tasks local to each player or synchronized globally? Again, Biwiki tells you what's up. Tasks are created local for each player. So you as a mapper have to ensure that the tasks are created for everyone. This is fairly easy for missions where everyone plays together from start to finish, but is much trickier for missions that allow Join-In-Progress (JIP). If you rather want to stick with modules, see if it works for you (and feel free to report back here, people - me included - are always eager to learn!).If you want to script, and the task should be given from the start of the mission, this would be a simple approach:Add this to your init.sqf:

[west,["task1"],["Kill this super important officer!","Eliminate HVT","hvtmarker"],hvt,true,2,true] call BIS_fnc_taskCreate; // This creates the task at the start of the mission.

hvt addMPEventHandler ["MPKilled", {
// This event handler is added to the object named hvt (placed in editor). The code inside the curly brackets will only execute when the condition MPKilled is true. The condition simply means "hvt is no longer alive".
    ["task1", "SUCCEEDED",true] spawn BIS_fnc_taskSetState; // If hvt is dead, we update the task to show it was completed successfully.
}];
Assumption is:Your team plays as west.The HVT unit is named "hvt".Code is not tested, but should be easy enough to make it work if errors occur.

Thanks so much. I'll try this and also look through the links later. I'm eager to learn.

So just to be clear, this will not work for JIP, correct? I don't generally host the missions I'm making but since I want to release them, I'd like players to have that option to have the task work for JIP. If it's not set up that way, I'll look through your links and see if I can figure out how to adjust the init.sqf file.

I really appreciate it. Thanks for this.

Share this post


Link to post
Share on other sites

If you use  bis task create on server as i told you this will work for JIP too.

Share this post


Link to post
Share on other sites

If you use bis task create on server as i told you this will work for JIP too.

Davidoss, as always I appreciate the help man. You're a great asset to the community here. I don't know how else to put it so please take no offense. How can you expect someone that's never done this before to make heads or tails out of the links you posted?

It's like it's literally in a different language. It doesn't even tell you where to put the stuff (I don't blame you for that. I blame BIS and the people controlling the wiki for not using more clear cut examples).

Try to put yourself in the shoes of someone that knows nothing about these things and tell me those links would make sense to you.

  • Like 2

Share this post


Link to post
Share on other sites

Its not so bad, do not complain.

Everything are described and what you need is some understanding about locality.

Share this post


Link to post
Share on other sites

Its not so bad, do not complain.

Everything are described and what you need is some understanding about locality.

The example descriptions on the wiki don't even tell you where the text goes! One can maybe assume description.ext but I'm guessing that's wrong. Not to mention, the wiki makes no mention of how to implement the text anywhere in the mission files. Obviously the target would need to be named and referenced properly in the sqf, plus a myriad of other things one could never suss out unless they've done this before.

The wiki is not for newbies. Let's not pretend that it is.

Like I said, please don't take this personally. You've helped me out in the past and I always appreciate that and what you do for the community.

EDIT: Just to add that Davidoss has reached out to help me get this working so between that, the video I linked and Sehshi's post I have plenty of awesome options. Also proving the community here is the best. :)

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  

×