Jump to content
Sign in to follow this  
Roundboy

Ammo drop from heli

Recommended Posts

I have script to call a heli from the base to my position..

It takes off, and basically flys to within 75m and drops an ammo crate via parachute.

Questions:

(1) How to do radio commands for this without being the leader (mp misions)

(2) I want to set off a flare or smoke grenade when the helo is close..

player addMagazine "FlareRed"

player selectWeapon "FlareRed"

player fire "flarered"

I see the flare is selected.. but ammo shows 0, but no flare?

I am liking this script, because i allow the player to get air dropped additional AT / AA weaps.. but this triggers armor / air / men to spawn and converge on that spot.. Like they 'saw' the air drop and are using it to locate you.

Comments?

Share this post


Link to post
Share on other sites

As far as I understood the syntax for adding ammo and weapons to a unit you have to clear all in first and then set up new mag's and weapons

don't know if this helps you

Share this post


Link to post
Share on other sites

So.. i have to remove all waepons from the person first? That doesn't seem like a valid way..

Maybe I don't have enough 'room' on my player..

Maybe following your logic.. i need to remove a few 'nades to ad a flare.. throw the flare.. then readd the 'nades?

Share this post


Link to post
Share on other sites

You do have to remove something. A mag or grenade or whatever. You cant add something over something else.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Roundboy @ Mar. 06 2002,05:42)</td></tr><tr><td id="QUOTE">I have script to call a heli from the base to my position..

It takes off, and basically flys to within 75m and drops an ammo crate via parachute.<span id='postcolor'>

How did you do this ammocreate delivery via parachute? Does it look nice and what is the possible script for this. I could use it too in my missions. smile.gif

Share this post


Link to post
Share on other sites

I am still tweaking the code.. but for right now it follows this format:

Get the x,y of the player...

move the heli to the player

if distance is > then 75m, then move the chopper..

I originally had the x,y of the crate = the chopper, but made the 'z' value the chopper z value - 3 (hanging under)

I am playing with creating the ammocrate from scratch when the heli 'finds' the player... and then drops it..

If i put it in the cargo area of the chopper.. does it automatically get a chute if i drop it??

I will post code when i finish it..

Share this post


Link to post
Share on other sites

No, ammocrates will not automatically get a parachute if you drop them from a helicopter. The only real way to do it is to create a parachute with camcreate, then move the ammocrate underneath it with a set pos command, and then use a loop that checks the position of the parachute, and moves the crate relative to the chute.

Note that such things will only work in SP, not in MP for some unfathomable reason (I've been trying to get it to work in MP for about three weeks). Also note that a camcreated ammocrate is not usable (in other words is just a prop, you can't get anything out of it). And finally note that when soldiers eject from a chopper, they have momentum and such from the chopper which affects where they land somewhat. A camcreated parachute does not have that, and therefore will come much closer to floating straight down.

Cheers,

Dr. Charm

Share this post


Link to post
Share on other sites

I have not tried using the camcreate.. but so far it works by:

Having the ammo crate created next to the chopper (chopper is on ground at base) and having the chute always at x,z,300

(why do they use X,Z,y.. isn't x,y,z universal?)

When the script is 'active' (chopper called) the crate is placed at helipos -3 and the chopper moves to my guy.

When it gets there.. the chute is moved to a heli position, and let fall.. and the crate is placed at chute-5(the y value)

when it hits.. the chopper goes home and lands.

I have my guy throw a smoke.. but i was thinking of having the chopper wait for the smoke b4 dropping

Any good math for detecting how close you are to a position?? I use helipos distance player <75 to trigger.. but.. sometimes the choppre is flying high, and i am in a ditch..

Maybe check the x and z values of the two??

I have yet to check this in MP... but could this have something to do with making them global vs local variables?

Share this post


Link to post
Share on other sites

Unless you want the ammocrate to be visible beneath the copter while it is flying, you don't really need to run a loop so that it appears in the correct place beneath the copter, just move it into place when it drops. I mean copters have pretty big bays, so it probably wouldn't be beneath the chopper anyway. smile.gif

As for the coords, it makes sense if you think about from the point of view of a guy on the ground, rather than from the overhead view of the editor. On the ground, looking north, moving left or right is along the X-axis, moving up into the air is the Y-axis and moving north or south (into or out of your screen) is the Z-axis.

For detection, I don't know for sure. On way, you could design a trigger that follows you around (move the position of the trigger to your position) that is activated by the helicopter. Since triggers ignore height above the ground, you could simply make it have a radius of 75 meters, and regardless of how high the chopper is, it will be dropped once it sets off the trigger.

Cheers,

Dr. Charm

Share this post


Link to post
Share on other sites

Hmm.. moving triggers... that might be in order..

I find it odd that you can on;y move people into cargo slots... why does do ammo crates, objects, etc have the 'In Cargo' special property.

I wish I could just put a crate in cargo, then kick it out the side...

Now i just have to find a way to let ANYONE trigger a radio message... not just the leader

Share this post


Link to post
Share on other sites

Use Addaction, and you should be able to get around the radio problem. Also, the cargo thing. You're right, very annoying that choppers can't by default drop ammocrates.

Cheers,

Dr. Charm

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  

×