Home   Help Search Login Register  

Author Topic: Ughhh I have given up! :(  (Read 5283 times)

0 Members and 1 Guest are viewing this topic.

CptBravo

  • Guest
Ughhh I have given up! :(
« on: 30 Nov 2004, 20:34:37 »
Hey,

I know how to creat (respawn) AI controlled units/groups using "Spawnmanager2". What I could not find however is how to get these units to join existing groups?

So for example, I have a mission where there are 5 AI controlled squads, so everytime one of them drops below 7 soldiers, AI respawns 5 soldiers to join squad to replace casualties.

Any hints are greatly appreciated :)
« Last Edit: 06 Dec 2004, 17:12:51 by Captain Bravo »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Creat units with atwist
« Reply #1 on: 01 Dec 2004, 05:29:28 »
just use the join command
NameOfSpawnedUnit join group NameOfExistingUnitToJoin

CptBravo

  • Guest
Re:Creat units with atwist
« Reply #2 on: 02 Dec 2004, 02:45:28 »
The question is HOW do you name respawned units/groups?? SpawnManager2 does not give that option ?

Thanks

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Creat units with atwist
« Reply #3 on: 02 Dec 2004, 03:44:28 »
if they respawn at the same place everytime its easy, just put a trigger that can activate repeatedly and use thislist

"_x join group Someunit" foreach thislist

or you could run a loop to keep a list of units on the map, and then when it spawns new people subtract the old list from the new, and then you have a list of new people, and then use the above code. not very easy, but doable

CptBravo

  • Guest
Re:Creat units with atwist
« Reply #4 on: 02 Dec 2004, 17:35:54 »
Hey thanks for the reply.

I have tried the trig you mentioned  but kept getting error msg.

I have attached the respawn tamplate mission. If you could it illustrate how to name/group  spawned AI groups I'd be grateful :)  
« Last Edit: 02 Dec 2004, 17:36:17 by Captain Bravo »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Creat units with atwist
« Reply #5 on: 02 Dec 2004, 23:44:10 »
well i just looked at the respawn script in your mission and it makes them joined to the group already, so i don't know what you're trying to do exactly, but i think it is done for you by the script:
it uses the createunit command, which requires a group for the unit and it makes them in the group of the leader of the group you run it for. you shouldn't need anything.
BTW the script is called respawnsquad2.sqs

CptBravo

  • Guest
Re:Creat units with atwist
« Reply #6 on: 03 Dec 2004, 02:02:39 »
Hey TriggerHappy,

Maybe I should explain what I am trying to do:

I have a mission and I am using an AIR units attack ground script which needs group (infantry units) names that will be attacked by air units specified in a Trigger. So I need the ability to name each of the groups something I am not sure how to do? How do you "name" groups that are spawning?

Cheers.

 

CptBravo

  • Guest
Re:Any Guru Scripters out there??! :)
« Reply #7 on: 04 Dec 2004, 17:05:58 »
I'm a no Guru Scripter but I'm guessing this is a lot harder to do than I thought  ???

If anytone knows of a way to name groups spawned please do share.

Cheers.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Any Guru Scripters out there??! :)
« Reply #8 on: 04 Dec 2004, 21:39:59 »
Try placing a unit somewhere on your map, somewhere out of the way......a small island perhaps.

In his init field put:

GroupWun = group this; deletevehicle this

What this does is make this unit a group called GroupWun, then it deletes him.

The point being, the group now exists and you can spawn more units to join this group, because spawned units can only join an existing group otherwise they will not be created.

Something like:

"SoldierWB" createUnit [_pos, GroupWun]

I hope I read your problem correctly.   ::)


Planck
« Last Edit: 04 Dec 2004, 21:42:57 by Planck »
I know a little about a lot, and a lot about a little.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Any Guru Scripters out there??! :)
« Reply #9 on: 05 Dec 2004, 00:41:57 »
your basic idea is right, but it needs to be implemented differently
in each group leader's init field, put:
someName(different for each) = group this

and then call the script with those groupnames

CptBravo

  • Guest
Re:Any Guru Scripters out there??! :)
« Reply #10 on: 05 Dec 2004, 19:43:44 »
hey,


Basically what I am trying to is have the ability to name groups spawning.  :(

In the exmaple tample attached in above post, AI groups SPAWN with options of where, how many times, after how many soldiers in group killed and where to patrol and range. It called from a logic unit.
All I want to do is add one extra option .. name that spawing group.
If you could illustrate it in the tamplate example above I'd be very greatefull :)  
« Last Edit: 05 Dec 2004, 19:44:28 by Captain Bravo »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Any Guru Scripters out there??! :)
« Reply #11 on: 05 Dec 2004, 21:31:13 »
You cannot spawn a new group.

Units must be spawned to join an existing group.....AFAIK

If the group to spawn into is not specified the unit/units will not be created.


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

CptBravo

  • Guest
Re:Any Guru Scripters out there??! :)
« Reply #12 on: 05 Dec 2004, 21:52:34 »
Hey Planck,

Sounds good. Only thing is ..  I am not sure how.

If you could use the tamplate mission to give example that would be great!

As I said I like many .. clueless when it comes to scripting! :)

Thanks.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Any Guru Scripters out there??! :)
« Reply #13 on: 05 Dec 2004, 23:09:59 »
Hi!

Just correcting this (it's wrong):
Code: [Select]
"_x join group Someunit" foreach thislistto
Code: [Select]
"[_x] join group Someunit" foreach thislist
Bye!
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

CptBravo

  • Guest
Re:Ughhh I have given up! :(
« Reply #14 on: 06 Dec 2004, 17:14:33 »
Ughhh I have given up!  :(

if someone figures out a way to name the groups in example thats great if not then ohh well ..

Thanks to all those who responded.

Cheers.