Home   Help Search Login Register  

Author Topic: Side function  (Read 939 times)

0 Members and 1 Guest are viewing this topic.

Slapstick

  • Guest
Side function
« on: 09 Nov 2005, 20:07:59 »
HI all,

A couple of quick and easy questions that are driving me crazy.

First, I'm having inexplicable problems with the side function in a "killed" event handler, in that it claims everyone's side is "CIV".  I have no problem installing the handler, and I can see who was killed and who was the killer (print their names, groups etc.), it's just the side function that is causing problems.  The AI loons being killed are set to "Never Fire" and "Careless" if that helps.

Second, what is the best way to get a list of all players on a given side?  Currently I use a trigger with a 10,000m radius, set to trigger once when WEST (say) is present.  The trigger launches a script and passes in thisList which I then store in a global variable.  But is there anyway to get a list of all units on a side directly at any point during the mission?  What I am looking for is something like:
_allUnits = units side west

But, obviously the above doesn't work..

Finally, were does the textLog function sends it's output?  It looks like it would be handy for debugging!

Any and all help is greatly appreciated.

Cheers,


Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Side function
« Reply #1 on: 09 Nov 2005, 20:14:27 »
I always thought the array produced by a trigger was updated automatically, so you would just need to access thislist again for an update.........possibly.

Maybe I was dreaming.


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

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Side function
« Reply #2 on: 09 Nov 2005, 20:15:35 »
I believe dead units are treated as Civis.

The way you describe of getting a list of all the units in one side is what I have used, but be aware that what you get is a list of units - not a list of soldiers.  For example if you have a tank in the trigger area the list will contain the tank, but not the crew of the tank.  To create a list of all the two legged units I use:

West_loons = []
{{if (alive _x) then {West_loons = West_loons + [_x]}} forEach crew _x} forEach (list triggername)

textlog - no idea.  Sorry

EDIT:

Just read Plank's post - yes indeed the trigger will update.  I assume the trigger was large enough to cover all the units that start the mission.  If not you need to think again.

Bye the way, have you read this?
http://www.ofpec.com/editors/comref.php?letter=S#side
« Last Edit: 09 Nov 2005, 20:18:28 by THobson »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Side function
« Reply #3 on: 09 Nov 2005, 20:23:45 »
I missed the textlog question.

I think this command is obsolete, at least, I've never seen it used.

Where would it send its output anyway?

EDIT   ClickMe



Planck
« Last Edit: 09 Nov 2005, 20:26:43 by Planck »
I know a little about a lot, and a lot about a little.

Slapstick

  • Guest
Re:Side function
« Reply #4 on: 09 Nov 2005, 21:36:39 »
Thanks guys,

And thanks THobson, you've undoubtably saved me hours of future debugging!   I'll try combining this with Planck's idea; instead of having the trigger's condition set to true and to only activate once, I'll change the condition to some flag that I control and have it activate repeatedly.  This way I don't have to try and maintain the list myself.  Is there a similar way to iterate over all the groups present?

Also, is there an offline version available of the commref you guys linked to?  I've always been referring to a local copy of the "Official" commref, but it seems I could answer most of my own questions if I started looking in the right places!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Side function
« Reply #5 on: 09 Nov 2005, 21:47:14 »
You can download a copy of the official command reference Here.

It isn't as up-to-date as the online version, because it has been edited to include added commands and other oddities discovered by members.

But, you can always edit your copy I suppose.

The Editors Depot has many many tutorials and tools available.........browse around them.   ;D


Planck
« Last Edit: 09 Nov 2005, 21:48:01 by Planck »
I know a little about a lot, and a lot about a little.

Slapstick

  • Guest
Re:Side function
« Reply #6 on: 10 Nov 2005, 18:55:51 »
I have the "Official" commref, I was just hoping someone else would have edited their local copy with the latest user comments.  I guess I'll go screen scraping and see if I can come up with something useful.  If I do I'll share it here.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Side function
« Reply #7 on: 10 Nov 2005, 19:50:21 »
You are correct, I have mine edited.

If you would like a copy, just give me your email address.


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