OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: The Negotiator on 17 Sep 2005, 22:40:49

Title: MP Respawn Script
Post by: The Negotiator on 17 Sep 2005, 22:40:49
Quote
;start with
;[location of spawn,groupname,skill from 0-1,destination where group should move after creation] exec "AIspawn.sqs"


?!(local Server): exit


_location = _this select 0
_Group = _this select 1
_skill = _this select 2
_destination = _this select 3


;creating Infantry soldiers
;you can add more but use ~ delays and max. 12 units per group

~0.5
"OfficerENight" CreateUnit [getpos _location, _group,"this allowfleeing 0;",_skill,"PRIVATE"]
~0.1
"SoldierEB" CreateUnit [getpos _location,_group,"",_skill,"PRIVATE"]
~0.1
"SoldierEB" CreateUnit [getpos _location,_group,"",_skill,"PRIVATE"]
~0.1
"SoldierEMedic" CreateUnit [getpos _location,_group,"",_skill,"PRIVATE"]
~0.1
"SoldierEG" CreateUnit [getpos _location,_group,"",_skill,"PRIVATE"]
~0.1
"SoldierEMG" CreateUnit [getpos _location,_group,"",_skill,"PRIVATE"]
~0.1
"SoldierELAW" CreateUnit [getpos _location,_group,"",_skill,"PRIVATE"]

;if you wish that the group moves to a location after creation
#Moving
~1
_group setspeedmode "normal"
_group setbehaviour "aware"
~1
_Group move (getpos _destination)


Exit

I need help the Ai ant spawning.. i dont no if i need to add a dummy group or something any help would be great ..

thx matt rochelle
Title: Re:MP Respawn Script
Post by: Kyle Sarnik on 18 Sep 2005, 02:30:11
To answer your question, yes. You can only createunit an AI into an EXISTING group (one that has or did have at least 1 member).
Title: Re:MP Respawn Script
Post by: Terox on 18 Sep 2005, 12:17:26
to reduce lag during your unit creation, make sure your mission had these class of units at the start of the mission (even if you delete them straight away)