OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Rytuklis on 08 May 2012, 14:58:59

Title: Regarding "Create unit"
Post by: Rytuklis on 08 May 2012, 14:58:59
So, what is tend to happen , is that my character is having a monologues, then the scene fades out and fades in (Already done)

What i want to do then, is to make a fade in scene with CDF fighting insurgents. Now i put a group of insurgents, and create Markers called s1, s2 and etc.

After camera's end in Cutscene script, i write

[] exec "init.sqs"

Init contains:

Quote
"CDF_Soldier" createUnit [getMarkerPos "s6", cdf,"", 1, "corporal"]
"CDF_Soldier" createUnit [getMarkerPos "s5", cdf,"", 1, "corporal"]
"CDF_Soldier" createUnit [getMarkerPos "s4", cdf,"", 1, "corporal"]
"CDF_Soldier" createUnit [getMarkerPos "s3", cdf,"", 1, "corporal"]
"CDF_Soldier" createUnit [getMarkerPos "s2", cdf,"", 1, "corporal"]
"CDF_Soldier" createUnit [getMarkerPos "ss1", cdf,"", 1, "corporal"]
"CDF_Soldier" createUnit [getMarkerPos "ss2", cdf,"", 1, "corporal"]
"CDF_Soldier" createUnit [getMarkerPos "ss3", cdf,"", 1, "corporal"]
"CDF_Soldier" createUnit [getMarkerPos "ss4", cdf,"", 1, "corporal"]
"CDF_Soldier" createUnit [getMarkerPos "ss5", cdf,"", 1, "corporal"]

Soldiers do not spawn..
Title: Re: Regarding "Create unit"
Post by: Wolfrug on 08 May 2012, 15:53:34
Is it actually important that they're corporals and have a skill of 1? If not, how about using the truncated form:

"CDF_Soldier" createUnit [getMarkerPos "s1", cdf]

Also, are you sure you've created a group named 'cdf' before this? The group needs to exist as well for this to work (you can do this with createGroup (http://www.ofpec.com/COMREF/index.php?action=details&id=445&game=All)).

the init.sqs script actually runs at init, whether you want it to or not - so it in fact runs BEFORE your camera script! Just name the script something else - spawnsoldiers.sqs or whatever.

Hopefully that solves it.

Wolfrug out.