Home   Help Search Login Register  

Author Topic: Detecting type  (Read 1082 times)

0 Members and 1 Guest are viewing this topic.

Iva

  • Guest
Detecting type
« on: 22 Nov 2003, 16:42:39 »
Is there a way to get type of soldier whic has entered the vehicle

m21man

  • Guest
Re:Detecting type
« Reply #1 on: 22 Nov 2003, 17:44:30 »
Yes, it should be possible. Have a script monitor a vehicle's crewcount, then when it raises use the counttype command to find out what type the new unit is.
« Last Edit: 22 Nov 2003, 17:44:53 by m21man »

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:Detecting type
« Reply #2 on: 22 Nov 2003, 19:54:42 »
The crewcount monitoring if a good idea, but counttype would only return the count. Instead use typeOf. Here's one way:

#start
_crewcount = (count crew vehicleName)
@ (_crewcount != (count crew vehicleName))
_newCrew = (crew vehicleName) select ((count crew vehicleName)-1)
_newCrewType = typeOf _newCrew
goto "start"

That would ofcourse create lag as much as you have vehicles running that .5 second "loop".
« Last Edit: 22 Nov 2003, 19:56:07 by MI_Fred »
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

m21man

  • Guest
Re:Detecting type
« Reply #3 on: 22 Nov 2003, 20:06:16 »
I've never seen typeof in the ComRef :hmm: .

Offline Burn

  • Members
  • *
Re:Detecting type
« Reply #4 on: 22 Nov 2003, 20:25:48 »
Quote
I've never seen typeof in the ComRef
Introduced in one of the resistance patches, I think it was 1.90 or 1.91 ::)...

m21man

  • Guest
Re:Detecting type
« Reply #5 on: 22 Nov 2003, 23:03:33 »
That makes my life a bit easier. What's the syntax for it?
« Last Edit: 22 Nov 2003, 23:04:06 by m21man »

8 Ball

  • Guest
Re:Detecting type
« Reply #6 on: 25 Nov 2003, 10:48:44 »
Quote
That makes my life a bit easier. What's the syntax for it?
Syntax: typeof "nameofvehicle"

Hope this helps  :)