Home   Help Search Login Register  

Author Topic: will this work?  (Read 676 times)

0 Members and 1 Guest are viewing this topic.

Homefry31464

  • Guest
will this work?
« on: 17 Feb 2003, 04:58:11 »
i am working on a script, just look at it and tell me if something will not work or is incorrect



_group = _this select 1
_helo = _this select 2

#loop
_helo land "GET IN"
_pos = getpos _helo
_x = _pos select 0
_y = _pos select 1
_z = _pos select 2
_z = _z - .02
_helo setpos [_x, _y, _z]
? (_group in _helo) : exit
~0.0001
goto "loop"
#quit
exit





thanks

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:will this work?
« Reply #1 on: 17 Feb 2003, 11:24:53 »
I don't know what you want to do with it, but I see no errors.

~0.0001 <- you are looping it very fast. maybe that's what you want.

_z = _z - .02 <- you want to drop the helo's altitude by 0.2. Should it be _z = _z - 0.2?
Not all is lost.

Pope_Zog

  • Guest
Re:will this work?
« Reply #2 on: 17 Feb 2003, 12:56:16 »
1. Perhaps you're letting the helo drop too quickly - you let it drop 0.02 m = 2 cm every 1/10,000 of a second. That's 200 metres per second, so unless you've got it very high up, it'll crash very fast ;)

2. You never use the "label" quit and the loop only terminates if the group is in the helo. You should add a condition that exits when the helo has crashed, e.g. ? not alive _helo : exit

Pope Zog

Homefry31464

  • Guest
Re:will this work?
« Reply #3 on: 17 Feb 2003, 19:02:56 »
_group = _this select 1
_helo = _this select 2

#loop
_helo land "GET IN"
_pos = getpos _helo
_x = _pos select 0
_y = _pos select 1
_z = _pos select 2
_z = _z - .00015
_helo setpos [_x, _y, _z]
? (_group in _helo) : exit
~0.0001
goto "loop"
? not alive _helo : exit




will the quotes around GET IN effect the script(like in a loop?). It is supposed to make the helicopter land quickly.    any other probs?