Home   Help Search Login Register  

Author Topic: Regarding "Create unit"  (Read 1445 times)

0 Members and 1 Guest are viewing this topic.

Offline Rytuklis

  • Members
  • *
Regarding "Create unit"
« 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..

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Regarding "Create unit"
« Reply #1 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).

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.
"When 900 years YOU reach, look as good you will not!"