Home   Help Search Login Register  

Author Topic: Clonespawn  (Read 1202 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
Clonespawn
« on: 11 Oct 2004, 05:25:03 »
Hi,

I'm working on a WW2 SP mission and I have a problem with a spawn script.
You have to engage a German outpost with machinegun bunker and that guy fights like the best  :)

There are three full US squads to do the job, but that's far too less to complete the mission. The resistance too hard. Not that there are hunderds of Germans, but they are placed very well.  

I don't want to change that, but I can't place more troops because my PC is not fast enough. (The mission already contains some intensive scripts )

So I'm looking for a SP spawnscript that creates a attackwaves.
It should clone (unitclass, rank, skill and weapon loadout) the unit that got killed.
I didn't have anything to script to give the new created unit the correct weapon loadout, strange...anyway

I've wrote such a script but I have an enoying problem.
When the leader of a group got killed the next in rank become the new leader, that's normal...
But when the leader is spawned again at the spawnplace, leadership changes again, because the rank of the original leader is higher than the leader at that moment.
He will give the others the order to return back in formation and the attack stops.
I want continuous attackwaves (maybe with a counter) with always the same number of troops on the map to reduce lag.
Corpses will be deleted with a simple gravediggers script


Are there any scripts made like this?

Here's my try, but like I said there's a problem with it...

[name of the group, spawnplace, name of the gravedigger] exec "clonespawn.sqs"

1th script

Code: [Select]
;;clonespawn.sqs

_grp = _this select 0
_clonelogic = _this select 1
_gravedigger = _this select 2


_i = 0
#execute
_unit = units _grp select _i
?_unit != player : [_unit,_clonelogic,_gravedigger] exec "cloneunit.sqs"
_i = _i + 1
?_i < count units _grp : goto "execute"
exit

2th script

Code: [Select]
;cloneunit.sqs

_unit = _this select 0
_clonelogic = _this select 1
_Digger = _this select 2

_grp = group _unit
_type = Typeof _unit
_skill = skill _unit

#SHOT
?!alive _unit :_unit = _body;goto "WAIT"
~1
goto "SHOT"

#WAIT
~10
_digger action ["hidebody",_body]
~3
deletevehicle _body
~2

#CLONE
_newunit = (_type) createunit [_clonelogic,_grp," ",_skill]  
~5
@!isnull _newunit
~1
_newunit = _unit
~1
goto "SHOT"
« Last Edit: 11 Oct 2004, 05:38:37 by Blanco »
Search or search or search before you ask.

Cpt. Red Nain

  • Guest
Re:Clonespawn
« Reply #1 on: 11 Oct 2004, 07:39:14 »
Errm, i'm not sure (i'm no specialist...), but isn't the unit respawn a special feature in MP missions, not available in SP missions?  ???

I hope i'm wrong  ;D

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Clonespawn
« Reply #2 on: 11 Oct 2004, 11:30:38 »
Respawn is indeed a feature of MP only, but what Blanco is talking about is spawning AI units.    As one dies, another is created.    This is perfectly possible in both MP and SP.  The nomenclature is slightly confusing it's true.

Anyway, I can't help with anything except the weapons problem.  Example:

"SoldierWB" createUnit [getMarkerPos "marker_1", groupAlpha, "loon1 = this; this addweapon {binocular}", 0.6, "corporal"]

The addweapon bit is the unit's init line.   You can use it just like an ordinary init line .... well I'm sure there is the odd thing that doesn't work because OFP is like that, but you know what I mean.



« Last Edit: 11 Oct 2004, 11:31:13 by macguba »
Plenty of reviewed ArmA missions for you to play

Cpt. Red Nain

  • Guest
Re:Clonespawn
« Reply #3 on: 11 Oct 2004, 15:24:12 »
Taking note of that one!!  8)
Could prove useful (one day, maybe, in a galaxy far far away  :D)

Thx Macguba

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Clonespawn
« Reply #4 on: 11 Oct 2004, 17:48:37 »
i don't have much time m8, but you could prevent the leader from doing this by making the scripts only execute when the whole group is dead. You can do this either in the script or by using a trigger. to make the condition line for a trigger, use this:

Code: [Select]
"alive _x" count thislist <= 0or
Code: [Select]
@"alive _x" units loon_1 <= 0 for the script.
then after this is true the script continues.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Blanco

  • Former Staff
  • ****
Re:Clonespawn
« Reply #5 on: 12 Oct 2004, 04:22:32 »
Thank you all for your comments.


@Macguba

The weapon loadout is not a problem and I was suprised about that  :)
When I createunit a Invasion1944 US grenadier (don't the classname atm) , he will be created with the correct weapons and magazines.
 
@Tyger

Spawning them only when the whole group dies is a solution and it was my first idea, but i won't create continuous attackwaves.
There are long gaps between each wave.


There are 3 US squads and each group can be cloned (spawned) X time (depending on the difficulty level) so it looks like there are hunderds of them. (but not at the same time offcourse)
So when the leader dies, you will be under command of a new created leader and all the alive AI units will gather at the spawnpoint far away from the action.
So those who are in full combat will return back in  formation.  :(
No allowfleeing 0 doesn't help, they are not scared , they are just following orders.

I have to find a way to check who's in combat and make one of them leader but there is no command to change ranks...
hmmm..
But maybe with some joining and rejoining...  ::)


**edit**
w8 a minute... I see no problem when you play the leader, when all your men die, fresh cannonfodder wil join... ;D








 


 
Search or search or search before you ask.

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Clonespawn
« Reply #6 on: 12 Oct 2004, 14:19:59 »
Try my patrol spawn manager 2 under units / groups.

Offline nEO iNC

  • Contributing Member
  • **
Re:Clonespawn
« Reply #7 on: 14 Oct 2004, 14:00:11 »
Hey Blanco... I wrote a bunch of scripts a while back for very similar reasons  to do all sorts of things... The most basic script spawns a squad which then attacks a target unit of your choice. You also get to specify the squad composition, within limits.

You could use a repeating trigger looking at units/side to control how many of the spawned groups/units are around at any one time.

eg. count (list eastpres) <= 10 : spawn another squad...

Obviously the above syntax isn't valid, but you get the idea..?

Take a look in the editors depot under scripts->waypoints & respawning...

You're looking for: Utility Spawn Scripts v3.40

nEO OUT

Offline Blanco

  • Former Staff
  • ****
Re:Clonespawn
« Reply #8 on: 15 Oct 2004, 03:40:56 »
thx guys ,
I 've downloaded your Utilityspawn scripts Neo, but when I tried it in the editor I've noticed I need two addons... :-\


- Bas_weap
(ok, thats one I know, np  :) )

- wglvit_bmd3
(Can't find that one. It's not from Vit's APCpack? ???)






Search or search or search before you ask.

Offline nEO iNC

  • Contributing Member
  • **
Re:Clonespawn
« Reply #9 on: 15 Oct 2004, 14:29:13 »
Hey Blanco, I take it you're trying out the demos..? Sorry that's in there, I wrote the demos late one night so I could get the scripts out the following day. What I forgot was I had the WarGames mod (WGL) installed, so I think that's where the missing add-on issue comes from.

I wouldn't bother too much about the demos, they are pretty poor. However, if you really want to look at them I'd recommend the WGL pack anyway. It's one of the best realism add-ons going for OFP. I think the current version is v4.12

If you need any help with the syntax of the scripts proper, let me know and I'll do what I can. I'll be releasing newer versions of the scripts soon (v3.70), that have more functionality. Hopefully I'll also have done a better job writing the demos.  ;)

nEO