Jump to content
Sign in to follow this  
Jackael

Unit spawning help / group help

Recommended Posts

I would like to know the best way(s) to spawn individual units. I have been trying to figure it out to no avail.

I need to know how to spawn a unit at a specific location. I also don't really know how to find the coordinates for a specific point, and I think I would need that.

Also, I want them to not be able to radio each other. I'm using this for a stealth map, and if someone in a group dies then the rest of the group is alerted. I don't want this. Is there any way to silence radios so they don't know? Or maybe can I have them independent from a group when they spawn or change it that way shortly after?

Thanks,

J

Edit: Also on a side-note:

I'd like to know if theres any way to PREVENT the detonation of a satchel charge. I want it so you can't detonate the charges unless you're in a certain location. Basically like just remove the option to from your list of options when you push the mouse wheel but make it available when you're in a certain location. Also with the possibilty of only allowing you to SET them at a certain location? Help here would be really appreciated.

Edit again:

I think it would be better for the units to not be in teh same group because I want them to just stand around in one spot unaware. If they're in a group they're going to move around and crap.

Edited by Jackael

Share this post


Link to post
Share on other sites

I was in the same position not long ago and asked the same thing.

Have a look here. The info I found most useful, as I hadn't got a clue, was post 5. This is just for the spawning question though. :) And post 13 contains a crucial bit of info if you are spawning enemy units on a map with no other units on it from that side.

Share this post


Link to post
Share on other sites

Okay, so if I'm getting this correctly...

Make a file called "unit.sqf" (I read stuff on this part elsewhere),

copy/paste that code into the file and edit to be the proper unit and what not, then use the execute code to execute it in a trigger?

The .sqf file would have to be in the directory that the map file is in I'm guessing? Or no.

Also, on to the next part of the spawn, I want them to be individual from any groups because if they're in a group they're going to run over into formation. I tried using commandStop but that didn't work, I think the AI leader just ordered them back into formation. I have all other units on the map set independently so it's more stealth style where they are all standing in the exact spot I want them, and they also don't know that their friendlies are dying. So on to the point of this...

Is there a way to get them in their own group? I did try one way, which is to create a new Center, then an empty Group, then add a single unit to that group before but if that would work I didn't do it correctly.

Also about the script for spawning... I was reading up on briefings and someone said that you won't be able to see the briefing in the Preview, you had to export it as a mission. Is this the same for other scripts? Or just briefings?

Thanks,

J

Share this post


Link to post
Share on other sites

Yes you can execute with a trigger or waypoint or unit init line as well (also the init.sqf and decription.EXT but don't worry about those yet if you don't know what they do, save those for later ;) )

Yes save the sqf file in my documents\arma2\ missions (or MPmissions if your editing for multiplayer) \ folder with your mission name\which should have a mission.sqm file in it.

When spawning a unit by script you must create a group first even if there is only one unit in the group so the code would look something like this

 Grp1=createGroup WEST;

_Cpl1 = Grp1 createUnit ["USMC_Soldier_TL", [(getMarkerPos "m1") select 0,(getMarkerPos "m1") select 1,0], [], 0, "form"];

Grp2=createGroup WEST;

_Cpl2 = Grp2 createUnit ["USMC_Soldier_TL", [(getMarkerPos "m2") select 0,(getMarkerPos "m2") select 1,0], [], 0, "form"]

and so on for each unit.

This is not correct, some people say this but it is not correct, you can see the Briefing from the preview, at least from the multiplayer editor (I don't use the SP editor so wouldn't Know) You have to load the game as from the main menu screen, to load an init.sqf (if you want to load a newly saved init.sqf. for example) The Briefing.sqf is called from the init.sqf (the init sqf is the first to load) you can therefore save a briefing.sqf in the editor screen and go straight to preview and see your changes. This is the same with your other scripts as well.

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  

×