Home   Help Search Login Register  

Author Topic: Thelist select HIM  (Read 927 times)

0 Members and 1 Guest are viewing this topic.

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Thelist select HIM
« on: 17 Nov 2002, 05:31:33 »
Ooh the hairy one is here again... not me.

This is the hairy thingy bothering me. I'm using the condition count array command, which I've found useful in the past, but now it seems too jerked off.  :-X
I know the _x stands for each elements in the list, but I'd really wanna use that outside the command. As in:
Quote
_trbpos = _this
_obj = "Logic" camcreate _trbpos
? ("(_x distance _obj <= 3)" count ALLLIST) > 0 : [_x,0] exec "trcbeam.sqs"
deleteVehicle _obj
exit

So I want to use _x as an argument in the script which is executed by him who stands 3 meters or less away from the fearsome _obj.  ;D

ALLLIST is the list which comes from a trigger activated by any1 in the whole area. IE it covers the whole area so there I get the whole population at once.

Some points why you shouldn't suggest ALLLIST select 0;
It always stands for player. Now whenever whoever get's within 3 meters of that _obj, the effects are poured on the poor players neck.

Sooo, lemmi hear this soon.
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:Thelist select HIM
« Reply #1 on: 19 Nov 2002, 01:29:55 »
Hmmyes, _this btw. is the position of a dropped particle passed into this script every 0.3 seconds... since it's impossible for any unit to be exactly in the same position, I create a gamelogic there and ask if anyone on the map is within 3 meters. That works, I get results, but how to pass those results as arguments to a script?
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Thelist select HIM
« Reply #2 on: 19 Nov 2002, 01:43:48 »
i dont think u can pass _x 2 somwere else but i hop im wrong in da meantime u can use a loop  ;D

Code: [Select]
_trbpos = _this
_obj = "Logic" camcreate _trbpos
_i = 0
#loop
_bob = ALLLIST select _i
? _bob distance _obj <= 3 : goto "endloop"
_i = _i+1
? _i = count ALLLIST : goto "endloop1"
goto "loop"
#endloop
[_bob,0] exec "trcbeam.sqs"
#endloop1
deleteVehicle _obj
exit

wil do da thing  ;D

LCD OUT

[edit] dere was a bug in da script - fixed now
« Last Edit: 19 Nov 2002, 01:52:56 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:Thelist select HIM
« Reply #3 on: 19 Nov 2002, 03:34:30 »
I though I was close, had seen that list select _i, the strayed ends of my synopses just didn't connect  ;D

And that looks perfect and fitting. Thanks, will try immediately...

Yup, that R0x!  :D

After minor debugging, it won't create excessive lag and other issues.
Quote
_trbpos = _this
_obj = "Logic" camcreate _trbpos
_i = 0
#loop
_bob = ALLLIST select _i
? _bob distance _obj <= 3 : goto "endloop"
_i = _i+1
? _i == count ALLLIST : goto "endloop1"
~0.01
goto "loop"
#endloop
deleteVehicle _obj
[_bob,0] exec "trcbeam.sqs"
#endloop1
deleteVehicle _obj
exit
Very little changes, but the more important. If the player is so daft and let's every1 on the map get cought by this death defying _obj  ;D, it'll result in the zero divisor error, but that won't happen hopefully.

Ah, ty LCD  ;), now back to editing....mwahahaha
« Last Edit: 19 Nov 2002, 03:58:29 by MI_Fred »
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.