Home   Help Search Login Register  

Author Topic: Simple Amo Crate Attached to Parachute??  (Read 3262 times)

0 Members and 1 Guest are viewing this topic.

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Simple Amo Crate Attached to Parachute??
« on: 12 Mar 2005, 16:34:55 »
I have problems attaching an Amo crate to one parachute.
I would like to use 2 chutes to the crate.(more realistic)
I Do Not want to start from a heilo, plane or anything else like the Tuts' give. Too much AntiAir in area.
I have gotten my guys attached to parachutes.
Soilder Name: Sdr1
Soilder Int: Sdr1 moveindriver para1.
Parachute set to flying
Parachute Name: para1
Set the parachute height Int: para1  flyinheitght 140.

But that Darn Amo Crate doesn't, ideas??
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple Amo Crate Attached to Parachute??
« Reply #1 on: 12 Mar 2005, 16:49:18 »
The way I have done this is to use a fast looping script to setPos the ammocrate a certain distance below a falling parachute.  I can find the distance if you need it.  The script exits when the crate is on or near the ground.  I even did the same with M113s Trucks jeeps and Abrams.
« Last Edit: 12 Mar 2005, 16:50:13 by THobson »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Simple Amo Crate Attached to Parachute??
« Reply #2 on: 12 Mar 2005, 16:49:57 »
I doubt ammo crates can drive parachutes.    Create the parachute, and use a setpos loop to keep the ammo crate underneath it.

Edit:  beaten again.   :-[
« Last Edit: 12 Mar 2005, 16:50:18 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple Amo Crate Attached to Parachute??
« Reply #3 on: 12 Mar 2005, 16:50:34 »
Beat you!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Simple Amo Crate Attached to Parachute??
« Reply #4 on: 12 Mar 2005, 16:56:44 »
I let you win.  
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple Amo Crate Attached to Parachute??
« Reply #5 on: 12 Mar 2005, 17:05:01 »
 :tomato:

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Simple Amo Crate Attached to Parachute??
« Reply #6 on: 12 Mar 2005, 17:46:19 »
Correct!

Anyway, back on topic.   sharkyjoe, I hope it works.  Let us know how you get on.
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple Amo Crate Attached to Parachute??
« Reply #7 on: 12 Mar 2005, 18:28:03 »
This is an extract from a script I have used.

Code: [Select]
#DropUpdate

_chutePos = getPos _chute
_chutePosX = _chutePos select 0
_chutePosY = _chutePos select 1
_chutePosZ = _chutePos select 2

_car setPos [_chutePosX, _chutePosY, _chutePosZ - 3]
~0.01
? (_chutePosZ > 3) : goto "DropUpdate"
exit

The script was originally written by: David Berka

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Simple Amo Crate Attached to Parachute??
« Reply #8 on: 12 Mar 2005, 18:29:24 »
Well thanks for info.  :)  This drop looks taliored for me but ran into a snag. not good info before download stage(maybe some info fixing needs to be done on this prior to downlad). There really was not much of txt. for info.
Use Para Drop from Edit Dept. having hard time figuring out some stuff. --Marker? -- > What is it and Where do i put it. Height of what?

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: 12 Mar 2005, 19:17:21 by sharkyjoe »
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

bored_onion

  • Guest
Re:Simple Amo Crate Attached to Parachute??
« Reply #9 on: 12 Mar 2005, 19:13:50 »
theres one of these in the ed depot. looks a bit weird though.

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Simple Amo Crate Attached to Parachute??
« Reply #10 on: 12 Mar 2005, 22:58:16 »
ya i took the script from Ed. Depot but what does Maker mean and how do I trigger the script to go? plus all the other questions I asked previously.
Gee's i feel really brain dead now  :P
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Simple Amo Crate Attached to Parachute??
« Reply #11 on: 13 Mar 2005, 21:07:17 »
It's not maker, its marker.

You call the script with a command like this

[cargo, marker, height, DropHeight, xoffset, yoffset, zoffset] exec "ParaDropObject.sqs"

where:

- cargo is the name of the object, in this case your ammo crate

- marker is the name of a marker which is where you want the drop to occur

- height is self explanatory

- and the offsets are the amounts by which the position of the parachute is offset from the position of the object.    Start with 0, 0, 2 and then experiment


But before doing anything else read snYpir's A Friendly Intro to Code Snippets in the Editors Depot.
« Last Edit: 13 Mar 2005, 21:07:43 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Simple Amo Crate Attached to Parachute??
« Reply #12 on: 15 Mar 2005, 05:34:39 »
Ok i'm an Idiot and i cann't spell.. No arguement there :-X
Read the Tut like suggested... Digesting that... Marching on..

I tried to call the Script from a trigger, like have in the past with the [ name, name,...] exec "name.sqs"  no go.
Put Crate in Called C1
put a marker in called Drop (solved the trigger "Drop1" calling execute)
put height in number 100----> dont know why sounded like a good #
put parachute in called para1 --->dont think I need to have one but named just in case
and then the x,y,z numbers

error message in trigg activation line won't let me past the height number.
who or what calls this script to excute this script. A trigger should do it , right??
Ok it's calling the script, Parachute is cramcreted, so no need to put in chute.
Parachute is deployed but no Ammo Crate under Chute, why??
New error in the calling of position of cargo(in this case crate)
Error Message :  _cargo getpos[_cx,_cy,(_cz+height)] /#/: error type expect number.
I did put a number in there and 20 other numbers from high to low.
« Last Edit: 15 Mar 2005, 06:29:50 by sharkyjoe »
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple Amo Crate Attached to Parachute??
« Reply #13 on: 15 Mar 2005, 08:22:09 »
It should either be

_cargo setPos ....  if you are placing the cargo

or

getPos _cargo  if you are trying to find where it is

 _cargo getpos...  is wrong.

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Simple Amo Crate Attached to Parachute??
« Reply #14 on: 15 Mar 2005, 23:14:48 »
Ok if what you(Thobson) are saying is true, then the script that i got from the Editors Depot made by Mark Palmer named Para Drop Script is wrong in the scripting of the sqs file. I have included this,sqs file, above, his entire script. So the problem lies in the lines where the script call's for postions of cargo then??
;Creates and Sets Initial position of Cargo.
_Cargo setpos[_cx, _cy, (_cz + _Height)]

I'm i right?? then change this around as suggested  ???

20 mins later afeter trying different ways, as suggested and thought up ones
Is there something wrong with Mark Palmers script??
Still getting error message same as before.
_Cargo setpos[_cx, _cy, (_cz + _Height)]/#/: invalid error type any expected number
« Last Edit: 15 Mar 2005, 23:45:13 by sharkyjoe »
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple Amo Crate Attached to Parachute??
« Reply #15 on: 15 Mar 2005, 23:23:39 »
Quote
_Cargo setpos[_cx, _cy, (_cz + _Height)]
Looks fine to me.  I would only take out the round brackets to make it look tidier.

I was commenting on your post #12
Quote
Error Message :   _cargo getpos[_cx,_cy,(_cz+height)] /#/: error type expect number.

I repeat

  _cargo getpos

is wrong.

getpos [.....]

is also wrong


I suggest you read the comref on getPos and setPos.  Go the the Editors Dept/Online references/Commands.
« Last Edit: 16 Mar 2005, 22:14:06 by THobson »

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Simple Amo Crate Attached to Parachute??
« Reply #16 on: 16 Mar 2005, 00:34:00 »
Oh i see, after looking it up, the differences are
getpos --> goes and finds the position on map of the object
setpos--> goes and puts the object in desired position...

That been said, I put the script back as Mr. Palmer had written/coded it. Then went to the Desert Isle of Intro, in mission mode, and set up a dummy action so nothing but the script runs in the mission folder named test drop.

Use a Ammo crate named Am1, an actual (F6) marker name Mk2, west loon name me1 and in trigger area, and a trigger set to west present and the activation field coded [Am1,Mk2,148,150,2,2,2] exec "ParaDropObjest.sqs" per Mr. Palmers  instructions.
hit the preview button and I got same thing for and error

_Cargo setpos[_cx, _cy, (_cz + _Height)]/#/: invalid error type any expected number.

However i have found out by playing around the "cz" variable does make the parachute open if the number is large enough.
Bottom line is that I think the Script is flawed or the instruction on the usage of script is flawed.

Could some-one please test this-script out and see if I am Wrong. I truely would like to be wrong and  to be shown  the way of my errors.  :P
use search in editor depot, type in "para"  and look for Mr. Plamers script.
 Thank you for your Time  :)
« Last Edit: 16 Mar 2005, 05:25:38 by sharkyjoe »
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple Amo Crate Attached to Parachute??
« Reply #17 on: 16 Mar 2005, 14:43:08 »
My guess is that the script works or there would be some adverse comments about it where you got it from.

My suggestion is that you look through the script line by line to try and understand it - using the comref as you go.  That way it will all seem much less like back magic and it should help get you set up for writing scripts of your own.

Quote
Oh i see, after looking it up, the differences are
getpos --> goes and finds the position on map of the object
setpos--> goes and puts the object in desired position...
This would indicate to me that you did not see my earlier post
Quote
_cargo setPos ....  if you are placing the cargo

or

getPos _cargo  if you are trying to find where it is
« Last Edit: 16 Mar 2005, 15:02:34 by THobson »

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Simple Amo Crate Attached to Parachute??
« Reply #18 on: 16 Mar 2005, 17:23:00 »
Oh how, I have tried to go through script time, after time, and time again with the Unofficial Operation Flashpoint  Command Reference Manual version 1.04 "web based" opened up and clicking for referencing.
Now, I know I don't understand everything. Some of it, I do understand.
However I still don't understand, why i would get the error meassge. Even though, i followed the instructions as given, per Mr. Palmer.

I'll adapt and change my Mission a little to suit my needs.
This thread has gone on way to long.

Thankyou everybody, especially Macguba and Thobson for the kind help! :)
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple Amo Crate Attached to Parachute??
« Reply #19 on: 16 Mar 2005, 17:37:06 »
I rarely use other people's scripts - I prefer to write my own.  The only exception I make to this now is where a drop command is needed, and despite the subject that is not here.

If you know how to de-pbo a mission have a look at this one:
http://www.ofpec.com/missions_depot/index.php?ID=967
In it I use parachutes to drop people, ammo crates, mg-jeeps, repair trucks, M113s and even Abrams tanks.  When I get home tonight I will dig out what I used in that mission for the ammo crates.  The problem with that is there may be some mission specific elements in it.  I will check.

The mission is and 'early work' of mine - that is shorthand for 'I will probably be embarrased at what I see when I look at it', so if looking at it forces me to we write the whole thing I will blame you.
« Last Edit: 16 Mar 2005, 17:40:10 by THobson »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple Amo Crate Attached to Parachute??
« Reply #20 on: 16 Mar 2005, 19:09:57 »
Create a parachute.  
Set it to Flying
call it: chute 1
and in its Init field put:

this flyInHeight 150

Create an ammo crate.  In its Init field put:

[this,chute1] exec "ObjDrop.sqs"

Copy the following into a file and save it as ObjDrop.sqs

Quote
;ObjDrop.sqs
;call by:  [object,chute] exec "ObjDrop.sqs"
;Object starts in the chute

_obj = _this select 0
_chute = _this select 1


#DropUpdate

_chutePos = getPos _chute
_chutePosX = _chutePos select 0
_chutePosY = _chutePos select 1
_chutePosZ = _chutePos select 2

_obj setPos [_chutePosX, _chutePosY, _chutePosZ - 2]
~0.01
? (_chutePosZ > 2) : goto "DropUpdate"
exit

I beleive this will give you what you want, the mission starting with an ammocrate in the air coming down by parachute
« Last Edit: 16 Mar 2005, 22:08:52 by THobson »

keou

  • Guest
Re:Simple Amo Crate Attached to Parachute??
« Reply #21 on: 16 Mar 2005, 20:38:27 »
out of curiosity, will the space (or lack thereof) after the setpos make any difference?

all of sharkyjoe's posts have none, and all of THobson's do.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple Amo Crate Attached to Parachute??
« Reply #22 on: 16 Mar 2005, 22:04:20 »
Not if what follows is an array.  I just do it that way.
« Last Edit: 16 Mar 2005, 22:05:13 by THobson »

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Simple Amo Crate Attached to Parachute??
« Reply #23 on: 17 Mar 2005, 04:09:13 »
THANK YOU THobson  THANK YOU THobson  THANK YOU THobson!!
Yes, I was literally shouting that out.
It Worked Like a Charm and it looks good too!  ;D

Very simple and easy to do.
I will be using your Script and The Credit will be yours, Of course!

Not complaining, dont get me wrong, but why didn't the other Script of Palmers Work?? This should be looked into. So others dont go through the same Frustration i have.

Thanks again and if it were up to me, I think you should get another GOLD Star by your Name.
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance