Home   Help Search Login Register  

Author Topic: moveincargo & chopper extraction  (Read 5769 times)

0 Members and 1 Guest are viewing this topic.

Offline urias03

  • Members
  • *
moveincargo & chopper extraction
« on: 17 Feb 2009, 18:55:58 »
hey,got question
when I write "this moveincargo X" for several soldiers to get in chopper for example,now I want a pilot in co-pilot sit  but when I do that the pilot always sits in cargo and one of the soldiers in pilot sit..what do I need to do so all the soldiers will be in cargo and the pilot infront?
same in trucks,I want all the soldiers in cargo..how can I do that?

and another question is,I want to do special forces mission and in the end I want a chopper to arrive
how can I set timing that when the mission is over the chopper will pick the soldiers

« Last Edit: 26 Feb 2009, 18:33:56 by Spooner »

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: 2 questions-"moveincargo" and chopper pickup
« Reply #1 on: 17 Feb 2009, 22:34:01 »
If you want a unit to be the driver you must move that unit into the driver seat using:
unit moveInDriver vehicle
Where unit is the unit's name and vehicle is the vehicle's name.

You can use this for the unit if the command is in the init field of the unit.

If you want a unit to be the gunner (if the vehicle has a gunner postion) then use:
unit moveInGunner vehicle

To move a unit in the commander position (if the vehicle has a commander position) use:
unit moveInCommander vehicle

Lets say you have a squad consisting of 8 men and you want them all in a BMP named bmp1. To put the leader in the commander seat, the second unit in the gunner seat, the third man in the driver and the rest in the cargo area. This is how you could do it.

In the init field of the lead guy put this: this moveInCommander bmp1
In the init field of the second guy put: this moveInGunner bmp1
In the init field of the third guy put: this moveInDriver bmp1
In the init field of the rest of the units put this: this moveInCargo bmp1

You could also write a script and use more sophisticated commands to reduce your typing like {_x command} forEach array. I have several scripts that work for general vehicle boarding and un-boarding. I you want I can send these to you. Just send me a PM if you would like to try out some scripts that do loading and unloading of vehicles.

To make the chopper pick up the soldiers you could set a trigger activated by a radio command. Then the player can call when he is ready for pickup. If the squad is not player controled then make the trigger activated by whatever condition defines that the mission is finished. Sycrinize the trigger to a chopper waypoint so that when the trigger is activated the chopper will move to where you want. I can send you a sample mission of how to do this when I get home. I am on lunch break at work right now.
« Last Edit: 17 Feb 2009, 22:38:42 by Raptorsaurus »

Offline urias03

  • Members
  • *
Re: 2 questions-"moveincargo" and chopper pickup
« Reply #2 on: 18 Feb 2009, 12:21:33 »
you missunderstood me...my explantion wasn't good
what I meant is,I don't want any of the soldiers to be in front seat
lest say I got truck with driver and I want all the soldiers to getin but I want everyone to be on cargo in the back not near the driver..understand?
same in chopper,I don't want one of the soldiers to be in co-pilot seat..I want everyone in back
so I want to make another pilot and put him in co-pilot but when I put "this moveincargo" for everyone he always in back and one of the soldiers in front


Offline Ext3rmin4tor

  • Members
  • *
Re: 2 questions-"moveincargo" and chopper pickup
« Reply #3 on: 18 Feb 2009, 12:33:30 »
You can do this using init.sqs and game logic.

Create a script in the mission folder named init.sqs then open it with notepad or another text editor, i suggest ArmaEdit. Then place a "game logic" unit wherever you want on the map and give it a name (I'm using vehicleLogic for the example) and the vehicle you're gonna use (I'm using cargoVehicle in the example). Give a name also to the group leader (I'm using cargoLeader in the example) you want to start in the vehicle. Then write the following code in the script file:

Code: [Select]
vehicleLogic moveInCargo cargoVehicle
~0.01
{_x moveInCargo cargoVehicle} forEach units group cargoLeader
exit

EXPLANATION:

The game logic is an invisible unit with no AI, but it is still a unit so you can make it board vehicles like any other unit. The result is that if you make it board the vehicle before any other soldier there will be an invisible unit placed in the co-pilot seat and thus the units will all start in the back and they will see an empty co-pilot seat (same for trucks, with the difference that, if I remember well, in OFP there are 2 seats next to the driver seat so you'll have to use 2 different game logic and make them board the truck before the units).

The first command make the game logic start in the cargo space of the vehicle (the first available is the co-pilot seat), then waits for 0.01 seconds and after that make every unit in the group of the cargo leader get in the truck. Every unit in that group will start in the back seats because the seat unit is occupied by the game logic. Remeber that if you want to be able to use the co-pilot seat again you'll have to delete or move away the game logic (for deletion use the command deleteVehicle, for moving use setPos). I hope 've been clear enough.

EDIT: I don't know if it works, but instead of writing the script, you can try to write the line

Code: [Select]
this moveInCargo cargoVehicle

in the game logic init field, and then writing

Code: [Select]
{_x moveInCargo cargoVehicle} forEach units group this

but I'm not sure it will work since the order in which the init fields are executed is not predictable, so it might happen that the init field of the commander is executed before the game logic one, so you'll have a vacant seat in the back instead of the co-pilot one. If you use the script you're sure the game logic will be placed correctly, but you can still try the second method.

EDIT2:

I misunderstood your request... Well I thaught you how to make a vacant seat and it could be useful  :D !

If you want to make another pilot board the co-pilot seat then simply replace the game logic with a pilot unit, then the script it is the same. Use the script for the same reason explained in EDIT1, since the order of execution of the init fields is not predictable, and that's probably why the pilot was alwasy seated in the back.
« Last Edit: 18 Feb 2009, 12:42:49 by Ext3rmin4tor »
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline urias03

  • Members
  • *
Re: 2 questions-"moveincargo" and chopper pickup
« Reply #4 on: 18 Feb 2009, 12:43:12 »
yeah that's what I meant..thanks
no..didn't worked
damn

btw,i've notice I wrote it in OFP but I was talking about arma 
I'm still not used that I play arma now..after like 6 years with OFP
« Last Edit: 18 Feb 2009, 12:49:39 by urias03 »

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: 2 questions-"moveincargo" and chopper pickup
« Reply #5 on: 18 Feb 2009, 17:50:25 »
Actually, the init field of a unit is very predictable. It always executes the code before the first semicolon ";" before moving otno the next. Therefore you could execute the entire command from the gamelogics init.

gamelogic1 moveincargo truck1; {_x moveincargo c1} foreach units group man1; gamelogic1 action ["eject", truck1]; deletevehicle gamelogic1

This will leave the front passenger seat available for future units to getin.
 all other vehicles are the same

You can also play around with the loading sequence to see which slots are loaded first in each vehicle and then load units seprately along with a gamelogic in the same manner as above if you need a specific slot to be left open for the player character such as the tail end of the truck, right side of the littlebird, or very back front facing seats of the uh60, etc. Doing this may require additonal typing as you will have to exclude using the _x command and you will have to name each unit but that only matters if your lazy.
« Last Edit: 18 Feb 2009, 18:00:05 by savedbygrace »

Offline Ext3rmin4tor

  • Members
  • *
Re: 2 questions-"moveincargo" and chopper pickup
« Reply #6 on: 18 Feb 2009, 18:24:23 »
I meant the execution between the init field of a unit and another one, that's not predictable, or better, it is if you open up and edit manually the mission.sqm file placing the game logic before the group leader, otherwise it is not. Your init line is equivalent to my script except for the wait commnd. In any case, it works, maybe you messed up with group name or the script itself because I've just tried it.

The script works for ArmA too, don't worry, the problem is in riverse, that is if you have to use an ArmA script for OFP
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline urias03

  • Members
  • *
Re: 2 questions-"moveincargo" and chopper pickup
« Reply #7 on: 20 Feb 2009, 13:12:16 »
thanks everyone :D
got new question.I think it's a bug but I had it in ofp too
when I add empty humvee and group of soldiers with "this moveincargo" and waypoint then the commander says "all move to X" but the driver's not driving...nothing happens they just stay
if the commander drives then when he says "move to.." he drives and everything's fine
it's only happnes when it's empty HUMVEE

one more thing...I put trigger "humvee setdammage 1.0" but when the humvee arrives it's look really stuipid..there's no explosives just he started to get on fire
what to do so it will look like mine or somthing?

just rememberd
I have problem with the MODUL animation..I put soldier and in init write "unit1 switchmove" and then the name of the animation but it never works,all the time the soldier just stands there doing nothing(I got arma 1.14)
« Last Edit: 20 Feb 2009, 13:16:00 by urias03 »

Offline Ext3rmin4tor

  • Members
  • *
Re: got another question
« Reply #8 on: 20 Feb 2009, 20:52:12 »
The explosion for vehicles is determined by the ammount of ammo in the vehicle. The humvee has no ammo so it won't explode. Trucks and cars generally don't explode.

If you want to create an explosion, use createVehicle to create an artillery shell or a grenade. Look here and use classnames from the Ammo Classname column:

http://www.ofpec.com/COMREF/index.php?action=read&id=68

For the first question: is the driver in the same group of the commander?
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline urias03

  • Members
  • *
Re: got another question
« Reply #9 on: 21 Feb 2009, 12:05:59 »
thanks and of course he's in the same group
the commander says "all go to.." but he's not driving there

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: got another question
« Reply #10 on: 21 Feb 2009, 12:44:36 »
Let the group leader drive. This works for me.


Edit: Please provide meaningful topic names.
« Last Edit: 21 Feb 2009, 12:52:07 by Worldeater »
try { return true; } finally { return false; }

Offline Ext3rmin4tor

  • Members
  • *
Re: got another question
« Reply #11 on: 21 Feb 2009, 18:42:26 »
It should work even if the group leader isn't the driver. This is really strange.

EDIT: He's right, the leader must drive the vehicle.
« Last Edit: 21 Feb 2009, 19:04:01 by Ext3rmin4tor »
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: got another question
« Reply #12 on: 26 Feb 2009, 15:50:09 »
Can you not get a unit other than the leader to drive by using assignAsDriver
http://www.ofpec.com/COMREF/index.php?action=details&id=27

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: moveincargo & chopper extraction
« Reply #13 on: 26 Feb 2009, 18:35:10 »
Please use meaningful thread titles (I've renamed it to something that actually summarises the question)! Thanks!
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)