OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: solitosnake on 11 Dec 2005, 19:16:34

Title: knowsabout command
Post by: solitosnake on 11 Dec 2005, 19:16:34
im having problems with my realistic patrol mission. its supposed to be a surveillance mission. what do i write in triggers to make it activate when i, the player sees something? is there something which can make the objective activate when i right click on a target?

thanks in advance!
Title: Re:knowsabout command
Post by: hardrock on 11 Dec 2005, 19:25:21
Using the 'detected by' option maybe?
Title: Re:knowsabout command
Post by: macguba on 11 Dec 2005, 19:37:20
Welcome to the forum!

I'm not sure how well this will work with a human unit rather than an AI loon, but yes you could just use a "detected by" trigger.

If you want to be more specific - that is, if the player has to detect a specific unit rather than just a side - then the knowsAbout command is probably the way to go.

Trigger:-
Condition:    playerGrp knowsAbout loon1 > XXX
On activation:   as you like

Syntax not guaranteed. I can't remember what XXX should be but there are some good writeups on knowsabout kicking around.   Try the forum the tutorials and the FAQ in the Editors Depot.   I know its a chore using all the different search functions ....
Title: Re:knowsabout command
Post by: solitosnake on 11 Dec 2005, 19:58:05
wow. bloody thank you. the navy seals have to detect an enemy unit. an officer, making an arms deal. i post here if it works or if not. thanks for the quick replies!
Title: Re:knowsabout command
Post by: THobson on 11 Dec 2005, 19:59:42
If you want to check if the player knows about one or more units in a particular group try putting this in the trigger's condition field:

{player knowsabout _x > 0.105} count units groupname > 0

Where groupname is the name of the group you want to check that the player knows about.  If you want to check on more that one group try:


{player knowsabout _x > 0.105} count (units groupname1 + units groupname2 ...) > 0

Not tested and I am now in that nice Sunday pre-dinner state of relaxed inebriation so who knows!
Title: Re:knowsabout command
Post by: solitosnake on 11 Dec 2005, 20:04:44
more specific: its on tonal, and i know there are the same units on both east and resistance side. so if i make east and resistance friendly to each other, they wont shoot at each other. and if hes the onlt res. soldier in the mission, it will only activate when i right click on him. because the map is filled with east patrols.  do you think that will work? or is it too unreliable?
Title: Re:knowsabout command
Post by: macguba on 11 Dec 2005, 20:12:38
Sounds like it should work.   Certainly worth a try.
Title: Re:knowsabout command
Post by: solitosnake on 11 Dec 2005, 20:36:22
yes it works. good and thanks for the help!