Jump to content
Sign in to follow this  

Recommended Posts

Hey all i was wondering is there a way to populate towns randomly with civs and enemies so ill have no idea whats where. Ive been trying to figure this out for a few days but having a hard time :confused: Would somebody be kind enough to give me an example or point me to where one is, ive searched around and couldnt find any examples. Thanks in advanced.

Deg

Edited by Deg

Share this post


Link to post
Share on other sites

sync the "Ambient combat module" to your player! same with the "ambient civs" and animals! :)

Share this post


Link to post
Share on other sites
sync the "Ambient combat module" to your player! same with the "ambient civs" and animals! :)

Thanks for the reply but wont that spawn enemies around the player in a given radius and not in a given town ? All im trying to do is have the enemies spawn at different towns randomly on the map, so if i head towards a town ill have no clue if there are enemies there or not unless i scope out the town first. I mean i could put down enemies in each town and change thier probability of presence but that kind of takes away the exicitement of not knowing.

Share this post


Link to post
Share on other sites

haha you could try using random triggers to spawn enemy?

Try using the domi2 maps also! they randomly spawn towns full of enemy.

Another one is to try out UPSMON5 its a good scripting pack for this kind of stuff :)

Share this post


Link to post
Share on other sites

Thanks ill look into those, im pretty confused with all this scripting stuff and where to put scripts into your mission folder, i mean i know how to put scripts into the init line of units and stuff in the editor, but thats about as far as it goes lol.

Share this post


Link to post
Share on other sites

Dac works pretty well. Mix it with some ACM and it makes for a jam up mission so long as your PC can handle it.

Share this post


Link to post
Share on other sites
Thanks ill look into those, im pretty confused with all this scripting stuff and where to put scripts into your mission folder, i mean i know how to put scripts into the init line of units and stuff in the editor, but thats about as far as it goes lol.

Check out this over at ArmaHolic then: http://www.armaholic.com/forums.php?m=posts&q=6751 its a thread full of info on mission making! :)

Share this post


Link to post
Share on other sites

Thanks guys :) im just trying to make a post apocalypse gather and salvage type mission with small groups of enemies and such not to fast paced and kind of free roam.

Share this post


Link to post
Share on other sites

Also, have you thought of using markers?

In case you dont know, if you group a unit (groupleader) to one or more markers, then he and his group will either spawn at the original location or at the position of one of the markers he is grouped with (random chance).

That way you can make a number of enemy groups. Put an empty marker on each town, and group the teamleaders to the markers. Then you have no idea in which town they ended up. You can still play with the propability so that you also dont know how many enemies there will be.

Just a thought, that does not involve running a specifik mod or script.

EDIT: BTW, it can be troublesome to group markers to units, as the markers are not visible in the group menu (F2). To make it easier, start by placing the markers close to the units. Hit (F6) and mouse over a marker, then hit (F2) and drag/group to the unit. Repeat with a new marker. When all markers are grouped, hit (F6) and move them to the towns, or whereever you want them.

I'm just saying this so you dont set it all up first, and struggle with the grouping afterwards :)

Edited by Nielsen

Share this post


Link to post
Share on other sites
Also, have you thought of using markers?

In case you dont know, if you group a unit (groupleader) to one or more markers, then he and his group will either spawn at the original location or at the position of one of the markers he is grouped with (random chance).

That way you can make a number of enemy groups. Put an empty marker on each town, and group the teamleaders to the markers. Then you have no idea in which town they ended up. You can still play with the propability so that you also dont know how many enemies there will be.

Just a thought, that does not involve running a specifik mod or script.

EDIT: BTW, it can be troublesome to group markers to units, as the markers are not visible in the group menu (F2). To make it easier, start by placing the markers close to the units. Hit (F6) and mouse over a marker, then hit (F2) and drag/group to the unit. Repeat with a new marker. When all markers are grouped, hit (F6) and move them to the towns, or whereever you want them.

I'm just saying this so you dont set it all up first, and struggle with the grouping afterwards :)

Thanks, yes ive thought about this but how would i set up waypoints or get them to patrol the town when they spawn there, i was looking at the urban patrol script but im not sure where to copy it to :o

Share this post


Link to post
Share on other sites

If i downloaded say the urban patrol script or mandos heli-route, where do i need to put those files to get them to work, sorry for the newb question :o i had seen a post a couple days ago about such a thing something about a txt file in your missions folder :confused:, im still looking but i cant seem to find the post. could sombody give me an explanation or a point in the right direction.:)

Share this post


Link to post
Share on other sites

Allright...

First the use of UPSMON

The UPSMON you use by downloading it, and putting the 'scripts' folder into your mission folder (where the mission.sqm is).

Then you need a file called 'init.sqf' in that same root folder of the mission. If your not familiar with this, you can just make a text file in wordpad/notepad etc. and save it as init.sqf.

In init.sqf you include:

if (isServer) then
{
//Init UPSMON scritp
call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";	
};

Now, in the editor you place markers over the cities, and name them something clever eg. UPS_Town_1, UPS_Town_2, etc.

If you just wanted the enemy to be in a specific city, you would just place an enemy group, and in the leaders init line you could put:

nul=[this,"UPS_Town_1"] execVM "scripts\upsmon.sqf";

Where UPS_Town_1 is obviously the name of the marker where the group should patrol... Also you can put in various additional parameters in the init line. The parameters and examples are listed in the UPSMON.sqf in the scripts folder.

UPSMON with random placed units

Okay but on with the random placement of the units. Here comes the key element to what you are trying to accomplish.

If you place the units with markers, then you have to know which marker they are under, and can not set the leaders init line beforehand.

That could be a problem. There a propably a lot of ways to solve this, but here is one approach.

Leave the group leaders init blank, but name him fx UPSunit1. Then set a trigger equivalent to each UPSmon marker (UPS_Town_1,2 etc.). Set the triggers to Opfor -> Present, and in the the condition field put:

this AND (UPSunit1 in thislist);

. In the activation field put:

nul = [uPSunit1,"UPS_Town_X"] execVM "runUPSmon.sqf";

Where "UPS_Town_X" is the name of the corresponding UPSmon marker. (nb. The markername has to be in a string i.e. "").

Now make a file called runUPSmon.sqf in the (root) mission folder.

runUPSmon.sqf

if !(isServer) exitWith {};

private ["_npc","_location"];
_npc = _this select 0;
_location = this select 1;

_npc setVehicleInit "nul=[this,_location] execVM ""scripts\upsmon.sqf"";";
processInitCommands;

And that should be it. When the unit spawns it triggers the trigger in that area. The trigger in turn executes the script, that sets the right initline for the area and processes it.

I have not tested this, and I am certainly not a scripting guru, but I feel confident that it will work.:cool:

Let me know if you test it out.

PS: Just to be on the safe side, I should propably point out, that the markers for the random spawn of course has to be in the different UPSmon areas, or rather in the area of the corresponding triggers. If the units do not spawn in the triggerareas they wont execute the script, and nothing happens :rolleyes:

Cheers,

Edited by Nielsen

Share this post


Link to post
Share on other sites

Thank you ill do this after i do some yard work and let you know. oh by the way what does ''if (isServer) then'' is that for a mp or can it be for sp to ?

Share this post


Link to post
Share on other sites

No problem.

The (isServer) is for MP, but wont be a problem for SP. It just makes the script MP compatible (at least for a hosted environment).

Btw. Remember you can change the runUPSmon.sqf to fit your needs regarding the upsmon settings.

So the runUPSmon.sqf could look like this:

if !(isServer) exitWith {};

private ["_npc","_location"];
_npc = _this select 0;
_location = this select 1;

_npc setVehicleInit "nul=[this,_location,[color="Red"]"Combat","Random","noFollow"[/color]] execVM ""scripts\upsmon.sqf"";";
processInitCommands;

Again. Look at the UPSmon.sqf in the scripts folder of the UPSMON files.

Edited by Nielsen

Share this post


Link to post
Share on other sites

I put a marker UPS_Town_1 and a group in a town and in the leaders init line i put nul=[this,"UPS_Town_1"] execVM "upsmon.sqf"; and see if it worked but when i preview i get Script upsmon.sqf not found, maybe i did something wrong.? i followed what you said or maybe im just totaly lost lol.

Share this post


Link to post
Share on other sites
I put a marker UPS_Town_1 and a group in a town and in the leaders init line i put nul=[this,"UPS_Town_1"] execVM "upsmon.sqf"; and see if it worked but when i preview i get Script upsmon.sqf not found, maybe i did something wrong.? i followed what you said or maybe im just totaly lost lol.

In this case, you are calling the script from the main mission folder where the description.ext and mission.sqm and other files are. Make sure you didn't stick the upsmon.sqf in a sub folder called "scripts". If you did, either pull it out of there into the main mission folder or change the above line to:

 nul=[this,"UPS_Town_1"] execVM "scripts\upsmon.sqf";

See if that works! If not, make sure that if you were looking at the script file in notepad, make sure you saved it as file type "All Files" and used UTF-8 encoding so you didn't just save it as a text file. Hope that helps!

Share this post


Link to post
Share on other sites

 nul=[this,"UPS_Town_1"] execVM "scripts\upsmon.sqf";

Thank you very much this worked, :) another question what is the little screen on the upper right with the west,east and res. for is it to show unit counts ? hmm im calling out patrol points even to the enemy?

Edited by Deg

Share this post


Link to post
Share on other sites

That's the debug console, you'll want to turn that off in the script options before finishing your map.

Share this post


Link to post
Share on other sites
That's the debug console, you'll want to turn that off in the script options before finishing your map.

Thanks one thing though why am i giving patrol points to the enemy or see it for that matter?

Share this post


Link to post
Share on other sites
You aren't, that's just showing you the script is working.

Oh so when i finally finish my mission and try it out it wont be there or do i have to disable it like you mentioned above ?

Share this post


Link to post
Share on other sites

in the file INIT_UPSMON.sqf set this to 0:

//1=Enable or 0=disable debug. in debug could see a mark positioning de leader and another mark of the destinity of movement, very useful for editing mision
KRON_UPS_Debug = [color="Red"]0[/color];

Share this post


Link to post
Share on other sites

Great thanks for all your help, ill try it out in the morning and thanks again. :)

Share this post


Link to post
Share on other sites

Yeah I see I got the path of the upsmon.sqf wrong. I've changed it in my previous posts. Glad you got that working.

Edited by Nielsen

Share this post


Link to post
Share on other sites
Yeah I see I got the path of the upsmon.sqf wrong. I've changed it in my previous posts. Glad you got that working.

Still though thanks for your help got me one step closer hehe, now to tackle my construction interface issues lol :)

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  

×