Jump to content
Sign in to follow this  
bascule42

BASIC spawn script. For a complete idiot. Me. Searched...

Recommended Posts

Here's my scenario first!

I get a merlin helo to land, my paras board, the merlin flies to a waypoint, drops us off and then we seek and destroy two waypoints. On route to the second waypoint, I want to enter a triggerzone and a spawn some enemy AI into the game. This is the point of the mission. Just go in look around for opfor then kill them if you find them, get back to base. Simple as that. I have the insertion fine, the debus fine, the seek and destory fine, this GODDAMN SPAWNING IS NOOOOT working. I've tried sifting the threads in the FAQ about spawning groups etc and looking on YOUTUBE and nothing is helping.

Right I've about had it with all this information on spawning, I've tried for the past two days to find some decent , easily explained step by step way of

1. setting up the sqf files in the sqf editor????? NOTHING AROUND!

2. when you enter a triggerzone, a group of ENEMY AI spawn in. NOT BLUFOR, OPFOR, I've seen too many things related but not what I want. (set of videos on youtube, using BIS functions which don't work. HE does what I want but the code doesn't work.

)

3. executing all the above. Help before I uninstall this game!

If you are willing to help a frustrated, anxious, patience loosing Noob like me, I'd be ever so grateful that you have taken this weight of my shoulders. I'm almost about to uninstall the game AGAIN! I've never jumped through hoops this much for a game before.

cheers

Share this post


Link to post
Share on other sites

Problem with that video as explained in the comments - if there are no pre-existing members of that side - they can't spawn, you need:

http://community.bistudio.com/wiki/createCenter

or place AI with 0% probabilty of presence (slider near bottom of AI GUI in editor) on map.

http://forums.bistudio.com/showthread.php?123093-How-to-properly-create-a-Center

Share this post


Link to post
Share on other sites
Problem with that video as explained in the comments - if there are no pre-existing members of that side - they can't spawn, you need:

http://community.bistudio.com/wiki/createCenter

or place AI with 0% probabilty of presence (slider near bottom of AI GUI in editor) on map.

http://forums.bistudio.com/showthread.php?123093-How-to-properly-create-a-Center

LMAO! is that all it was! I can't believe that, it bloody worked. Thanks a bundle for that dude!

heres another question though, if I wanted to spawn it with different units, How do I apply that in the code he has written, is that need to have scripting to execute the commands? after sifting through the stupendous amount of threads and wiki topics, and a part of that set of tuts on Youtube, am I right in assuming that I need to start to think about the cfggroups??

Thanks once again.

Share this post


Link to post
Share on other sites

thats great! but, I've seen those pages tooo many times, you are not actually answering my question fully. I give up on this place seriously! I mean you ever tried learning astrophysics? if not look here: http://tutorial.math.lamar.edu/Classes/CalcI/CalcI.aspx

Share this post


Link to post
Share on other sites

Sorry forget it's not obvious for beginners:

You need the functions module (F7) on the map for all this

groupName = [getMarkerPos "tankSpawn", side player, (configFile >> "CfgGroups" >> "West" >> "BIS_US" >> "Armored" >> "US_MGSPlatoon")] call BIS_fnc_spawnGroup

You need to substitute things in there eg other examples:

groupName = [(getPosATL objectName), RESISTANCE, (configFile >> "CfgGroups" >> "Guerrila" >> "BIS_TK_GUE" >> "Infantry" >> "TK_GUE_Patrol")] call BIS_fnc_spawnGroup;

groupName = [(getPosATL player), EAST, (configFile >> "CfgGroups" >> "EAST" >> "BIS_TK_INS" >> "Infantry" >> "TK_INS_Patrol")] call BIS_fnc_spawnGroup;

_grp2 = [(waypointPosition [_grp2, 1]), WEST, (configFile >> "CfgGroups" >> "WEST" >> "BIS_US">> "Air" >> "US_AH64DFlight")] call BIS_fnc_spawnGroup;

There are no easy answers, lots of trial and error, much research and reading to do.

Share this post


Link to post
Share on other sites
Sorry forget it's not obvious for beginners:

You need the functions module (F7) on the map for all this

groupName = [getMarkerPos "tankSpawn", side player, (configFile >> "CfgGroups" >> "West" >> "BIS_US" >> "Armored" >> "US_MGSPlatoon")] call BIS_fnc_spawnGroup

You need to substitute things in there eg other examples:

groupName = [(getPosATL objectName), RESISTANCE, (configFile >> "CfgGroups" >> "Guerrila" >> "BIS_TK_GUE" >> "Infantry" >> "TK_GUE_Patrol")] call BIS_fnc_spawnGroup;

groupName = [(getPosATL player), EAST, (configFile >> "CfgGroups" >> "EAST" >> "BIS_TK_INS" >> "Infantry" >> "TK_INS_Patrol")] call BIS_fnc_spawnGroup;

_grp2 = [(waypointPosition [_grp2, 1]), WEST, (configFile >> "CfgGroups" >> "WEST" >> "BIS_US">> "Air" >> "US_AH64DFlight")] call BIS_fnc_spawnGroup;

There are no easy answers, lots of trial and error, much research and reading to do.

Ok, but do these types of things have to go into .sqf files or can they go in the onAct fields?? I've tried using .sqf files and everytime I enter the trigger it comes back that the script is not found. I've loaded the mission correctly, named file trigger.sqf, called it using

_null = [] execVM "trigger.sqf";

and it returns file cannot be found???? tried this so many times and nothing happens. Hence I am resorting to placing things in the onAct field instead. At the moment thanks to your first bit of advice I have a group of russian soldiers spawning, but I would ideally prefer to have militia instead or maybe some insurgent locals etc.

Share this post


Link to post
Share on other sites

Have you turned 'Hide known file extensions' off? You may be saving it as 'trigger.sqf.txt' but windows will hide .txt by default. The option can be 'Tools->Folder Options->View'.

Share this post


Link to post
Share on other sites
Have you turned 'Hide known file extensions' off? You may be saving it as 'trigger.sqf.txt' but windows will hide .txt by default. The option can be 'Tools->Folder Options->View'.

Did that, I didn't get the error message after that was sorted but no AI was appearing at the new spawnpoint I set up.

Applied the code in the onAct field as another solution. Still nothing. I used the commands above in my .sqf file called it using

_null = [spawn2] execVM "triggerspawn.sqf";

Result: Nothing. (I even tried taking out spawn2 and used just the closed hard brackets)

took that code out of the onAct field for the trigger and pasted the same command fully into the same field.

Result: Nothing.

If I can get this down all I would need to do in various places is place a trigger, marker for spawning, set up the different .sqf's to call and I'd be able to have multiple locations I can attack if I went through a specific trigger.

Simple as that really, might be a bit simplistic for your advanced coder etc, but I'm no way near anything like that. I've only just figured out how to set up an sqf file, so that says something.

It's ok pasting a load of code in the thread for me to look at but if there is no follow on from that then I'm stuck. I'm not expecting easy answers to anything just a little bit more descriptive tuition on it. Post 6 in this thread is prime example for what I am looking for in terms

helping me out with this: http://forums.bistudio.com/showthread.php?125906-ARMA-2-Realistic-Paradrop.

I need step by step instructions as would any noob who wants to do a simple basic spawn command for any type of unit they want. Is that not too much to ask. As you can see this issue is digging in me like virus and I'm beginning to find it very very frustrating. If the guy in the youtube link that I had posted had of given clearer instructions to what was actually going on and not missed anything out, maybe things would be differnet, but here I am jumping through frigging hoops just for a simple spawn command.

Share this post


Link to post
Share on other sites

I'm going to say, "Don't start from here". Start here:

http://www.armaholic.com/page.php?id=13109

http://www.armaholic.com/page.php?id=4847

http://www.armaholic.com/forums.php?m=posts&q=6751

http://www.kylania.com/ex/

http://tactical.nekromantix.com/wiki/doku.php?id=arma2

If you want to get a true understanding of mission editing, read all that, before you start. If it feels like a small college degree, thats because it is! Some of us have been editing for 5 years years or more and still have much to learn.

Share this post


Link to post
Share on other sites
I'm going to say, "Don't start from here". Start here:

http://www.armaholic.com/page.php?id=13109

http://www.armaholic.com/page.php?id=4847

http://www.armaholic.com/forums.php?m=posts&q=6751

http://www.kylania.com/ex/

http://tactical.nekromantix.com/wiki/doku.php?id=arma2

If you want to get a true understanding of mission editing, read all that, before you start. If it feels like a small college degree, thats because it is! Some of us have been editing for 5 years years or more and still have much to learn.

Its ok! I'm not sure whether I made the mistake of asking my question or you made the mistake or attempting to answer it. Which I still haven't had. If some of you have been editing for five years or more, then surely you can oblige by giving a simple explanantion to one of the very first things that goes in to a mission. I have those two manuals above, I also have those links bar the last one you sent me. My bookmarks for Arma is actually BIGGER than my bookmark main menu. When I say I have spent countless hours a sifting through the information trying to find something that can remotely help me, I mean it. I cannot beleive that such a massive game with such a massive community and wealth of knowledge, that NO ONE has even bothered to give a detailed description of "HOW TO SPAWN A UNIT". I'm not on about vehicles, ammo crates or respawning. I am on about a unit or group of units from Differnet factions.

You know what fuck it!

Share this post


Link to post
Share on other sites

...I dont even know if a solution has been found... but uh, here is your solution.

groupName = [getMarkerPos "spawnPoint1", EAST, 1] call BIS_fnc_spawnGroup;

Here is how it works so that you can edit it to your liking:

Things you can adjust, I have in red.

groupName = [getMarkerPos "spawnPoint1", EAST, 1] call BIS_fnc_spawnGroup;

Here is what they mean:

"spawnPoint1" is what ever the name of the marker is, where you want a unit to spawn.

"EAST" is the faction they are. West = US Army, EAST = Russia, etc.

"1" is the number that spawns on that marker. 1 = 1 unit. 10 = 10 units. They are dynamic, so they wont all be the same class either.

Once you have it customized, throw it in the "OnAct" of a trigger, and when the trigger is activated, your group/unit will spawn on that marker you told them to.

SOLVED. Enjoy.

Now, if we aren't even on this subject anymore, I am sorry. There are so many walls of text I do not wish to read 4 pages worth of... so yeah.

Share this post


Link to post
Share on other sites
...I dont even know if a solution has been found... but uh, here is your solution.

groupName = [getMarkerPos "spawnPoint1", EAST, 1] call BIS_fnc_spawnGroup;

Here is how it works so that you can edit it to your liking:

Things you can adjust, I have in red.

groupName = [getMarkerPos "spawnPoint1", EAST, 1] call BIS_fnc_spawnGroup;

Here is what they mean:

"spawnPoint1" is what ever the name of the marker is, where you want a unit to spawn.

"EAST" is the faction they are. West = US Army, EAST = Russia, etc.

"1" is the number that spawns on that marker. 1 = 1 unit. 10 = 10 units. They are dynamic, so they wont all be the same class either.

Once you have it customized, throw it in the "OnAct" of a trigger, and when the trigger is activated, your group/unit will spawn on that marker you told them to.

SOLVED. Enjoy.

Now, if we aren't even on this subject anymore, I am sorry. There are so many walls of text I do not wish to read 4 pages worth of... so yeah.

Scroll up and look at post 32, my first sentence! I'm still waitng for an answer to that question?

I already knew what you have tried to explain. All that does is spawn Russian units! I WANT TO SPAWN MILITIA OR INSURGENTS. I have the config text I need to spawn them but I don't know if it goes into the onAct field, into a .sqf file and called from there (if so How? what I have isn't working), or do I shove this whole bloody game up my ass and hope and pray I crap it into the ocean to be lost forever.

I KNOW THE BASICS OF THE EDITOR! I had arma2 free for a while and played soo much with just plonking units on the map I got bored with it, plus that slowed my game down too much, I know the basics of the onAct field, I can get helos to fly at certain heights if I want, I can set timers in on waypoints by using the waypointUI, all I want to do is change the bloody faction from russian units. So! sorry, but NOT SOLVED!

Share this post


Link to post
Share on other sites
Scroll up and look at post 32, my first sentence! I'm still waitng for an answer to that question?

I already knew what you have tried to explain. All that does is spawn Russian units! I WANT TO SPAWN MILITIA OR INSURGENTS. I have the config text I need to spawn them but I don't know if it goes into the onAct field, into a .sqf file and called from there (if so How? what I have isn't working), or do I shove this whole bloody game up my ass and hope and pray I crap it into the ocean to be lost forever.

I KNOW THE BASICS OF THE EDITOR! I had arma2 free for a while and played soo much with just plonking units on the map I got bored with it, plus that slowed my game down too much, I know the basics of the onAct field, I can get helos to fly at certain heights if I want, I can set timers in on waypoints by using the waypointUI, all I want to do is change the bloody faction from russian units. So! sorry, but NOT SOLVED!

You already know the text to spawn them, put them in a trigger or a script, and a trigger that fires the script..

you should try trial and error before you post. You would have found your answer without posting that last post that I am replying too.

Here is a list of Sides & Group names to spawn;

http://community.bistudio.com/wiki/Ambient_Combat_Manager_-_Group_types

Share this post


Link to post
Share on other sites
Scroll up and look at post 32, my first sentence! I'm still waitng for an answer to that question?

I WANT TO SPAWN MILITIA OR INSURGENTS. I have the config text I need to spawn them but I don't know if it goes into the onAct field, into a .sqf file and called from there (if so How? what I have isn't working)

maybe you should read my posts fully first before you condescend the fact that you think I haven't tried trial and error. I have tried as many trial and errors as I can think of in my abilities. look at what I was trying to say I wanted to do!

Share this post


Link to post
Share on other sites
maybe you should read my posts fully first before you condescend the fact that you think I haven't tried trial and error. I have tried as many trial and errors as I can think of in my abilities. look at what I was trying to say I wanted to do!

What i wrote..

You already know the text to spawn them, put them in a trigger or a script, and a trigger that fires the script..

Put it into a Trigger or a script, and call it from the trigger....

You said you know the config text. Nor did you say or write what you have and why it's not working.

Here is a example from a WIP mission I am doing.

[getMarkerPos "tankSpawn", side player, (configFile >> "CfgGroups" >> "East" >> "BIS_TK_INS" >> "Infantry" >> "TK_INS_Group")] call BIS_fnc_spawnGroup;

Make a marker, change to your liking and than when a player goes into the trigger a group will spawn @ the marker. Spawns TK militia group.

Wiki also explains this;

http://community.bistudio.com/wiki/BIS_fnc_spawnGroup

Share this post


Link to post
Share on other sites

1: place a Blufor unit on the map. This can be your player unit.

2: place an Opfor unit on the map and set his probablility of presence to zero.

3: place a functions module on the map and not sync or group it to anything.

4: Place a triggerzone on the map. Adjust the size of it however you please.

5:place a marker on the map and name it however you please. ie: spawn, spawnpoint, enemyunits ..... whatever you like!

6:now place this code in the onAct field of the trigger.

[getMarkerPos "spawn", EAST (configFile >> "CfgGroups" >> "[color="#FF0000"]East[/color]" >> "[color="#FF0000"]BIS_TK_INS[/color]" >> "[color="#FF0000"]Infantry[/color]" >> "[color="#FF0000"]TK_INS_Group[/color]")] call BIS_fnc_spawnGroup;

the parts in red you can adjust to suit your needs. This code will spawn a small group of units in that triggerzone you place the code into. You can have multiple triggers on the map with this code and it will spawn units in once you enter them.

I hope this gives you some enjoyment. After I have had fun playing around with it after a full week of "TRIAL AND ERROR":rolleyes: and figuring this out for "MYSEEEELF". I have now managed to be able to give the rest of the noobs a small tutorial for spawning units. Waheey! I say again, considering the size and scope of this game I haven't seen anything as basic and as explanatory to do with basic unit spawning.

here is a list of links for units, groups and vehicles:

http://community.bistudio.com/wiki/ArmA_2_OA:_Infantry

http://community.bistudio.com/wiki/CfgGroups

http://community.bistudio.com/wiki/ArmA_2:_CfgVehicles#top (Arma2)

http://community.bistudio.com/wiki/ArmA_2_OA:_Vehicles (Arma OA)

you can also watch these videos for a bit more information on what the different parts of the syntax does. There are 4 or 5 tutorials, sadly some info is missing which is why I ended up here. But hopefully reading this post you won't have any trouble.

I have one last thing to say btw, I have no years of experience in coding and this took me less than 10 minutes to type out. considering the majority of the community has a lot more years on me and of coding and playing Arma, I'm really surprised at the lack lustre attitude towards giving information out in a simple and basic informative way. If someone says they are a noob, is it not too much to ask for a simple and basic step by step guide to help them out like I have had to do myself to get my point across? OR do you all expect them to pick up the information straight away without even a hint or where to start?

NUFF said. I'm done here now and I've worked it out.

Edited by SpookyGnu

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×