Home   Help Search Login Register  

Author Topic: check unit height and then, ummm, die  (Read 590 times)

0 Members and 1 Guest are viewing this topic.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
check unit height and then, ummm, die
« on: 05 Dec 2002, 00:50:50 »
so, got a nice little HALO script for some Deltas to insert nice an quick into North Korea - so, this is all player controlled and i need to check the player pulls the chute below 100 - if not shilkas come rolling and shoot at them...

if not possible, then then just the checkin height is fine, i'll just end the mission instead.

cheeeeeeeeeeeeeeeers people.
Proud Member of the Volunteer Commando Battalion

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:check unit height and then, ummm, die
« Reply #1 on: 05 Dec 2002, 18:11:03 »
*taps on window*

any1 home?

please guys - its about all i need - just want to know how to check the altitude of the player, and then if its above 100, set off a variable.
Proud Member of the Volunteer Commando Battalion

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:check unit height and then, ummm, die
« Reply #2 on: 05 Dec 2002, 18:26:41 »
Messiah, i've been playin around once with a chopper's
height.

The idea was: to setFuel to 0, once the chopper was down
at a certain height (to let him stay with engines off at an empty H-pad).

I can't remember exactly in numbers, how i did it, but
here's how i did it:

I placed an empty H
I placed a chopper

Then i've been checking the difference:
getpos (chopper select 2) - getpos (hpad select 2)

I had to use 7 meters difference, so that the chopper was
landing smooth, and did not take off anymore.
The 7 meters value varried, depending on the location of
the hpad, or the direction, the chopper came from.

The result was not influenced by placing the chopper on a
higher terrain level. Chopper stationary on the ground gave
me always the same result, wherever i placed him (maybe
a few 0.xxxxx difference).

hope this helps

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:check unit height and then, ummm, die
« Reply #3 on: 05 Dec 2002, 18:45:47 »
The clear answer  ;) is as follows:

I assume that you actually have two scripts, since you said the player manually opens his chute.  I assume there's a first script that makes him bail from the aircraft without a parachute, and a second that is called when the player uses the action or radio command to open his chute.

In your script for opening the parachute, put the following code:

? (getPos p1) select 2 < 100 : Code that activates Shilkas

This is a simple if statement that checks if the player, p1, is below 100 meters when this part of the code is called.  Obviously, replace p1 with whatever you named the player's unit.  Also, obviously put in whatever code you wanted that will make the Shilkas attack.
« Last Edit: 05 Dec 2002, 18:54:43 by Ranger »
Ranger

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:check unit height and then, ummm, die
« Reply #4 on: 05 Dec 2002, 19:53:39 »
aaaah yes - nice one Ranger - i really should have thought of that... cheers :thumbsup:
Proud Member of the Volunteer Commando Battalion