Home   Help Search Login Register  

Author Topic: new group  (Read 1894 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
new group
« on: 07 Mar 2005, 20:47:24 »
i was wondering at what the line of code or 2 would be for once a group has only the player left he joins a new group?

Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
Re:new group
« Reply #1 on: 07 Mar 2005, 21:10:32 »
In a script / trigger put this, what ever floats ya boat.

((count(units group player))<2)
[player] join (group newgroupleader)


where newgroupleader is the new group leader (needed to be said)
[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]

Offline 456820

  • Contributing Member
  • **
Re:new group
« Reply #2 on: 07 Mar 2005, 21:13:55 »
right i think i get that just alot of brackets so would it be
(count units group1)<2)
[player name] join (group2 newleadername)

and would {alive_x} count units group1 == 1 work as that would check if the group the player is in has one person left wich would obdviously be the player

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re:new group
« Reply #3 on: 07 Mar 2005, 21:26:52 »
not (count units group1)<2)

but

((count(units group player))<2)

Offline 456820

  • Contributing Member
  • **
Re:new group
« Reply #4 on: 07 Mar 2005, 21:59:21 »
thanks i will try that sometime

Offline 456820

  • Contributing Member
  • **
Re:new group
« Reply #5 on: 09 Mar 2005, 19:50:55 »
right im about to test but alittle problem
((count(units group player))<2)
do i place my group where it says group and player name where it says player
same with
[player name] join (group2 newleadername)
does it need to be player name new group and then the group leader

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:new group
« Reply #6 on: 09 Mar 2005, 20:21:43 »
if you take a look in the comref you'll see units, group and player are all commands, or rather they're built-in references to things.

units grp
Operand types:
    grp: Group
Type of returned value:
    Array
Description:
    Arrays of all units in the group.

group obj
Operand types:
    obj: Object
Type of returned value:
    Group
Description:
    Group in which given unit is assigned.

player
Type of returned value:
    Object
Description:
    person controlled by player.

so, ((count(units group player))<2) is pretty self-explanatory, although the 'player' part of that line could be the name of any unit leading a group.

similarly, [ player ] join (group newgroupleader) means the player unit will join the group led by newgroupleader, who again could be any unit leading a group.

hope that clears things up :)
« Last Edit: 09 Mar 2005, 20:23:12 by bedges »

Offline 456820

  • Contributing Member
  • **
Re:new group
« Reply #7 on: 12 Mar 2005, 15:14:11 »
right i have only just managed to get the computer working again and i tried this and it seems to work but when it joins it says 10 follow 10
where 10 is the number of the player.
the way i have used it is
[off1] join (newgroup)
where off1 is the name of the player
and newgroup is the new group i tried it with the name of the group leader but didnt work i thnk because he is usually killed

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:new group
« Reply #8 on: 12 Mar 2005, 16:52:34 »
Don't use the name of the leader, as you say he might get killed.  Give the group a name say AlphaGrp and then have:

[loon1,loon2 etc.] join AlphaGrp
« Last Edit: 12 Mar 2005, 16:52:59 by THobson »

Offline 456820

  • Contributing Member
  • **
Re:new group
« Reply #9 on: 12 Mar 2005, 19:05:31 »
right i dont know why but it doesnt seem to be working the second group is definately alive and i switched the command to
[off1] join (grp1)
and i tried
[off1] join grp1
both didnt work it says
10 follow 10 when it activates
so i was wondering if anything was as effective like 10 follow 1 from bravo squad or something.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:new group
« Reply #10 on: 12 Mar 2005, 21:21:42 »
do you have:
grp1 = group this
in the init field of one of the units in the group you want to call grp1?
« Last Edit: 12 Mar 2005, 21:22:04 by THobson »

Offline 456820

  • Contributing Member
  • **
Re:new group
« Reply #11 on: 12 Mar 2005, 21:53:51 »
right i will walk you through what i have done
my player is called = off1
players original group is = grp2
the group he will move to is called = grp1

in a trigger i have is
condition = ((count(units group off1))<2)
on activation = [] exec "newgroup.sqs"

then in new group.sqs i have

Code: [Select]
~1
off1 sidechat "PAPABEAR THIS IS ALPHA WE I HAVE LOST ALL UNITS IN MY SQUAD. OVER."
~5
papabear sidechat "JOIN UP WITH BRAVO SQUAD AND CONTINUE WITH THE MISSION PLAN. OUT."
~1
[off1] join (grp1)
obj21=true

thats it

i know the trigger fires as the side text shows but instead of joining me to grp2 it says
10 follow 10

any ideas

Kyle Sarnik

  • Guest
Re:new group
« Reply #12 on: 12 Mar 2005, 22:00:01 »
10 follow 10 means he joined himself, which means your join command is wrong. Instead, try this:

[off1] join leader grp1


simple as that.

Offline 456820

  • Contributing Member
  • **
Re:new group
« Reply #13 on: 12 Mar 2005, 22:01:20 »
leader grp1 ? does that mean the leader of grp1 as i saif before he always die in combat
unless you know of a script wich can check wich unit is alive and is the leader
« Last Edit: 12 Mar 2005, 22:02:01 by 456820 »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:new group
« Reply #14 on: 12 Mar 2005, 23:08:46 »
If the leader of the group dies, the next in command takes over......so

leader grp1

Means.....whoever is leader at the time.


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