Home   Help Search Login Register  

Author Topic: Little scripting issue with addeventhandler  (Read 566 times)

0 Members and 1 Guest are viewing this topic.

PRiME

  • Guest
Little scripting issue with addeventhandler
« on: 15 Mar 2003, 15:46:45 »
Basicly I have this vehicle respawn script im trying to adopt due to no issues with createvehicle (the kind were its near impossible to addaction to a newly created vehicle)

Anyway the script gets started by the vehicle like this init:[this, wf5] exec "vehicle.sqs";

---Vehicle.sqs---

_obj = _this select 0
_dis = _this select 1

_pos = getPos _obj
_dir = getDir _obj


_handler = format ["[ _this select 0, _this select 1, %1, %2] exec ""killed.sqs""", _pos, _dir]
_obj addEventHandler ["Killed", _handler]

;_handler2 = format ["[_this select 0, _this select 1, %1, %2] exec ""getout.sqs""", _pos, _dir]
;_obj addEventHandler ["GetOut", _handler2]

_obj addEventHandler ["GetOut", "[_this select 0, _player] exec ""getout.sqs"""]

----getout.sqs---

_obj = _this select 0
_odis = _this select 1

Hint "1"

;? (CanMove _obj) : exit
? (_obj distance _odis < 200) : goto "Next1"

Hint "2"
exit

? !(CanMove _obj) : exit

;? !alive _obj : exit

#Next1
Hint "3"

------------------

The problem is that I can't get the wf5 object to be noticed for some reason, in script getout.sqs its ment to check the distance from the _obj and the _adis which is wf5 but it seems to either skip past it or comes up with a error.

I have tried many different ways but obviously not enough and it be nice if someone can give me some pointers. thanks.

Nasty Buttler

  • Guest
Re:Little scripting issue with addeventhandler
« Reply #1 on: 18 Mar 2003, 00:17:20 »
Did we solve this problem Prime?

PRiME

  • Guest
Re:Little scripting issue with addeventhandler
« Reply #2 on: 18 Mar 2003, 07:10:39 »
Sure did, Deadmeat helped each other out, he has since released the new respawn method.  You can talk to him about were to find it.