Home   Help Search Login Register  

Author Topic: Para Drop Items - Please help  (Read 703 times)

0 Members and 1 Guest are viewing this topic.

karasus

  • Guest
Para Drop Items - Please help
« on: 10 Feb 2003, 02:24:44 »
Hi all,

I really need to be able to have an ammo crate drop via parachute (along with the unit) .

Ive found a couple scripts in these forums but i still cant get any to work (and no tutorials anywhere) regarding a object attached to parachute (ie the ammo crate) dropping at a specific marker.

Can anyone help me with this as im a complete newbie to scripting. Is it possible to just put something in the init field without a outside script?

The 1st script i read by LCD works but i dont understand getpos and it doesnt link to a marker.

The 2nd which you can download at this site i also get get/setpos errors even when all you put in is [cargo, marker, height, dropheight, xoffset, yoffset, zoffset] exec "ParaDropObject.sqs" - i mean i thought it used marker for position? the offsets are just adjustments for the `package` to be positioned better to the parachute.

If anyone has a guide for dummies:) on how to do this please left me know

thank in advance

/K


Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Para Drop Items - Please help
« Reply #1 on: 10 Feb 2003, 02:34:29 »
didnt c da sec script but if u gotta use it - try putin da ,marker name between ""  ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

karasus

  • Guest
Re:Para Drop Items - Please help
« Reply #2 on: 10 Feb 2003, 02:58:56 »
Right i tried that in my case it was [ammo1, "marker1", 50, 50, 0, 0, 0] exec "ParaDropObject.sqs"

Well it kind of worked:). The crate now appears at marker but is stuck 50ft in the air with no sign of it falling and no parachute.

For an experiment i used same exec on a solder (deleted crate and named soldier ammo1), this actually works.. shute appears and near ground shute goes and soldier hits ground (usually dies hehe), but wont with crate.

Any ideas?

Thanks /K

The entire script is here (got it from code snippets section) >>>

;*********************
;Parachute Drop Script V1.0
;By MP (markpalmer@hotmail.com)
;
;usage: [cargo, marker, height, DropHeight, xoffset, yoffset, zoffset] exec "ParaDropObject.sqs"
;see ParaDropObject.txt for full info
;
;*********************

;Gets Variables from script call.
_Cargo = _this select 0
_Marker = _this select 1
_Height = _this select 2
_DropHeight = _this select 3
;These variables allow you to apply an offset to the parachute.
;Using these variables you can position the parachute so it looks right above the object.
;Experimentation is the key here.
_XOffset = _this select 4
_YOffset = _this select 5
_ZOffset = _this select 6

;Seems to kickstart a vehicle, without it they just sit there, or worse hover.
_Cargo domove [(getPos _Cargo select 0), (getPos _Cargo select 1)]

;Sets Initial Variables
_MarkerPos = GetMarkerPos _Marker
_cx = _MarkerPos select 0
_cy = _MarkerPos select 1
_cz = _MarkerPos select 2
_Dir = 0

;Creates and Sets Initial position of Cargo.
_Cargo setpos[_cx, _cy, (_cz + _Height)]

;Places Cargo and parachute at required position,height and offset
_Parachute = "parachute" camCreate[((getPos _Cargo select 0) + _XOffset), ((getPos _Cargo select 1) + _YOffset), ((getPos _Cargo select 2) + _ZOffset)]

;Places Cargo relative to Parachute
;Note the offset is reversed because we are making the cargo relative to the parachute and
;Not the other way around as in the previous camcreate call
#Loop1
~0.01
_dir = getdir _Parachute
_Cargo setdir _dir
_Cargo setpos[((getPos _Parachute select 0) - _XOffset), ((getPos _Parachute select 1) - _YOffset), ((getPos _Parachute select 2) - _ZOffset)]
;Loops Until Object reaches the ground, warning: if you set the drop height to zero the cargo
;has a tendancy to disappear
?((getpos _Cargo select 2) > _DropHeight): goto "Loop1"

#Loop1 Exit



exit



« Last Edit: 10 Feb 2003, 03:00:44 by karasus »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Para Drop Items - Please help
« Reply #3 on: 10 Feb 2003, 03:10:34 »
screw dat script  ;D  ;)

editied myscript 2 get marker also ;D

Code: [Select]
_veh = _this select 0
_marker = _this select 1

_Para = "parachute" camCreate [getmarkerpos _marker select 0, getmarkerpos _marker select 1,75]
#loop
_veh setpos [getpos _para select 0,getpos _para select 1,(getpos _para select 2)-0.5]
? getdammage _para > 0 : _para setdammage 0
? getpos _para select 2 < 2 : exit
~0.001
goto "loop"

exec - [ammocratename,"markername"] exec "scriptname"

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

karasus

  • Guest
Re:Para Drop Items - Please help
« Reply #4 on: 10 Feb 2003, 07:01:29 »
Thanks a lot LCD:)

It works fine. The problem with the crate hanging in mid air seems only to happen with certain objects. Most crates and all cars, armor, people etc all float down proper.Typical it was the one i was trying that didnt want to work:)

Thanks alot for your efforts

/K