Home   Help Search Login Register  

Author Topic: knows about any east side  (Read 682 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
knows about any east side
« on: 28 Jun 2005, 18:54:41 »
okay if i create a trigger east present
on activation : east_units = this list
how would i check if the player or any memeber in his squad knows about any east soldier who is 'east_units' but they have to know eneough to see them as an enemy
i would like to do it with a trigger so i can set pos it over the player so im not getting messages from over 300metres away

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:knows about any east side
« Reply #1 on: 28 Jun 2005, 22:51:58 »
Click on EDITORS DEPOT
Click on the + sign next to ONLINE REFERENCES
Click on Commands
Clickon K

Read about Knowsabout

The magic number is 0.105

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:knows about any east side
« Reply #2 on: 28 Jun 2005, 23:08:35 »
You also might want to check out this function:

http://www.ofpec.com/editors/funcref.php?filter_func=47
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline 456820

  • Contributing Member
  • **
Re:knows about any east side
« Reply #3 on: 29 Jun 2005, 16:15:19 »
right thnaks alot ive had a look at the function wich i dont uderstand but another read through of the description should help
also im going to have alook at the com ref now

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:knows about any east side
« Reply #4 on: 29 Jun 2005, 16:36:09 »
I don't know if it would suit your needs (and I haven't used it for a while) but there is the low-tech option of using a trigger set up as 'East detected by West'.  Might be worth experimenting with.

Offline 456820

  • Contributing Member
  • **
Re:knows about any east side
« Reply #5 on: 29 Jun 2005, 18:09:46 »
okay i tried te function wich i think has kind of worked but the group chat is getting an error something like nt expected string or something like that heres the script

Code: [Select]
_unitknown = [west_units, [east1,east2,east3,east4,east5,east6,east7,east8], true] call knownUnits
_hourdir = [player,_unitwich] call DirInhour
_distunit = [getpos _unitwich,getpos player] call distancePos

player groupchat [format ["CONTACT %1 AT %2",_distunit,_hourdir]]

it should if west units knows about anyof the east units selected and then check the direction and distance from the player to that unit then the player should group chat that the east unit is "distance" then "direction"

whats wrong here

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:knows about any east side
« Reply #6 on: 29 Jun 2005, 20:46:20 »
Code: [Select]
player groupchat [format ["CONTACT %1 AT %2",_distunit,_hourdir]]should be
Quote
player groupchat format ["CONTACT %1 AT %2",_distunit,_hourdir]
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:knows about any east side
« Reply #7 on: 30 Jun 2005, 01:49:43 »
Well, check again and you'll see that my function returns an ARRAY of units known. If you want the nearest known unit, then use the first element of the returned array. But first check to see if the array has ANY elements, because if it doesn't, then no units are known.

Also, you use different variable names in your script, which might be an error (unless they are defined before this).
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline 456820

  • Contributing Member
  • **
Re:knows about any east side
« Reply #8 on: 30 Jun 2005, 16:15:45 »
hey how can i get the first ellemtent in the array ?

qqqqqq

  • Guest
Re:knows about any east side
« Reply #9 on: 30 Jun 2005, 17:09:25 »
array select 0