Home   Help Search Login Register  

Author Topic: Group problems  (Read 1116 times)

0 Members and 1 Guest are viewing this topic.

XPS

  • Guest
Group problems
« on: 11 Jul 2006, 22:09:40 »
I have a unit with in his init field:
Code: [Select]
grp1 = group this
I want the name of the group he is in when he enters a trigger.

So the result I want is: grp1

How can I do this?


Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Group problems
« Reply #1 on: 11 Jul 2006, 22:37:36 »
as far as i know, variables you assign to groups and units as their identifiers cannot be returned through scripts as discrete names.

put another way, think of the group as a colour - the name you give it is "red", but asking flashpoint what colour the group is will not return 'red', it can only show you the actual colour.

does that make sense?

to develop on your question, to find out the group to which a unit activating a trigger belongs, in the on-activation line put

Code: [Select]
mygroup = group (thislist select 0)
you can now use the global variable mygroup to point to whichever group that activating unit is in.
« Last Edit: 11 Jul 2006, 22:47:19 by bedges »

XPS

  • Guest
Re: Group problems
« Reply #2 on: 11 Jul 2006, 22:55:10 »
If I use this code:
Code: [Select]
Hint Format["%1", group Player]
Then it returns: CIVL Alpha Black and if I am another player it returns CIVL Bravo Black

etc. etc.

What are those names?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Group problems
« Reply #3 on: 11 Jul 2006, 23:20:13 »
they appear to be side (CIVL) followed by the group name. this raises odd questions.

what are we talking about when we say "group name"? what are we talking about when we say "player's name"?

when you place a unit on the map, make it the player and then stick a variable in the 'name' box, is that the player's name? if you use setidentity to give a unit a name, is that its name?

it might be simpler to think of them as variables and monikers. variables can be recognised and used by flashpoint. monikers are just decoration. the data in the name box is a variable.

Code: [Select]
name player
gives the player's moniker. you couldn't put

Code: [Select]
XPS addweapon "lawlauncher"
because flashpoint wouldn't know what XPS stands for, even though that's what it returns as the player's name.

similarly, CIVL Alpha Black is just a moniker. it's the name used in sidechats to identify you and your group, but flashpoint hasn't a clue what it really means.

XPS

  • Guest
Re: Group problems
« Reply #4 on: 12 Jul 2006, 00:12:36 »
Ok, I understand that.

So it isn't possible to return the value I put in the 'name' box?
The reason I ask it is that I need to know which one of my units is entering the trigger.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Group problems
« Reply #5 on: 12 Jul 2006, 10:12:07 »
ah, now that is doable. returning the name you enter into the 'name' box cannot be done, but that's just a name you define to let flashpoint know what you're talking about. you can get at the information another way though.

as mentioned farther above, to find out the group to which a unit activating a trigger belongs, in the on-activation line put

Code: [Select]
trig_loon = (thislist select 0)
which defines a temporary variable trig_loon which refers to the first loon to walk into your trigger. then in a script you could put

Code: [Select]
_name = name trig_loon
_group = group trig_loon
_groupcount = count units _group
_leader = name leader _group

and anything else you can think of. it all comes down to referring to the units using temporary variables.

XPS

  • Guest
Re: Group problems
« Reply #6 on: 12 Jul 2006, 12:51:53 »
Thanks :)