Forum Jump :

Author Message


Posts: 7
Rank:


Level: Member

Country: pt
Location: Algarve
Occupation: Student/Airsoft Player
Age: 23
In-game name: Warhammer

 
#1 Posted at 2014-02-06 20:26        
     
Hi armaholic folks!
Few weeks ago I was trying to make a mission with a spy. The spy's cover was compromised if he got too near of a OPFOR unit (a side). So I tried the distance cmd.
unit1 distance spy < 10
.
The code that I knew was only usable for a unit, never a side/faction. Is it possible to make it happen, something like this
side East distance spy < 10
in the On Activation box of a trigger?
Thank you and nice editing


Author Message


Posts: 1470
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2014-02-06 23:22        
     
This may work but I haven tested and had a little to drink.

trigger size as you wish
OPFOR present repeating

cond
{_x distance spy <10 and side _x == east }  count allunits != 0
on act
hint "detected" 
However it could be a little resource hungry as it has to search all east units


You could try limiting it to units in the trigger area

trigger OPFOR present repeating size as you wish

cond
{_x distance spy <10}  count thislist != 0

on act
hint "detected" 
now it only checks east units in the trigger zone


Another way would be to attach a 10 meter trigger to the spy and set it as follows

size 10 10
East present repeating

trigger name spy_trig
cond
this
on act
hint "detected" 

To attach the trigger to the spy put this in his init box
spy_trig attachto[spy,[0,0,0]]


Hope that helps

This post was edited by F2kSel (2014-02-07 00:16, ago)


Advertisement


Author Message


Posts: 7
Rank:


Level: Member

Country: pt
Location: Algarve
Occupation: Student/Airsoft Player
Age: 23
In-game name: Warhammer

 
#3 Posted at 2014-02-06 23:47        
     
Thanks for the reply F2keSel but unfortunatly, or because of the drink, the first 2 cmd are not working :/

P.S. HAMMMONDD!!!!


Author Message


Posts: 1470
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2014-02-07 00:19        
     
Yea I've modified the first method and tested it and it seems ok.

Second method seems to work for me as is.