Forum Jump :

Author Message


Posts: 27
Rank:


Level: Member

Country: nl
Location: Warzone
Occupation:
Age:
In-game name: Dutchy_Appie

 
#1 Posted at 2017-01-20 12:43        
     
Hi,

Basically I am making a 2 men mission. One gives cover, the other places a strobe on a certain vehicle to be able to track it at night.

strobe2 = "B_IRStrobe" createVehicle getMarkerPos "str_2";strobe2 attachTo [car1, [0, 1.2, 0] ];

Now is it possible to fire a trigger (to complete a task), when the strobe is attached and the player sees it blinking.

I tried using
p1 knowsAbout strobe 2 > 2;
, but no joy.

Anyone any suggestions?


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#2 Posted at 2017-01-20 13:19        
     
You could run code on the same place that you attach the strobe?

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Advertisement


Author Message


Posts: 27
Rank:


Level: Member

Country: nl
Location: Warzone
Occupation:
Age:
In-game name: Dutchy_Appie

 
#3 Posted at 2017-01-20 14:07        
     
Thanks for your response.

Don't understand????

Are you saying that its only possible with scripting?? Or can I use triggers to accomplish my goal?


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#4 Posted at 2017-01-20 14:33        
     
Whatever you have on the triggers ACT field, just add it to the strobe attachment code.
or
Add a variable your strobe attachment code, and make it the trigger's condition.

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 27
Rank:


Level: Member

Country: nl
Location: Warzone
Occupation:
Age:
In-game name: Dutchy_Appie

 
#5 Posted at 2017-01-20 14:57        
     
Really appreciate your help here. Not sure I understand... gonna try anyway.

Do you have an example maybe.


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#6 Posted at 2017-01-20 16:51        
     
Strobe attachment:
strobe2 = "B_IRStrobe" createVehicle getMarkerPos "str_2";
strobe2 attachTo [car1, [0, 1.2, 0]];

// this
missionNamespace setVariable ["strobe2Attached", true];

In trigger condition:
this && (missionNamespace getVariable ["strobe2Attached", false])

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 27
Rank:


Level: Member

Country: nl
Location: Warzone
Occupation:
Age:
In-game name: Dutchy_Appie

 
#7 Posted at 2017-01-20 17:01        
     
thank you for that. gonna try...

Added 39 minutes later:

can't get it to work...
I tried this:

Trigger set en linked to owner, On Act:
strobe2 = "B_IRStrobe" createVehicle getMarkerPos "str_2";strobe2 attachTo [car1, [0, 1.2, 0] ]; missionNamespace setVariable ["strobe2Attached", true]; hint "strobe":

Next trigger, Cond:
this && (missionNamespace getVariable ["strobe2Attached", false])
OnAct
hint "see it";
Executing the 1st trigger, 2nd trigger doesn't fire...

[b]Added 9 minutes later:[/b]

Got it working in another way.

1st trigger (named trig1) On Act:
strobe2 = "B_IRStrobe" createVehicle getMarkerPos "str_2";strobe2 attachTo [car1, [0, 1.2, 0] ];

2nd trigger Cond:
triggeractivated trig1;
OnAct:
hint "strobe visible";

Works like a charm.

Thanks a lot for pointing me in the right direction!!

This post was edited by Tombabr (2017-01-20 17:50, 271 days ago)


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#8 Posted at 2017-01-20 18:37        
     
# Tombabr : when the strobe is attached and the player sees it blinking.

You've done half of your condition.
If it was only for an attached strobe, it's ok. If you are waiting for the player1 looking at the strobe, you need to add:
&& cursorObject == strobe2

Note: you can script something replacing your trigger 2, just adding lines below the code to attach the strobe, supposed to be done instantaneously. You don't need any trigger to run a code as far as strobe is attached! On the other hand, you can wait for another condition. So feel free to add a condition like this:
strobe2 = "B_IRStrobe" createVehicle getMarkerPos "str_2";
strobe2 attachTo [car1, [0, 1.2, 0]];
strobe2 spawn {
  waitUntil {sleep 1;  cursorObject == strobe2};
  tsk1 setTastState "SUCCEEDED";
};

here tsk1 is the task id of your task (id is different from the module task name).

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 27
Rank:


Level: Member

Country: nl
Location: Warzone
Occupation:
Age:
In-game name: Dutchy_Appie

 
#9 Posted at 2017-01-22 11:39        
     
Put it to work in my mission. Works great!!

Thanks for helping me out Pierre!!