Home   Help Search Login Register  

Author Topic: cargos for paradropping  (Read 2449 times)

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
cargos for paradropping
« on: 18 Dec 2004, 20:53:05 »
hello,

 how do you get all the units in the cargo pos of an aircraft and then make them eject like one at a time, for a script

im doing this because, there are a lot of paratrooper scripts but none just automaticly get the cargo men of the helo.

they all need the groups to be entered in the activation field and i want to do a mass paradrop but dont have the time to enter every single group.
« Last Edit: 18 Dec 2004, 20:54:43 by penguinman »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:cargos for paradropping
« Reply #1 on: 19 Dec 2004, 02:24:19 »
Code: [Select]
_plane = _this select 0
_delay = _this select 1
;eliminates all possible non-cargo units
_cargo = (crew _plane) - [driver _plane,commander _plane,gunner _plane]
_cargocount = (count _cargo) - 1
_i = -1

#loop
?_i == _cargocount:exit
_i = _i + 1
_man = _cargo select _i
_man action ["eject",_plane]
unassignvehicle _man
~_delay
goto "loop"

so you exec the script with the plane and the delay you want between each unit parachuting:
[plane1,2] exec "eject.sqs"
« Last Edit: 24 Dec 2004, 18:06:18 by Triggerhappy »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:cargos for paradropping
« Reply #2 on: 19 Dec 2004, 03:00:57 »
 ;D perfect, nice

thanks soo much this is the most usefull and robust and easy to use thing im suprised u havent entered it in the editors depot because alot of the parachute scripts in there do the same thing but are much more complicated to use.  I really think you should enter it, because once people find out how much easier it is then they will all get it.

i willl make a demo mission for it if u want to enter it.

once again thanks


also, r u ever gona finish helping me with the

pythagorin theorum and it aplication to scripting,

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:cargos for paradropping
« Reply #3 on: 19 Dec 2004, 03:05:57 »
one thing though
im probably wrong because u r much more experienced than me but in.
Quote
_cargo = (cargo _plane) - [driver _plane,commander _plane,gunner _plane

wouldnt

Code: [Select]
_plane
be changed to
Code: [Select]
plane
i thought the
Code: [Select]
_ was only used when doing the this select 0 part

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:cargos for paradropping
« Reply #4 on: 19 Dec 2004, 03:56:52 »
nope, the _ defines it as a local variable, whereas if i had only put
Code: [Select]
planeit would be looking for a global variable called
Code: [Select]
plane
by using the underscore, you keep everything within the script (local). this allows for many things, one being you can run as many scripts as you want with that local variable in it, but each will retain its own value

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:cargos for paradropping
« Reply #5 on: 19 Dec 2004, 04:00:21 »
about the math thing, you haven't replied on that thread

this one

if you want we can talk about it over pm or you can start a thread, or we can continue on the one above, your choice

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:cargos for paradropping
« Reply #6 on: 19 Dec 2004, 04:03:37 »
i just found a problem from when i typed that in :o, there was some code that didn't drop down to the next line, i fixed it, so if you tested it and it didn't work, thats why
 ::)

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:cargos for paradropping
« Reply #7 on: 19 Dec 2004, 04:53:11 »
I really need to post everything in one post, instead of 4

Quote
i willl make a demo mission for it if u want to enter it.

sure, could you give me a link to where these other ones are so i can see just how different they are? (i don't want to look through all of the scripts their trying to find a few ejection scripts, unless its in an obvious place, which i will go check now)

I see what you mean, this kind of script isn't in there, probably because it is such an easy script, if you really think i should submit it.... :P
« Last Edit: 19 Dec 2004, 05:07:47 by Triggerhappy »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:cargos for paradropping
« Reply #8 on: 19 Dec 2004, 05:45:37 »
well the reason i started this topic in the first place was because i need it for a mission but now i would be happy to have this mission be the demo for your script, it is about a paratroop special assignment to take out some guns on a beach before an invasion. NO addons needed of course but if u want my old version which needs only one addon but also makes the mission better just tell me, its all up to u. il IM it to u when its finished, im just about done so u can submit. :)

sooo,

Yes i think you should submit it it is so usefull :P

EDIT: well i guess u cant put files in an IM il attach it in a post on this topic.,

ANOTHER EDIT ;)


Quote
im just about done so u can submit. :)
i mean wait till im finished making it of course
« Last Edit: 19 Dec 2004, 05:51:58 by penguinman »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:cargos for paradropping
« Reply #9 on: 19 Dec 2004, 06:07:59 »
ok  ;)

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:cargos for paradropping
« Reply #10 on: 19 Dec 2004, 06:16:28 »
hmm, odd, i cant get it to work,

it gives a big error message having to do w/ the part that checks the driver,gunner and stuff.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:cargos for paradropping
« Reply #11 on: 19 Dec 2004, 06:46:59 »
can you see where the |#| is?
can you post the message?

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:cargos for paradropping
« Reply #12 on: 19 Dec 2004, 07:09:39 »
ok i will rite now plz dont go to bed

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:cargos for paradropping
« Reply #13 on: 19 Dec 2004, 07:16:33 »
ok it is

(cargo |#|_plane) - [driver _plane,,


thats where the |#| is

« Last Edit: 19 Dec 2004, 07:17:17 by penguinman »

Bluelikeu

  • Guest
Re:cargos for paradropping
« Reply #14 on: 19 Dec 2004, 09:34:02 »
I think that the only possible error here would be if there is an invalid array given. Which I don't think that there is.