Home   Help Search Login Register  

Author Topic: Trigger activated after player reveals unit  (Read 1106 times)

0 Members and 1 Guest are viewing this topic.

Offline Undeceived

  • Members
  • *
    • My missions and campaigns
Trigger activated after player reveals unit
« on: 10 Nov 2007, 03:40:26 »
I'm becoming mad because of this already... :confused: I could not get it working and could not find it nowhere.  ???

I want a trigger to get activated when the player (lets call him John) reveals (with right mouse-click) a car (Car1).
I tried it many ways, the last thing I tried was this:

#start
IF(John reveal Car1)Then {[] exec "script.sqs";exit;}Else{goto "start"}


but I think it is pretty incomplete, isn't it?  :dunno:
Because there always comes an error with |#|...
The strange thing was for me, that this error also comes, when the whole script-file is empty. I don't know (it's the first mission I am making...)

Can you see the mistake? Or is there any other possibility to set up this script?
Thanks for the help already!
Current project: Black Lands (Arma 3)

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
Re: Trigger activated after player reveals unit
« Reply #1 on: 10 Nov 2007, 03:49:07 »
try a different method.  try creating a trigger (call it detect) on the area clicked, then make a list of all units in the trigger.  then something like this.

Code: [Select]
{player reveal _x} foreach detect
then delete the trigger.

surdus
Campaigns are hard, I'll stick with scripting for now!

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Trigger activated after player reveals unit
« Reply #2 on: 10 Nov 2007, 07:19:28 »
problem is dat da reveal commands does wat it says.... reveals da unit... and not check if da player have revealed it... now i know how u can check if da player knows about da unit.. usin da knowsabout command... like dat

waituntil {John knowsabout Car1 > 0.105};

and after dat have da rest of da script (usin .sqf file dat is.... da way u r tryin is a mix between .sqf and .sqs languages... so u r likly 2 get an error...) if u really wanna use an .sqs script den ur line shud lok like dat

#start
~0.01
? (Johnr knowsabout Car1 > 0.105) : [] exec "script.sqs";exit;
goto "start"

or

@ (Johnr knowsabout Car1 > 0.105)
[] exec "script.sqs";exit;

but dis will triger whenever da player knows about da target nd not only if he clicks on it...

now... mebe Mr.Peanut cud give u some hints on how 2 detect if a unit is clicked... as i think dats somin he does in his bino target script

nywayz.... dats all i cud think bout :D

LCD OUT

[edit]

right... i forgot

WELCOME 2 OFPEC M8
« Last Edit: 10 Nov 2007, 07:22:12 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Undeceived

  • Members
  • *
    • My missions and campaigns
Re: Trigger activated after player reveals unit
« Reply #3 on: 10 Nov 2007, 23:50:18 »

[edit]

right... i forgot

WELCOME 2 OFPEC M8


:D Thanks, this forum is what I have been looking for!

I am going to try it with the codes you guys provided, so I'll report back later, thank you for now!!
Current project: Black Lands (Arma 3)