Home   Help Search Login Register  

Author Topic: Trigger + Marker = ai Spawn  (Read 1385 times)

0 Members and 1 Guest are viewing this topic.

Offline Crowey

  • Members
  • *
Trigger + Marker = ai Spawn
« 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???

Offline epsilonsun

  • Members
  • *
Re: Trigger + Marker = ai Spawn
« Reply #1 on: 30 Aug 2008, 10:49:33 »
Hey,Im there.

ehhh,you need help,right?

Code: (spawn.sqs) [Select]
//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. ;)
« Last Edit: 30 Aug 2008, 17:22:24 by epsilonsun »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Trigger + Marker = ai Spawn
« Reply #2 on: 30 Aug 2008, 13:18:22 »
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.
« Last Edit: 30 Aug 2008, 13:28:37 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline epsilonsun

  • Members
  • *
Re: Trigger + Marker = ai Spawn
« Reply #3 on: 30 Aug 2008, 17:18:20 »
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;

Code: (spawn.sqs) [Select]

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

Code: (spawn.sqs) [Select]

//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.
« Last Edit: 30 Aug 2008, 17:41:49 by epsilonsun »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Trigger + Marker = ai Spawn
« Reply #4 on: 30 Aug 2008, 17:24:14 »
Also note that you are using SQF-style comments (// comment) in an SQS file, which should use semi-colons (; comment) for commenting.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline epsilonsun

  • Members
  • *
Re: Trigger + Marker = ai Spawn
« Reply #5 on: 30 Aug 2008, 17:43:12 »
ok boss.

its too late I have to go bed now.

good luck.