Jump to content
Sign in to follow this  
fubarno1

mount vehicle

Recommended Posts

I am trying to get 2 teams to mount 2 different vehicles then proceed to their mission location.

after they have been ejected from the Helli's and follow the waypoints to meet the rece guys with the trucks I have tried adding this command to a waypoint.

{_x assignasCargo t1} forEach units grpw1; p1 assignasdriver t1 (this works fine)

{_x assignasCargo t2} forEach units grpw2; p2 assignasdriver t2 (this does not)

As you can see the commands are exactly the same but for group and truck numbers, so I don't understand why it works for one group and not the other.

Group 2 instructs p2 to the driver position OK but then the rest of the group proceeds on foot and wont try to mount the truck.

Am I missing something glaringly obvious?

I tried with a waypoint as load and get in (sync'd) but the trucks dont wait, as soon as the order is given to mount the trucks sod off by themselves. bugger if i know why group 1 is working but group 2 wont.

Share this post


Link to post
Share on other sites

You probably just screwed up your group or truck name. Happens all the time... wink_o.gif

Double and triple-check all your names, and I'm sure you'll find the problem.

Share this post


Link to post
Share on other sites

rofl.gif hence my idiot proof naming chart Truck 1 = t1 Truck 2= t2 cant get easier than that rofl.gif

I tried with just the 2 groups and the 2 trucks with nothing else on the map, and still group 1 would mount but group 2 wouldn't, even tried a copy of group 1's command and just renamed everything to group 2 and t2 and still that wont work...bloody AI crazy_o.gif

I'll try the moveincargo command and see if that works.

I also would like to know how to instruct an AI to destroy a building with satchel charge, and the trigger setup for a building not present if anyone knows?

Share this post


Link to post
Share on other sites

I could help you with the building destroy:

Make a unit with enough satchels to blow that building.

Place a waypoint near building, that you wanna blow up. In "On activation" field type:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">UnitName fire "PipeBombMuzzle"

then make another waypoint, where you want soldier to put another satchel with same text inside "On activation" field.

You can make as many those waypoints, as many satchels soldier has.

After you're done with placing bomb waypoints put a new waypoint with this in "On activation" field:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">UnitName action ["TOUCHOFF", UnitName]

this will blow the bombs up, so put it far enough, so the soldier won't be killed by explosion.

How to detect if building was destroyed ?

Place Trigger.

Into "Condition" field put:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">damage (position player nearestObject 123456) >= 1

(replace 123456 with ID number of building/object, that you wanna blow up).

Then just select something, that will be triggered by this.

Share this post


Link to post
Share on other sites

Thanks deadfast i knew it would be something as simple as that whistle.gif

Cheers smile_o.gif

Share this post


Link to post
Share on other sites

i have exactly the same prob as in top post.

A downed heli. pilot and gunner getout. I come by with rescue rheli/rpilot. Pilot gets in, gunner not!? The gunner just stands next to the downed heli.

; heli downed

unassignvehicle pilot

unassignvehicle gunner

;pickup area?

@((rpilot distance heli)<100)

pilot assignascargo rheli

gunner assignascargo rheli

[pilot, gunner] orderGetIn true

!?!?!?

Share this post


Link to post
Share on other sites

Could be that both guys want to hop into the same cargo position and therefore only one makes it into the helo.

I would either try to group them once they are out of the wrecked helo, or assign specific cargo positions to them. Even a timed delay between the getIn routine could help.

Share this post


Link to post
Share on other sites
Could be that both guys want to hop into the same cargo position and therefore only one makes it into the helo.

I would either try to group them once they are out of the wrecked helo, or assign specific cargo positions to them. Even a timed delay between the getIn routine could help.

Good points. Tried some of them allready. Timing doesn't help.

I thought of assigning a specific cargo spot (but have to figure out how), but that can't be a good solution in the end because the 'assignascargo' should figure it out automatically.

My guess is that the gunner somehow is still assigned to the downed heli (despite the new assignment). Mind you both pilot and gunner were playable and used in character switching before the new assigments and boarding the rescue heli are performed. ... Note that if i force the rescue at mission start, so i dont go into battle with the pilot/gunner in heli and don't character switch, the pilot and gunner both board (at least i've seen them doing this).

(sorry, it must be difficult to vision the prob. But it is cumbersome to create a solid mission when these weird things happen when the script looks simple/clear enough)

None of the units go to the veh no matter what?

As said: Only 1 goes in!

Share this post


Link to post
Share on other sites

Are you using a waypoint or anything like that to get the second vehicle moving? Also they will not get in unless they are ordered to get into the vehicle. Are the waypoints setup via the editor or are they dynamic? If they are dynamic can you post the script that generates the waypoints, groups etc? Sometimes i have found that the groups will cause the issue, or just the method that you create the unit will cause it. Also if the vehicle is to close to another object they sometimes will not load into it via scripts. I have seen it work inside the editor if placed in almost the same locations as the script does it. hard to say. Ill be more than happy to see if i can get it working for you.

Share this post


Link to post
Share on other sites

it is all dynamic scripting, heavily beta status, building on this mission

Idea is straightforward. I fly Cobra as pilot/gunner. In case of probs i do action 'rescue me'. rescue.sqs switches me to rescue blackhawk (rheli, with rpilot as player) with which i have to pickup the (now non playable) pilot/gunner ... if i arrive at the heli spot the pilot/gunner should board my blackhawk.

I start as gunner (player), with pilot set as playable in a Cobra(heli)

snippets:

init.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

ro=0

_id1 = heli addAction ["Rescue us", "rescue.sqs"]

hint format ["Max Qubit's The Convoy\nversion 0.4 jan 26, 2007"]

~10

exit

rescue.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

ro=1

;rescue team

;rpilot assignasdriver rheli

rpilot setCombatMode "BLUE"

rpilot setBehaviour "CARELESS"

rgunner1 setBehaviour "COMBAT"

rgunner2 setCombatMode "RED"

rgunner1 setBehaviour "COMBAT"

rgunner2 setCombatMode "RED"

addSwitchableUnit rgunner1

addSwitchableUnit rgunner2

addSwitchableUnit rpilot

selectPlayer rpilot

;cobra team to be rescued

removeSwitchableUnit pilot

removeSwitchableUnit gunner

unassignvehicle pilot

unassignvehicle gunner

;dogetout pilot

;dogetout gunner

~3

hint format["Take the Blackhawk and resue the Cobra team. After the mission report in the tent"]

pilot setCombatMode "WHITE"

gunner setCombatMode "WHITE"

pilot setBehaviour "AWARE"

gunner setBehaviour "AWARE"

;pickup area?

@((rpilot distance heli)<100)

;pickup

hint format["Rescue area reached. Cobra team will board, if not check out their status."]

;pilot domove getpos rheli

;gunner domove getpos rheli

;?!(alive pilot) : goto "skip1"

pilot assignascargo rheli

gunner assignascargo rheli

[pilot, gunner] orderGetIn true

;@(unitready pilot)

#skip1

;?!(alive gunner) : goto "skip2"

;gunner assignascargo rheli

;[gunner] orderGetIn true

;@(unitready gunner)

#skip2

@((rpilot distance tent)<100)

dogetout pilot

dogetout gunner

dogetout rgunner1

dogetout rgunner2

hint format["Rescue mission completed"]

exit

Of course there is more but above is the basic stuff in action at the moment of rescue pickup.

The commented statements are there because i'm testing/trying other 'solutions' which do not work

As said, if i do 'rescue us' directly at the start of the mission i've seen it work, meaning both pilot and gunner board the balckhawk (rheli)!?!? but later on the same 'rescue us' action makes only 1 of the crew board with the other just standing next to the landed/downed Cobra(heli)

Share this post


Link to post
Share on other sites

Do you have anything that makes the gunner move? If they are given an order to get in (i have seen it but forget why) they don't just get in the vehicle. Try adding a simple waypoint move to the position of the chopper after assigning them and see if they mount the vehicle. Or try domove. I had something happen like this with a group of units not getting into a vehicle. Turned out that even though i told the driver and gunner to get in they wouldnt unless i issued something that made them move (Becides the ordergetin command). I can test it in a few hours when i get home to see.

Share this post


Link to post
Share on other sites
i have exactly the same prob as in top post.

A downed heli. pilot and gunner getout. I come by with rescue rheli/rpilot. Pilot gets in, gunner not!? The gunner just stands next to the downed heli.

; heli downed

unassignvehicle pilot

unassignvehicle gunner

;pickup area?

@((rpilot distance heli)<100)

pilot assignascargo rheli

gunner assignascargo rheli

[pilot, gunner] orderGetIn true

!?!?!?

You have to change your variable name. Gunner is infact a command, and so ArmA treats it like one, expecting to return the gunner of a vehicle that you didn't specify. You have two options, use local variables (suggested, any time you can use a local variable you should do so, plus they don't conflict with commands) that have an underscore before them (ex: _pilot = _this select 0; _gunner = _this select 1), or change the gunner's name, anything that's not the same as a command (ex: heligunner assignascargo rheli).

Also, you should look into using CHOFPSE, it'll still work for ArmA of course, but you'll need to update the command library (which it allows you to do). It's useful in that it will color code everything to let you know what's a command (in the eyes of the game) and what's a variable, etc...

Share this post


Link to post
Share on other sites

Well you can see i commented

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;pilot domove getpos rheli

;gunner domove getpos rheli

probably because it didn't do the trick.

I will setup a simple test mission to figure out the mechanism, but otoh i'm not the type willing to spend countless hours on something which should work (at least to my understanding) with some simple scripting

Share this post


Link to post
Share on other sites
Well you can see i commented

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;pilot domove getpos rheli

;gunner domove getpos rheli

probably because it didn't do the trick.

I will setup a simple test mission to figure out the mechanism, but otoh i'm not the type willing to spend countless hours on something which should work (at least to my understanding) with some simple scripting

I don't think you understood/read my post, I'm saying you can't use the word gunner as a name since there is a command with an identical name, and every time you type gunner in a line of code, the game refers to the command.

Ex:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_gunner = (gunner _heli);

or

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(gunner this) sidechat "Hi"

Share this post


Link to post
Share on other sites

Looks like KyleSarnik might have answered the question. If not move the domove below the assign commands. Good luck, leme know.

Share this post


Link to post
Share on other sites
Looks like KyleSarnik might have answered the question. If not move the domove below the assign commands.  Good luck, leme know.

No, maxqubit's methods were fine, but his problem was different fom the original poster. He used orderGetIn, because when using assignAs... commands it only assigns them to a vehicle position, it does not order initiate a get in order (it is true in OFP at least that even when not inside a vehicle, all units are theoretically assigned to a vehicle that they will get in when they recieve a "get in" order). So then you can either use orderGetIn or a Get In waypoint to order the AI into their assigned vehicle position.

Now I answered the question, both of them.

Share this post


Link to post
Share on other sites

Cool. Wonder what i was doing wrong with the ordergetin. When i used it in my scripts they would just sit there looking stupid until i told the group or unit to move somewhere via a domove or waypoint.

Share this post


Link to post
Share on other sites
Well you can see i commented

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;pilot domove getpos rheli

;gunner domove getpos rheli

probably because it didn't do the trick.

I will setup a simple test mission to figure out the mechanism, but otoh i'm not the type willing to spend countless hours on something which should work (at least to my understanding) with some simple scripting

I don't think you understood/read my post, I'm saying you can't use the word gunner as a name since there is a command with an identical name, and every time you type gunner in a line of code, the game refers to the command.

Ex:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_gunner = (gunner _heli);

or

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(gunner this) sidechat "Hi"

KyleSarnik, i missed your post! Probably because we were posting the same minute:). I was commenting on nutty 22:09.

Anyway, gunner is a command ehhh! LOL, how obvious. And to know somewhere else i used the driver command in a correct way hahaha ;)

Anyway Kyle, thx very much for the enlightenment. I'm sure it'll work now.

-- Max

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  

×