Home   Help Search Login Register  

Author Topic: i.e side WEST and a number converted into "WEST"  (Read 3997 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: i.e side WEST and a number converted into "WEST"
« Reply #15 on: 14 Feb 2009, 23:54:01 »
Thanks all for your input,

Thanks especially to Worldeater who's solution worked right away... kind of.

My conclusion:

It seems that if you want to have a Detect Dead Bodies script that checks different combinations of variables, who died and who found the dead body, config based sidechecking works best.

Just like Worldeater indicated it doesn't work so well with checking sides on resistance/independent and civilians.

If you want the script to work even on units that have had their side changed (through mission.sqm or grouped with a leader from another side), you better change the actual script conditions to consider:

if (group finder == myChangedSideGroup ) then blahblah
or if (finder == mySpecialUnit) then blahblah

Think I'll go with the config sidecheck after all, I was wishing to cover everything, but I guess it's not possible.

Cheers,

Laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: i.e side WEST and a number converted into "WEST"
« Reply #16 on: 14 Feb 2009, 23:55:32 »
Well now, according to the biki:

"CIV" is the string returned when using  hint format["%1",civilian]
and
"GUER" is the string returned when using  hint format["%1",resistance]


Planck
I know a little about a lot, and a lot about a little.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: i.e side WEST and a number converted into "WEST"
« Reply #17 on: 14 Feb 2009, 23:59:37 »
In a similar way, "2" is not equal to 2.

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: i.e side WEST and a number converted into "WEST"
« Reply #18 on: 15 Feb 2009, 00:26:31 »
I think doing the config checks is fine.

Think about it: if I'd find a cold body in a SLA uniform I'd report a dead SLA soldier. How should I know the guy was a US SpecOp in disguise?

As an additional feature you could add all detected units to a global array. So if someone needs to know if his SpecOp in SLA uniform was found he can check the array.
try { return true; } finally { return false; }

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: i.e side WEST and a number converted into "WEST"
« Reply #19 on: 15 Feb 2009, 00:33:01 »
Thanks again,

Good thinking  :clap:, will add that array of found dead bodies in the script, then it's hopefully finished.

Laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Sparticus76

  • Members
  • *
Re: i.e side WEST and a number converted into "WEST"
« Reply #20 on: 15 Feb 2009, 01:57:16 »
I put this in a "west" soldiers init line and then shot him;

Code: [Select]
this addeventhandler ["killed",{hint format ["side of deadman is %1", side (_this select 0)]}]
the hint said "side of deadman is CIV"

Offline Rommel92

  • Members
  • *
Re: i.e side WEST and a number converted into "WEST"
« Reply #21 on: 15 Feb 2009, 02:23:01 »
All dead man become side CIV, as they become an object, and all objects/vehicles that aren't claimed are classed as CIV.

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: i.e side WEST and a number converted into "WEST"
« Reply #22 on: 15 Feb 2009, 03:12:47 »
 :weeping:

They become side civilian! "CIV" is a mere string representation of civilian.

The string representation of 2 is "2", for False it's "FALSE" and for civilian it's "CIV".
try { return true; } finally { return false; }

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: i.e side WEST and a number converted into "WEST"
« Reply #23 on: 15 Feb 2009, 15:41:34 »
The correct sides to check for are:

EAST
WEST
RESISTANCE
CIVILIAN

As in: side _unit == RESISTANCE

If _unit IS on resistance side, result is "true".
Forget all the "" and CIV and GUER, as thay are not the way to check for sides.

Period   :dry:

Laggy
« Last Edit: 15 Feb 2009, 16:07:14 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Rommel92

  • Members
  • *
Re: i.e side WEST and a number converted into "WEST"
« Reply #24 on: 15 Feb 2009, 21:12:47 »
:weeping:

They become side civilian! "CIV" is a mere string representation of civilian.

Haha, I'm sorry. I understood you before, just wrote 'CIV' for some reason, yes I get it now, side _eastguy string returns "EAST", and value returns: EAST. And for _civguy it would be : "CIV" and CIVILIAN,  :P.

The correct sides to check for are:

EAST
WEST
RESISTANCE
CIVILIAN

As in: side _unit == RESISTANCE

If _unit IS on resistance side, result is "true".
Forget all the "" and CIV and GUER, as thay are not the way to check for sides.

Period   :dry:

Laggy

So did you end up getting it all fixed and working with your script?  :dunno:

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: i.e side WEST and a number converted into "WEST"
« Reply #25 on: 15 Feb 2009, 21:18:12 »
« Last Edit: 15 Feb 2009, 21:24:12 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.