Home   Help Search Login Register  

Author Topic: create units and vechiles  (Read 2303 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
create units and vechiles
« on: 10 Apr 2005, 20:16:46 »
okay then i am planning on creating several scripts wic have different reinforcements
like parachutes, rappeling, convoys etc
i just need to know
how do i create a 5t truck with the driver in at a base specified by a marker

create a 12 man squad or how every many you can fit in the truck

then how do i get the truck to travel to another area specified by a marker then they all get out and set up a defensice primeter, all danger and all engage at will basically

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:create units and vechiles
« Reply #1 on: 11 Apr 2005, 00:27:16 »
to create a truck:
Code: [Select]
mytruck = "Truck5t" createVehicle getMarkerPos "mytruckpos"

then create the 12 man squad:
Code: [Select]
"OfficerW" createUnit [getMarkerPos "barracks_pos",groupAlpha,"officer_one = this; groupAlpha = group this",0.4,"SERGEANT"]
then to make the rest of the units, change the "SoldierWB" in the following:
Code: [Select]
"SoldierWB" createUnit [getMarkerPos "barracks_pos",groupAlpha,"w1=this",0.35,"CORPORAL"]
to others such as "SoldierWMG", etc.

then to move them into the truck:
{_x moveInCargo myTruck} forEach units officer_one

and finally to move it:
mytruck doMove getMarkerPos "move_pos"
« Last Edit: 11 Apr 2005, 00:28:03 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline 456820

  • Contributing Member
  • **
Re:create units and vechiles
« Reply #2 on: 11 Apr 2005, 15:51:08 »
ah thanks shall try that cheers

StonedSoldier

  • Guest
Re:create units and vechiles
« Reply #3 on: 11 Apr 2005, 16:11:46 »
slight error there Tyger

{_x moveInCargo myTruck} forEach units officer_one

should be

{_x moveInCargo myTruck} forEach units (group officer_one)

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:create units and vechiles
« Reply #4 on: 11 Apr 2005, 20:41:38 »
Actually, the:
Code: [Select]
forEach units
takes the place of the group command. If you were using the group command, it would be
Code: [Select]
{_x moveInCargo myTruck} forEach (group officer_one)

at least, that's the way it works on my computer...  :P ::)
« Last Edit: 11 Apr 2005, 20:42:54 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

StonedSoldier

  • Guest
Re:create units and vechiles
« Reply #5 on: 12 Apr 2005, 09:17:20 »
strange, i dont see how {blah blah blah} foreach (group officer_one) can work as it isnt an array whereas  units (group officer_one) is an array

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:create units and vechiles
« Reply #6 on: 12 Apr 2005, 11:18:55 »
hehe, it doesn't matter, we were both right. from the comref
units unit
unit
: Object

Type of returned value:
Array
Description:
Array of all units in the group of given object. For dead object empty array is returned.
units grp
grp
: Group

Type of returned value:
Array
Description:
Array of all units in the group.
so therefore, you can use either. I use units object because it saves a bit of typing. :P Its the mission maker's preference.
« Last Edit: 12 Apr 2005, 11:19:36 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline 456820

  • Contributing Member
  • **
Re:create units and vechiles
« Reply #7 on: 12 Apr 2005, 19:08:30 »
also now i plan to make a small little script pack wicth threw the radio thing you press
001 for artillery
002 for reinforcement
003 for air support
004 for (well anyone else have any good ideas that would be usefull)

how would i go about doing these apart from just creating the vechile and units then using a domove command.
how do i create bombs from an a10 cause they only have the cannon and hellfire's

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:create units and vechiles
« Reply #8 on: 12 Apr 2005, 20:48:42 »
@2) you could make a trigger that would simulate an a10 dropping an LGB, pending you have at least 1.46 :P

put a trigger where you want the A10 to bomb and group it to him. I really mean group it. The activation should now read "Vehicle". Then in the onActivation line type:
Code: [Select]
bomb = "LaserGuidedBomb" camCreate [getPos myA10 select 0,getPos myA10 select 1,(getPos myA10 select 2)-5]that will make a laser guided bomb 5 meters under him (so he doesn't detonate it).
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:create units and vechiles
« Reply #9 on: 12 Apr 2005, 21:09:19 »
---For reinforcements---

i would suggest for reinforcements, you make only an officer, and name him something like "squadL_1" (squad leader #1). make him with one WP on top of him and then the waypoints to the area you want to reinforce. in the one on top of him, in the condition line put something like "squad_1_go"

then put the script attached into your misison folder. in the radio trigger, put this execution code:
Code: [Select]
["markername",groupname] exec "spawn.sqs"; squad_1_go = true

"markername" is the name of the marker where the reinforcements will spawn. you might want to put it close to your officer above so when they are crated they don't have to run far.
CAVEAT: the name must be in quotes.

groupname should be something like: group squadL_1 or whatever you named your officer
« Last Edit: 12 Apr 2005, 21:09:45 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:create units and vechiles
« Reply #10 on: 12 Apr 2005, 21:10:17 »
for artillery, check the editors depot
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:create units and vechiles
« Reply #11 on: 12 Apr 2005, 21:23:32 »
for air support, just sync your radio trigger with the WP and vwalla
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline 456820

  • Contributing Member
  • **
Re:create units and vechiles
« Reply #12 on: 13 Apr 2005, 17:14:07 »
hey cheers for all those posts just about the A10 LGB bombing how can i create it to drop around 3-6 bombs

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Re:create units and vechiles
« Reply #13 on: 13 Apr 2005, 18:24:07 »
make a seqcuence of triggers, make 3-6 triggers whit the same code, and move them, so they dont activate at the same time... or even try to set the condition to a custom variable (lets say "bombing") to all triggers exept the first, adn add  on the "on activation" field of the first trigger
Code: [Select]
bombing = true and there  you wil have your bombing

Offline 456820

  • Contributing Member
  • **
Re:create units and vechiles
« Reply #14 on: 13 Apr 2005, 20:10:52 »
thanks everyone i need to try theses out first but it all seems like it should work
thanks