OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Crowey on 28 Aug 2008, 17:54:13
-
Hi fella I need to know how to make an enemy group spawn using a trigger activation can anyone help???
-
Hey,Im there.
ehhh,you need help,right?
//first make a group name like GRPW1
grpw1=Creategroup west
//and then ready to spawn your units.
"SquadLeaderw" createUnit [getMarkerPos"wr1",,"w1=this;",1,"sergant"];
"Soldierwat" createUnit [getMarkerPos"wr1",grpW1,"",1,"Corporal"]
"SoldierwMG" createUnit [getMarkerPos"wr1",grpW1,"",1,"Corporal"]
exit
ok,your units are ready to battle.
now let me show you how to trigger them.
make a trigger in your editor map.
conditions,ehh what ever you like. eg Call radio alpha triggered.
on act ;
if your script named "spawn.sqs",save in your mission folder.
[]exec "spawn.sqs";
all right,try it yourself,if something wrong or any questions,send Pm plz. ;)
-
epsilonsun, please put example scripts inside code tags to make things clearer for us (edit your previous post to see how to do this). Thanks!
Not sure why you use createGroup twice and don't add the leader to the group you've made. Assume you meant to do something else.
-
Spooner,thank you for point out my wrongs.
I CTRL+C scripts & CTRL + V in TXT for edit,
but I copy a wrong one to the posts.
Unfortunately,I forgot check it before I send.
modify soon :D
ps. somethings if you dont use the variable of groups you dont have to add the leader I think.the high rank unit will be the leader.
usually I make lots group like this;
//first make a group name like GRPW1
grpw1=Creategroup west
"SquadLeaderw" createUnit [getMarkerPos"wr1",,"w1=this;",1,"sergant"];
"Soldierwat" createUnit [getMarkerPos"wr1",grpW1,"",1,"Corporal"]
"SoldierwMG" createUnit [getMarkerPos"wr1",grpW1,"",1,"Corporal"]
exit
//set the variable.
_a = w1;
_group = group _a;
when you need create group2 ,the leader named W2 just like
_a = w2;
_group = group _a;
If you want add a waypoint,
you can write,
_group addwaypoint[getmarkerpos"wp1",0]
[_group,1] setwaypointtype"Move";
the complete script;
//first make a group name like GRPW1
grpw1=Creategroup west
"SquadLeaderw" createUnit [getMarkerPos"wr1",,"w1=this;",1,"sergant"];
"Soldierwat" createUnit [getMarkerPos"wr1",grpW1,"",1,"Corporal"]
"SoldierwMG" createUnit [getMarkerPos"wr1",grpW1,"",1,"Corporal"]
//set the variable.
_a = w1;
_group = group _a;
//add waypoints
_group addwaypoint[getmarkerpos"wp1",0]
[_group,1] setwaypointtype"Move";
_group addwaypoint[getmarkerpos"wp21",0]
[_group,2] setwaypointtype"SAD";
exit
if you want create other groups,just change the name of teamleader and group name.also dont forget the variable name.
-
Also note that you are using SQF-style comments (// comment) in an SQS file, which should use semi-colons (; comment) for commenting.
-
ok boss.
its too late I have to go bed now.
good luck.