Forum Jump :

Author Message


Posts: 6
Rank:


Level: Member

Country: nz
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2013-08-21 06:21        
     
Hi guys
I was making a mission where you start in Stary Sobor then a small enemy group arrives you then kill them then it adds a waypoint where you have to go to see the rest of your team. You then join a group and then your car and 2 others drive up to NWAF to assault the army there. Everyone gets out their vehicles then goes through killing enemies.

So yeah I highlighted the things red that I need help on.

"then it adds a waypoint"
In this bit what I need help on is actually adding the waypoint to the map.

"join a group"
How do you make the player get added to a group using scripting? I want it so when I get to the waypoint it adds me then I have to get in the vehicle with the group then they drive off.

"Everyone gets out their vehicles then goes through killing enemies"
So I dont know how to make the entire group disembark. If I do the waypoint "UNLOAD" only the passenger gets out, the driver and the gunner stay in/on. Is there a script to get the whole team to get out aswell as turn the car off?

So yeah any help is appreciated.


Author Message


Posts: 334
Rank:


Level: Member

Country: de
Location:
Occupation: Student
Age: 29
In-game name:

 
#2 Posted at 2013-08-21 07:44        
     
are you familiar with triggers?
ist it mp or sp?

Added 7 minutes later:

add waypoint:
group player addWaypoint [getMarkerPos "NEWWAYPOINT", 0];

join:
[player] join (group UNITTOJOIN);

disembark all units from players group:
{
commandGetOut _x;
}
forEach (units (group player));

This post was edited by Coding (2013-08-21 07:52, ago)


Advertisement


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 45
In-game name: kylania

 
#3 Posted at 2013-08-21 07:52        
     
Here's a demo mission. :)

Since we're working with players I used tasks rather than waypoints until the end when AI leads the assault on the barn.

Basically every trigger adds a new task as you do the steps of the mission. First killing the crew, then stealing the car, then reaching Novy Sobor, then joining your group and finally clearing the barn. Sometimes the destination is a marker other times it's an object.

The join a group is simple. I show both joining a group as a member and later becomming the leader. To join a group it's:

[player] joinSilent reconGroup;
Where reconGroup is the name of a group.
To become leader at the end of the mission it's:

reconGroup selectLeader player;

For making the units attack I left the group as AI and gave them Seek and Destroy waypoints. In this case I had a LAV-25 so abandoning the vehicle, your main force projection tool, would be unwise, but i did send it off on it's own to attack. Synched GET OUT for the ground troops and TRANSPORT UNLOAD for the vehicle did the 'everyone out' trick. To abandon you'd just use a GET OUT waypoint.

Coding, don't need forEach with commandGetOut this works:

commandGetOut units groupName;


Author Message


Posts: 334
Rank:


Level: Member

Country: de
Location:
Occupation: Student
Age: 29
In-game name:

 
#4 Posted at 2013-08-21 08:03        
     
# Pirin :
Coding, don't need forEach with commandGetOut this works:

commandGetOut units groupName;
Sorry didnt know... Never used it.
Thanks for the advice.


Author Message


Posts: 6
Rank:


Level: Member

Country: nz
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2013-08-21 08:35        
     
@Pirin
aawww you even named it joshdemo :)
Shot man im checkin it out.
Thanks for that dude.

Also how do you name groups? And is there a way I can edit the demo to see how you did it?
If you can could you record it or something? I can quite work it all out from the text.

This post was edited by _-Josh-_ (2013-08-21 08:57, ago)


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 45
In-game name: kylania

 
#6 Posted at 2013-08-21 15:25        
     
To name a group just put this in the group leader's init:

reconGroup = group this;

Then you can refer to the group as reconGroup rather than group someUnit or whatever.

The demo is designed to be played in the editor. Simply move the joshdemo.chenerarus folder to your missions folder, which is usually My Documents\ArmA 2 Other Profiles\YourName\missions

Then open up ArmA2, go to Singleplayer, then Editor. Load the mission and Preview. That way you can see the triggers and how the mission works.


Author Message


Posts: 6
Rank:


Level: Member

Country: nz
Location:
Occupation:
Age:
In-game name:

 
#7 Posted at 2013-08-22 07:54        
     
Thanks again

-EDIT-

Hey man I've got the first script from the trigger near the player at the start.

taskhint ["Task Assigned!\nKill the crew!", [1, 1, 1, 1], "taskCurrent"];
tskKillCrew = player createSimpleTask ["Kill Crew"];
tskKillCrew setSimpleTaskDescription ["Kill the crew harassing the priest and steal their UAZ.", "Kill the Crew", "Crew"];
tskKillCrew setSimpleTaskDestination (getMarkerPos "crew");
player setCurrentTask tskKillcrew;

I cant really make sense of how to add the waypoint/objectives position, mine just says "Guards 11000 m" because I changed it to guards instead of crew.
So how do I know where its going to go?

-Another EDIT-

Never mind I didn't realise there was a marker. Its all good now thanks alot. :)

This post was edited by _-Josh-_ (2013-08-22 09:27, ago)


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 45
In-game name: kylania

 
#8 Posted at 2013-08-22 16:07        
     
Here's what all that means step by step:

taskhint ["Task Assigned!\nKill the crew!", [1, 1, 1, 1], "taskCurrent"]; 

This pops up the ArmA2 style "new task" on screen message. The [1,1,1,1] means the text is white. The "taskCurrent" is the style of the circle icon, in this case for your currently assigned task. "Task Assigned!\nKill the crew" is the text of the message. The \n is a new line, so it prints out:

Task Assigned!
Kill the crew!

tskKillCrew = player createSimpleTask ["Kill Crew"];

This creates a new task for the player. tskKillCrew is a variable name which we'll use to refer to this task later with commands. "Kill Crew" is the name of the task in your Task list for the player.

tskKillCrew setSimpleTaskDescription ["Kill the crew harassing the priest and steal their UAZ.", "Kill the Crew", "Crew"];

Here we use the tskKillCrew to give that task a description. "Kill the ... their UAZ" is the text for the task. "Kill the Crew" is the title. "Crew" is the text that displays on the waypoint in game world.

tskKillCrew setSimpleTaskDestination (getMarkerPos "crew"); 

Here we set the destination for the task. It will show on the map as a Circle icon and in the 3D world you'll get a waypoint marker saying "Crew" as defined in the previous step. The (getMarkerPos "crew") makes this position the same as the marker named "crew". You could also use:

tskKillCrew setSimpleTaskDestination (getPos someObject); 

to make the position the position of an object instead.

Finally,

player setCurrentTask tskKillcrew;

This selects the task as the current task for the player so it shows up as current in their task list and they see the destination waypoint.


Author Message

SavageCDN  

Armaholics priest


Posts: 475
Rank:


Country: ca
Location: Ottawa
Occupation: Fighting with Exchange
Age: 46
In-game name: =VG= SavageCDN

 
#9 Posted at 2013-08-22 18:10        
     
^great explanation even more cookies for you :-D

Bless you my son.

Author Message


Posts: 334
Rank:


Level: Member

Country: de
Location:
Occupation: Student
Age: 29
In-game name:

 
#10 Posted at 2013-08-22 18:13        
     
kylania/pirin has obviously too much time for "others" :D
nice for the "others"!!!
"others" includes me ;)


Author Message


Posts: 6
Rank:


Level: Member

Country: nz
Location:
Occupation:
Age:
In-game name:

 
#11 Posted at 2013-08-23 07:29        
     
Yeah thanks Pirin I managed to work it all out on my own, but at least anyone else who wants or needs help on a similar problem can now look at this post and be happy :)

Thanks again