Home   Help Search Login Register  

Author Topic: Friend or foe  (Read 3133 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Friend or foe
« on: 21 Jun 2007, 00:11:23 »
That is the question.

Is unit A friend or foe of unit B?

How to know?

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Friend or foe
« Reply #1 on: 21 Jun 2007, 00:27:18 »
u cud use countEnemy

unitA countEnemy [unitB] > 0

even tho i think deres a better way ???

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Friend or foe
« Reply #2 on: 21 Jun 2007, 00:30:05 »
LOL Yep, I'm waiting for that suposed "better way". But it seems to not be so obvious.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Friend or foe
« Reply #3 on: 21 Jun 2007, 00:39:08 »
deres da enemy command as in

unitA enemy (SIDE unitB)

now dat returns a true or false... works 4 whole side not 4 a unit tho

i hope i got dat 1 right... enemy command is not explained good

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Friend or foe
« Reply #4 on: 21 Jun 2007, 00:43:10 »
Seems "enemy" is just the side of renegade units, these that kill any friendly becomes renegade (enemy side).

Offline Cheetah

  • Former Staff
  • ****
Re: Friend or foe
« Reply #5 on: 21 Jun 2007, 00:45:05 »
The friendly command has almost the same description but I don't know how one could use it to determine if a unit is friend or foe.

There are numerous alternatives for this but as far as I know there is no single command which can do the job right now. Might be good to create a function for this.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Friend or foe
« Reply #6 on: 21 Jun 2007, 01:01:34 »
u cud also use da findNearestEnemy...

unitA findNearestEnemy (getpos unitB)

shud return unitB if it is

but dats probably not wat ur lookin 4 also

btw in da COMREF it says dat sideEnemy is used 4 renegades... but it doesnt say dat on da Enemy command

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Friend or foe
« Reply #7 on: 21 Jun 2007, 01:04:29 »
"enemy" seems to be the same, that is a side for enemies to all sides (renegades).

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Friend or foe
« Reply #8 on: 21 Jun 2007, 13:40:52 »
Hmm.

KnowsAbout ?

I don't know if this is any use. ???

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Friend or foe
« Reply #9 on: 21 Jun 2007, 13:45:30 »
mmmm nope, knowsabout tells you how much do you "know" a unit, but it is worthless to determine if friend or foe.

Offline Rellikki

  • Members
  • *
  • Die-hard OFP player
Re: Friend or foe
« Reply #10 on: 21 Jun 2007, 14:21:42 »
If the units A and B are on the same side, how about checking unit A's rating?
According to Biki:

Quote
Each hit in a single player game will affect the player's rating. If it goes below -2000, he will be considered an enemy, and be attacked by all units.

So you'd need to check if unit A's rating is below -2000, which happens like this (I think):

Code: [Select]
rating unit_A = -2000 : goto "enemy"
goto "friendly"

#enemy
Hint "Unit A is an enemy"
Exit

#friendly
Hint "Unit A is friendly"
Exit

Just a thought, not sure if it works.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Friend or foe
« Reply #11 on: 21 Jun 2007, 16:19:37 »
Won't work. All units have a positive rating unless they attack their own side.
urp!

Offline Blanco

  • Former Staff
  • ****
Re: Friend or foe
« Reply #12 on: 21 Jun 2007, 19:03:52 »
Quote
u cud use countEnemy

unitA countEnemy [unitB] > 0

even tho i think deres a better way Huh?

LCD OUT

Note that empty enemy vehicles return as friendly, a least in OFP. I don't know how the command behave in Arma.
« Last Edit: 21 Jun 2007, 19:05:36 by Blanco »
Search or search or search before you ask.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Friend or foe
« Reply #13 on: 21 Jun 2007, 19:06:48 »
And that is good, dont destroy what you may steal later  :D

Offline Blanco

  • Former Staff
  • ****
Re: Friend or foe
« Reply #14 on: 21 Jun 2007, 19:09:41 »
Yes, but why do they destroy the vehicle when the crew disembarks? What is the real threat here? The empty vehicle or the crew that's firing upon you?

« Last Edit: 21 Jun 2007, 19:12:44 by Blanco »
Search or search or search before you ask.