Jump to content
Sign in to follow this  
Sapphirewolf

drop pod problem

Recommended Posts

i want to use the drop pods from the terran infantry mod as a substitude for parachutes.

i found a script somewhere on this forum and changed it to spawn support at radio command.

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

ParaInProgress = true

_i = Count Units Group Player

_grp = Group Player

? _i > 11 : ParaInProgress = false; exit

_x = (getPos Player select 0) - 50 + Random 100

_y = (getPos Player select 1) - 50 + Random 100

_z = 200

_unit = "TerSolM"

xName = _i + 1;

POD = "terran_podb" CreateVehicle [_x,_y,_z]

xName = _unit CreateUnit [[_x,_y,_z], _grp, "this moveInDriver POD", Random 1, "PRIVATE"]

POD setPos [_x,_y,200]

~.5

_pilot = driver POD

[_pilot] ordergetin false

unassignvehicle _pilot

_i = _i + 1

#drop

? _i > 11 : ParaInProgress = false; exit

_x = (getPos Player select 0) - 50 + Random 100

_y = (getPos Player select 1) - 50 + Random 100

_z = 200

_Ax = 1+ random 6

_unit = _unitArray select _Ax

_unitArray = ["TerSolR","TerSolM","TerSolRocket","TerSolRocket2","TerSolGL","TerSolAT", "TerSolMGSN"]

POD = "terran_podb" CreateVehicle [_x,_y,_z]

_unit CreateUnit [[_x,_y,_z], _grp, "this moveInDriver POD", Random 1, "PRIVATE"]

POD setPos [_x,_y,1500]

~.5

_i = _i + 1

goto "drop"

the problem is that i want them to leave the pods after landing (they're actually helicopters w/o any fuel) without giving the order to do so.

can anyone help?

EDIT: maybe i should say that those pods drop from a height of about 1500 (even if placed in the editor and set to fly).

due to the lack of fuel and the design for its purpose they fall straight to the ground.

my problem is to check if the pods have reached the ground to disembark the soldiers atomatically

Share this post


Link to post
Share on other sites

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

? ParaInProgress : exit

ParaInProgress = true

_i = Count Units Group Player

_grp = Group Player

#drop

? _i > 11 : goto "end"

_x = (getPos Player select 0) - 50 + Random 100

_y = (getPos Player select 1) - 50 + Random 100

_z = 200

_Ax = 1+ random 6

_unit = _unitArray select _Ax

_unitArray = ["TerSolR","TerSolM","TerSolRocket","TerSolRocket2","TerSolGL","TerSolAT", "TerSolMGSN"]

POD = "terran_podb" CreateVehicle [_x,_y,_z]

_unit CreateUnit [[_x,_y,_z], _grp, "this moveInDriver POD", Random 1, "PRIVATE"]

POD setPos [_x,_y,1500]

_pilot = driver POD

[_pilot] ordergetin false

unassignvehicle _pilot

~.5

_i = Count Units Group Player

goto "drop"

#end

ParaInProgress = false

exit

readded unassignvehicle commands and changed exit procedure. no guarantee.

Share this post


Link to post
Share on other sites

no, it doesn't work... but thanks for trying.

anyway i had a mistake in the script because i changed it a bit for testing purpose... so i forgot to add the unassignvehicle to the other spawns.

Quote[/b] ]? ParaInProgress : exit

ParaInProgress = true

_i = Count Units Group Player

_grp = Group Player

? _i > 11 : goto "end"

_x = (getPos Player select 0) - 50 + Random 100

_y = (getPos Player select 1) - 50 + Random 100

_z = 200

_unit = "TerSolM"

xName = _i + 1;

POD = "terran_podb" CreateVehicle [_x,_y,_z]

xName = _unit CreateUnit [[_x,_y,_z], _grp, "this moveInDriver POD", Random 1, "PRIVATE"]

POD setPos [_x,_y,200]

~.5

_pilot = driver POD

[_pilot] ordergetin false

unassignvehicle _pilot

_i = _i + 1

#drop

? _i > 11 : goto "end"

_x = (getPos Player select 0) - 50 + Random 100

_y = (getPos Player select 1) - 50 + Random 100

_z = 200

_Ax = 1+ random 6

_unit = _unitArray select _Ax

_unitArray = ["TerSolR","TerSolM","TerSolRocket","TerSolRocket2&quot

;,"TerSolGL","TerSolAT", "TerSolMGSN"]

POD = "terran_podb" CreateVehicle [_x,_y,_z]

_unit CreateUnit [[_x,_y,_z], _grp, "this moveInDriver POD", Random 1, "PRIVATE"]

POD setPos [_x,_y,1500]

~.5

_pilot = driver POD

[_pilot] ordergetin false

unassignvehicle _pilot

_i = _i + 1

goto "drop"

#end

ParaInProgress = false

exit

this is the correcte4d script with the addition of trappers end-goto.

but i cannot believe that noone else knows how to fix it...

this is just a chopper, spawned with createVehicle which is supposed to land and to disembark its crew.

if they join the players grop just after spawning or after getting out does not really matter...

Share this post


Link to post
Share on other sites

how many seats do these pods have, just one?

why does the first pod have to spawn in height 200 before the other ones in height 1500? isn't the falling pod-copter destroyed on the impact and the crew killed? do these pods have windows so you do see the crew?

Share this post


Link to post
Share on other sites

let the script constantly check the height over a loop and if its 1 (meters) or 0 and let it proceed with the vehicle unassign part

Share this post


Link to post
Share on other sites

yes, but what for? it doesn't matter what time unassignvehicle is issued. really existing passengers will disembark only after landing is completed and not in midair.

Share this post


Link to post
Share on other sites

The trouble is that some commands don't work with the player team.

Do what Neph says, and when the drop is on/near the ground, use the action command :

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

Share this post


Link to post
Share on other sites
Quote[/b] ]yes, but what for? it doesn't matter what time unassignvehicle is issued. really existing passengers will disembark only after landing is completed and not in midair.

have i written somethin about midair and time dependand things?? also you can get out in midair in ofp..... even the ai can.

anyway since my scripting got rusty ill explain this in simple words.

spawn drowpod

spawn soldier(if necessary)

place soldier in drop pod

#heightcheck

is my height 0 ?

no? goto "heightcheck"

yes? goto "disembark"

#disembark

(make a delay if you dont want them to come out immeditely)

~2

soldier unassignVehicle droppod.

eventually you might want to add a velocity vector just before the landing since the falling pod would most propably crash without giving it a little brake.

Share this post


Link to post
Share on other sites

the different heights of the first pod and the others is just for testing purpose.

there is also just one seat in a pod.

and the pods won't get dammaged due to the crash. and even if... i don't know why but the passanger isn't harmed even if the pod explodes...

but back to topic:

i already thought about a height check but 1. i'm not sure how to make one and 2. afaik i would have to write a second script and let EVERY pod/soldier execute it separately to continue the spawning fluently.

so the worst case would be 11 height-check scripts running simultaneously. and since my PC isn't that good i'm afraid of having the framerate dropping even faster as the pods would fall...

Share this post


Link to post
Share on other sites
Quote[/b] ] already thought about a height check but 1. i'm not sure how to make one and 2. afaik i would have to write a second script and let EVERY pod/soldier execute it separately to continue the spawning fluently.

so the worst case would be 11 height-check scripts running simultaneously. and since my PC isn't that good i'm afraid of having the framerate dropping even faster as the pods would fall...

As any other solution didn't work previously, you should be more "open minded...". And no, it won't lag at all, make a test and you'll see.

launch the script somewhere in the former script :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[_pilot] exec "checkheight.sqs"

And use that script :

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

_pilot = _this select 0

#loop

~1

_pos = getpos _pilot select 2

? _pos > 2: goto "loop"

~2

_pilot action ["getout",vehicle _pilot]

exit

Share this post


Link to post
Share on other sites

height check script with a moderate loop interval

hc.sqs:

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

~0.5

_pod = vehicle _this

#l

~1

if ((getpos _pod select 2) > 1) then {goto "l"}

~1

_this action ["getout",_pod]

executing the script for every drop unit from the spawn script:

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

_unit CreateUnit [[_x,_y,_z], _grp, {this moveInDriver POD; this exec "hc.sqs"}, Random 1, "PRIVATE"]

The real clue was ProfTournesol's command advice.

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  

×