Home   Help Search Login Register  

Author Topic: What happens when...  (Read 2687 times)

0 Members and 1 Guest are viewing this topic.

GavinP

  • Guest
What happens when...
« on: 17 Aug 2006, 20:14:59 »
I've got a playable unit of twelve soldiers all grouped in the editor. The leader has gr1=group this in his init field. What happens when the role isn't taken and AI is switched off? Does the group continue to be known as gr1?

This is rather critical as I want to use Grouplink2 on the mission, but its doubtful my team will have a full 12 on so the officer role will probably not be taken.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: What happens when...
« Reply #1 on: 18 Aug 2006, 12:52:20 »
Yes, all members of the group are still labeled gr1. It doesn't matter wether they are under AI or human control.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: What happens when...
« Reply #2 on: 18 Aug 2006, 19:07:24 »
maybe the use of

Code: [Select]
gr1 = group player

in the init.sqs would be a sure way to name the group. imo the server client/client issue wouldn't affect the problem as "player" is always local since all playable units are in the same group.

@nominesine
i think he liked to know if the gr1 = group this in the group leaders init line also takes effect if AI is off and none taken the part of the group leader, therefore the group leader unit isn't present ingame

GavinP

  • Guest
Re: What happens when...
« Reply #3 on: 18 Aug 2006, 19:09:22 »
Thanks guys. Yes, Myke, I did want to know if the group would be called gr1 even if the officer wasn't used in the game, regardless of AI or not.

I'll test out your idea of player.

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: What happens when...
« Reply #4 on: 18 Aug 2006, 23:07:49 »
maybe the use of

Code: [Select]
gr1 = group player

in the init.sqs would be a sure way to name the group. imo the server client/client issue wouldn't affect the problem as "player" is always local since all playable units are in the same group.

@nominesine
i think he liked to know if the gr1 = group this in the group leaders init line also takes effect if AI is off and none taken the part of the group leader, therefore the group leader unit isn't present ingame

Wouldn't recommend that. If this was used in a mission with several playable groups (which this apparently isn't though) the different clients would maybe end up having different groups labeled with 'grp1'. Though, what goes for this mission, it's still not a good solution. If the mission is played on a dedicated server, the server won't have any group labeled as 'grp1', which probably will cause problems.

I'd suggest you place a group, write 'grp1 = group this' in the leaders init field, start the mission as a multiplayer mission, disable all AI, choose someone else than the leader. Then, in a trigger or a script (i.e, in the init.sqs, after a small delay) write this:

Code: [Select]
hint format ["%1",leader grp1
if the hint comes back with you, the group is still labeled as 'grp1'. If it comes back with some scalar bool array fla fla fla error, it's not. If the latter, I suggest adding 'grp1 = group this' to all units in the group.

GavinP

  • Guest
Re: What happens when...
« Reply #5 on: 19 Aug 2006, 01:11:30 »
Thanks. I understand what you are getting at there. I was trying to figure out a way of debugging.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: What happens when...
« Reply #6 on: 21 Aug 2006, 12:55:35 »
Put gr1=group this in all init fields. Then it doesn't matter wich unit's are selected and wich unit's aren't selected. The actual leader of the group will then be recognized as leader gr1

The command Leader has it's downsides though. Read this.
« Last Edit: 21 Aug 2006, 12:57:10 by nominesine »
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: What happens when...
« Reply #7 on: 21 Aug 2006, 22:47:52 »
uh...I've used the leader command in multiplayer without problems. It always changes to the new leader. I once had a script running for several groups, placing a marker at the leaders position, to see how they behaved, and when the leader(s) were killed, the marker always changed to the new leader.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: What happens when...
« Reply #8 on: 22 Aug 2006, 19:46:15 »
I have found the leader command to not be robust in MP.  It may work most of the time, but it does not work all of the time.  Especially if there is a mix of AI and players in a group.
urp!

GavinP

  • Guest
Re: What happens when...
« Reply #9 on: 23 Aug 2006, 20:42:17 »
Cheers guys, you always learn more than the original "want" here, and that makes things so much better.

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: What happens when...
« Reply #10 on: 24 Aug 2006, 20:15:31 »
Cheers guys, you always learn more than the original "want" here, and that makes things so much better.

Good to hear ;) Usually nowdays people just get a "why the **** did you not answer earlier?" or something like that when trying to help :confused:

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re: What happens when...
« Reply #11 on: 29 Aug 2006, 00:56:50 »
OK, just to complete the answer on the primary question in this thread:

NO, if a unit isn't choosen and AI is switched off, also the code in it's init field disappears.

Possible solutions are:

What nomesine already suggested: put it into each unit's init field

or: create a trigger covering the whole group - activation: side of the group/present/once

condition: this
onActivation: gr1 = group thislist select 0

Another way is also:

name each individual of the group like: g1,g2,g2...g12
and in init.sqs you could do following:

grp_array = []
"if (alive _x) then {grp_array = grp_array + [_x]}" foreach [g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11,g12]
gr1 = group grp_array select 0

Off course there are way more methods to do that and i don't want sit on your head to take this or that, but
the 3 i mentioned work for sure and you should take the one which you most prefer.  :)

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted