Home   Help Search Login Register  

Author Topic: how to know that ap1 detect ap2  (Read 988 times)

0 Members and 1 Guest are viewing this topic.

Offline TonyRanger

  • Members
  • *
  • I'm a llama!
how to know that ap1 detect ap2
« on: 19 Mar 2004, 13:46:14 »
ap1 is a west man,ap2 is a east man
I know if
ap1 knowsabout ap2 >1 means  ap1 detect ap2
but ap1 hear the ap2's shot can Activate this tigger too.
I need a plan that can show :
1.unitname be detected by west
2.unitname detect west
3.west has been detected by unitname

I mean in script not tigger
knowsabout can be activated by sound of shoot,not by AI's eyes.
I need to know this can anyone help me?

sanam

  • Guest
Re:how to know that ap1 detect ap2
« Reply #1 on: 20 Mar 2004, 11:37:11 »

I assume you need these conditions into your script as condition field, hence why not using triggers firing scripts ?
The Syntax when completing the triggers field is rather easy, you there can set some with the different conditions qualified.
Either you choose one condition to be enough, and therefore all trigs fire the same script, or you just build yourself a set of trig-conditions to refer to themselves as true or false.

In case you didn't know, if you want a precise guy to be the activation field of a trigger, simply switch to F2 and draw a line between the trigger and him. Sorry if you already knew this one

Hence I would suggest:
Ap1 synced to Trig1, 0 size, switch type, "detected by east", condition this, activation EastDetectAP1=true
opposite...
Ap2 synced to Trig1, 0 size, switch type, "detected by West", condition this, activation WestDetectAP2=true

You now have two variable that you can freely use in any script you want, as not detected yet will be "False" and detected will be "true"

You can even have more trigs,
Trig22 stating "WestDetectAP2" as condition to fire a script without the variables defined in trig1 and Trig2

Trig11 stating "EastDetectAP1" as condition to fire another script without the variables defined in trig1 and Trig2.

Triggers are easy, especially as setting variables and conditions, that's what they are here for.

I Hope I didn't completely missed your point. Next time come up with samples will ya ?
 :-*

Cheers from da Peacepunk.

Offline TonyRanger

  • Members
  • *
  • I'm a llama!
Re:how to know that ap1 detect ap2
« Reply #2 on: 21 Mar 2004, 14:31:10 »
but I have to do all of this because of  I want made a sound script,when ap1 detect ap2  ap1 say"eng12", when ap1 knowsabout ap2 but ap1  don't detect ap2 ap1 say"eng37",when ap1 "fire" ap1 say "eng8",when ap1 "hit"  but ap1  don't detect ap2  ap1 say"eng40",when ap1 "hit" and ap1 detect ap2 ap1 say"eng39"....
by I don't know how to do this,so now the script is like this.

;soundAI.sqs V0.1 tonyranger
;after";"is what the guy will say。
_soundAI=10
_ap1=_this select 0
_ap2=_this select 1
#main
?alive _ap1:goto"work"
#work
?(_ap1 distance _ap2 <10) and (_man1 Knowabout _man2 >3):goto"close"
?(_ap1 distance _ap2 <150) and (_ap1 distance _ap2 > 100)and (_man1 Knowabout _man2 >1):goto"far"
?rating _ap1==200:goto"kill"
?speed _ap1>0.1:goto "move"
?(getdammage _ap1 >0.6) and (alive ap1):goto"medic"
?(getdammage _ap1 >0.1) and (getdammage _ap1 <0.6):goto"under"
?(fleeing _ap1) and (alive _ap1):goto "surrander"
?getdammage _ap2>0.1 :goto "see"
~(random 5)
goto "main"
#close
? (_soundAI =< 2) :_ap1 say"eng6";cover me1
? (_soundAI >2) and (_soundAI <4):_ap1 say"eng7";cover me 2
? (_soundAI >4) and (_soundAI <6):_ap1 say"eng1";bastard 1
? (_soundAI >6) and (_soundAI <8):_ap1 say"eng2";bastard 2
? (_soundAI >8) and (_soundAI =<10):_ap1 say"eng3";bastard 3
goto "main"
#far
? (_soundAI =< 3) :_ap1 say"eng40";who's there
? (_soundAI >3) and (_soundAI <6):_ap1 say"eng16";get out of there 1
? (_soundAI >6) and (_soundAI =<10):_ap1 say"eng17"";get out of there 2
goto "main"
#kill
? (_soundAI =< 2) :_ap1 say"eng35";stector clear 1
? (_soundAI >2) and (_soundAI <4):_ap1 say"eng36";stector clear 2
? (_soundAI >4) and (_soundAI <6):_ap1 say"eng8";die 1
? (_soundAI >6) and (_soundAI <8):_ap1 say"eng9";die 2
? (_soundAI >8) and (_soundAI =<10):_ap1 say"eng10";die 3
goto "main"
#move
? (_soundAI =< 2) :_ap1 say"eng20";go go go 1
? (_soundAI >2) and (_soundAI <4):_ap1 say"eng21";go go go 2
? (_soundAI >4) and (_soundAI <6):_ap1 say"eng15";forward
? (_soundAI >6) and (_soundAI <8):_ap1 say"eng18";get in your position 1
? (_soundAI >8) and (_soundAI =<10):_ap1 say"eng19";get in your position 2
goto "main"
#medic
? (_soundAI =< 2) :_ap1 say"eng32";medic I'm hit 1
? (_soundAI >2) and (_soundAI <4):_ap1 say"eng33";medic I'm hit 2
? (_soundAI >4) and (_soundAI <6):_ap1 say"eng34";medic I'm hit 3
? (_soundAI >6) and (_soundAI <8):_ap1 say"eng22";help 1
? (_soundAI >8) and (_soundAI =<10):_ap1 say"eng23";help 2
goto "main"
#under
? (_soundAI =< 2) :_ap1 say"eng29";we are under attack return fire
? (_soundAI >2) and (_soundAI <4):_ap1 say"eng30";stay sharp they are all round us
? (_soundAI >4) and (_soundAI <6):_ap1 say"eng31";look out 1
? (_soundAI >6) and (_soundAI <8):_ap1 say"eng39";look out 2
? (_soundAI >8) and (_soundAI =<10):_ap1 say"eng37";look out 3
goto "main"
#surrander
? (_soundAI =< 5) :_ap1 say"eng11";don't shoot we are not armed
? (_soundAI >5) and (_soundAI =<10):_ap1 say"eng38";we surrander
goto "main"
#see
? (_soundAI =< 2) :_ap1 say"eng12";enemy spotted,open fire 1
? (_soundAI >2) and (_soundAI <4):_ap1 say"eng13";enemy spotted,open fire2
? (_soundAI >4) and (_soundAI <6):_ap1 say"eng14";enemy spotted,open fire3
? (_soundAI >6) and (_soundAI <8):_ap1 say"eng27";let they have it 1
? (_soundAI >8) and (_soundAI =<10):_ap1 say"eng28";let they have it 2
goto "main"





Offline TonyRanger

  • Members
  • *
  • I'm a llama!
Re:how to know that ap1 detect ap2
« Reply #3 on: 22 Mar 2004, 14:36:47 »
I need help,please tell me how to do this.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:how to know that ap1 detect ap2
« Reply #4 on: 23 Mar 2004, 01:07:05 »
We don't understand the problem.  This

Quote
when ap1 detect ap2  ap1 say"eng12",
when ap1 knowsabout ap2 but ap1  don't detect ap2

doesn't really make sense since "detecting" and "knowsAbout" are the same thing.  

Can you explain again?    Perhaps use different words?
Plenty of reviewed ArmA missions for you to play

Offline TonyRanger

  • Members
  • *
  • I'm a llama!
Re:how to know that ap1 detect ap2
« Reply #5 on: 23 Mar 2004, 12:45:59 »
the command "knowsabout" is not very nice,it will activated by sound of shoot.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:how to know that ap1 detect ap2
« Reply #6 on: 23 Mar 2004, 19:06:10 »
Yes ... so why is that a problem?     What are you trying to do?
Plenty of reviewed ArmA missions for you to play

Offline TonyRanger

  • Members
  • *
  • I'm a llama!
Re:how to know that ap1 detect ap2
« Reply #7 on: 24 Mar 2004, 03:47:36 »
1.when ap1 detect ap2  ,ap1 say"eng12",
2.when ap1 knowsabout ap2 but ap1  don't detect ap2 ,ap1 say"eng37",
3.when ap1 "hit"  but ap1  don't detect ap2 , ap1 say"eng40".
4.when ap1 "hit" and ap1 detect ap2 ,ap1 say"eng39".
by I don't know how to do this,so now the script is like this.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:how to know that ap1 detect ap2
« Reply #8 on: 24 Mar 2004, 09:18:15 »
Yes you've told us that but you haven't answered my question.   Why doesn't knowsabout work?  What is the problem over hearing a shot?    Tell us what are trying to do without using the word "detect".  
Plenty of reviewed ArmA missions for you to play

Offline TonyRanger

  • Members
  • *
  • I'm a llama!
Re:how to know that ap1 detect ap2
« Reply #9 on: 24 Mar 2004, 12:02:03 »
"the command "knowsabout" is not very nice,it will activated by sound of shoot." means even the AI soldier haven't see player but If player open fire it will be activated(because of AI soldier hear your shot.)

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:how to know that ap1 detect ap2
« Reply #10 on: 24 Mar 2004, 13:32:16 »
Yes, but why is that a problem?   What's the underlying situation?

If you want to check that the AI unit has "seen" the player then I suppose you could use knowsabout combined with getDir and some trigonometry to figure out if the player is in the loon's line of sight.
Plenty of reviewed ArmA missions for you to play

Offline TonyRanger

  • Members
  • *
  • I'm a llama!
Re:how to know that ap1 detect ap2
« Reply #11 on: 24 Mar 2004, 14:55:57 »
getdir?how?