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
;;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
;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"