Jump to content
nomadd

SLP Spawning script

Recommended Posts

the hunter group should go after the hunted group no matter what

---------- Post added at 08:27 PM ---------- Previous post was at 08:25 PM ----------

I am going to post this on the first page.

Doing some testing and the path-finding is just terrible in towns/cities/stuctures. Task "patrol" just works like crap, the AI seem to get stuck and can not complete the waypoint so it never gets assigned a new waypoint. Outside of towns/cities/stuctures it does not appear to be a problem. If your "patrols" are just stopping switch over to UPS it seems to work better. I have tested CBA_taskpatrol and BIS_taskpatrol both seem to have problems. This is something new with ARMA3, never noticed this problem in ARMA2. Hopefully it will get a fix.

Share this post


Link to post
Share on other sites

Moved my triggers and stuff to a new area on the map and it seems like it's working somewhat now. Maybe my units just hated Air Station Mike 26 or something. strange

Edited by thestuntman

Share this post


Link to post
Share on other sites

Only just saw your PMs checking out your edited mission now.

In the readme it says

0=["trg1",[0,2],[trg1],[2,[4,8]],[2,[1,3]],[],[1,1],[],'nul=[this,"area1","move","nowait","spawned"] execVM "scripts\upsmon.sqf";'] spawn SLP_spawn;

but in the mission you gave me you have

0=["upsbase",[1,1],[upsbase],[1,[3,4]],[],[],[],["upsmon","area3"]] spawn SLP_spawn;

I found your note in SLP_tasks.sqf. Gonna change it a bit so i can pass more UPSMON parameters to it to be able to use "ambush" etc.

Cheers for the help!

Edited by thestuntman

Share this post


Link to post
Share on other sites

Hey, random question how does SLP_Hunt get the coordinates/location of the group they are trying to find? I can't actually find a SLP_Hunt script, but I see it called out in the SLP__tasks.sqf.

Share this post


Link to post
Share on other sites

@thestuntman

Sorry about that I missed that line in the readme. I thought I removed everything dealing with setvehicleinit but missed that last line in the readme. When I do another update I will be sure and correct it

@MeatballCB

The SLP_hunt is actually in the SLP_fnc_common.sqf. Open SLP_fnc_common.sqf and scroll down you will find it. The hunting group track the position of the leader of the hunted group. If a group is not the thing being hunted then the hunter group will track the position of whatever you are using.

Share this post


Link to post
Share on other sites

I'm using your script, and this line in particolaur:

0=["trg5",[1,1],[trg5],[5,[1,2]],[],[],[],["hunt",abc]] spawn SLP_spawn;

But how can i change the "trg5" to make them spawn near the player at some distance and from one direction without using a marker?

Share this post


Link to post
Share on other sites

NEW UPDATE

changelog

-remove some bad class names from the SLP_units_config.sqf

-tried to update the readme with more info

-added a few more examples

-some small fixes

Newest version front page

SLP_spawn 3.41

---------- Post added at 11:21 AM ---------- Previous post was at 11:18 AM ----------

@Antorugby

You can do it this way..

0=["myspawn",[1,1],[s1],[5,[1,2]],[],[],[],["hunt",abc]] spawn SLP_spawn

If it is just singeplayer you can change s1 to player. S1 is the name you give the unit in the editor, it can be whatever you want.

You can also name the group mygroup= group this;

0=["myspawn",[1,1],[mygroup],[5,[1,2]],[],[],[],["hunt",abc]] spawn SLP_spawn

The spawned units will spawn near the group leader. If you want to make them spawn further out you can set the distance

0=["myspawn",[1,1],[mygroup,100],[5,[1,2]],[],[],[],["hunt",abc]] spawn SLP_spawn

This will spawn the units 100 meters out from the group leader. The direction will be random. You can also use min/max values on the distance [mygroup,[50,100]]. The spawned units will be a minimum distance of 50 meters and a max distance of 100 meters from the group leader.

This is a great way to set up ambushes to attack the group

 0=["myspawn",[1,1],[mygroup,100],[5,[1,2]],[],[],[],["attack",mygroup]] spawn SLP_spawn or 0=["myspawn",[1,1],[mygroup,100],[5,[1,2]],[],[],[],["hunt",mygroup]] spawn SLP_spawn

I just updated SLP and actually have an example or this in the demo

Hope this helps

Share this post


Link to post
Share on other sites
Guest

Updated version frontpaged on the Armaholic homepage.

===================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Heh, my spawn script from alpha no longer work, so looking for a quick fix.

just played with 3.41, had zero luck with it.. all kinds of errors spitting out of the SLP_init

Anyone else? Does this require [DEV]?

Share this post


Link to post
Share on other sites
NEW UPDATE

changelog

-remove some bad class names from the SLP_units_config.sqf

-tried to update the readme with more info

-added a few more examples

-some small fixes

Newest version front page

SLP_spawn 3.41

---------- Post added at 11:21 AM ---------- Previous post was at 11:18 AM ----------

@Antorugby

You can do it this way..

0=["myspawn",[1,1],[s1],[5,[1,2]],[],[],[],["hunt",abc]] spawn SLP_spawn

If it is just singeplayer you can change s1 to player. S1 is the name you give the unit in the editor, it can be whatever you want.

You can also name the group mygroup= group this;

0=["myspawn",[1,1],[mygroup],[5,[1,2]],[],[],[],["hunt",abc]] spawn SLP_spawn

The spawned units will spawn near the group leader. If you want to make them spawn further out you can set the distance

0=["myspawn",[1,1],[mygroup,100],[5,[1,2]],[],[],[],["hunt",abc]] spawn SLP_spawn

This will spawn the units 100 meters out from the group leader. The direction will be random. You can also use min/max values on the distance [mygroup,[50,100]]. The spawned units will be a minimum distance of 50 meters and a max distance of 100 meters from the group leader.

This is a great way to set up ambushes to attack the group

 0=["myspawn",[1,1],[mygroup,100],[5,[1,2]],[],[],[],["attack",mygroup]] spawn SLP_spawn or 0=["myspawn",[1,1],[mygroup,100],[5,[1,2]],[],[],[],["hunt",mygroup]] spawn SLP_spawn

I just updated SLP and actually have an example or this in the demo

Hope this helps

Thank you, work really well.

I've just one problem, at the start i get an error saying there is some problem in the line 28 of the SLP_init.sqf.

Something like "Error zero divisor"

EDIT: My fault, i forgot the description.ext.

Anyway, is it normal that will spawn even another squad that will not do anything?

EDIT2: No, it keep showing the error.

Edited by Antorugby

Share this post


Link to post
Share on other sites

@virtualinfantry

I need more info. Have you tried the demo mission, does it work? or does it throw you an error? What are the errors it is spitting out? Are you running alot of scripts or mods? SLP shouldn't conflict with anything but I can't guaranty that.

No SLP does not require the DEV build,but it should work fine with the DEV build. I have used it with the DEV build and without the DEV build. I try to keep somewhat up to date on the DEV builds to see if any changes will effect it.

@Antorugby

I am not sure why you are getting that error. If you want to pm your mission I will take a look at it.

Share this post


Link to post
Share on other sites

Great script Nomadd :bounce3:

Share this post


Link to post
Share on other sites

@Luki_M2K

Glad you like it and are finding it useful

Share this post


Link to post
Share on other sites

Hmm, I seem to be having some issues with the script again, anyone else having issues getting new units to spawn? The call works correctly and all the proper units I put in spawn, but once the units are dead, replacements never spawn, even if I kill _all_ of the groups (Inf/Veh/Air) that I put in the call.

Edit: Little bit more info, I'm using the following in my trigger On Act to call the SLP script.

0=["HunterSpawn",[0,0,10],["slpSpawn",25],[2,6],[1,1],[],[],["hunt",demoteam]] spawn SLP_spawn;

I created a dummy unit next to the slpSpawn marker I'm spawning at and made him invulnerable so I can actually see/kill all the units that pop up without a problem. Units spawn, I kill them all and eventually they sink into the ground, but no replacements ever spawn.

Edited by MeatballCB

Share this post


Link to post
Share on other sites

@MeatballCB

You are spawning 2 groups of 6 infantry with a 10 sec delay between the groups and 1 group with 1 vehicle. What you are saying is the first group of 6 will spawn but nothing will spawn after that?

Share this post


Link to post
Share on other sites

No, both infantry groups spawn and the vehicle spawns. I kill all 12 infantry (both groups) and the 1 vehicle (one group), and then no new groups spawn after that. Maybe that's by design, and I was reading wrong, but I was thinking that what would happen is 2 infantry groups and 1 vehicle spawn. If either infantry group was killed, another would be spawned to replace it and continue hunting the players, and if the vehicle died, another would spawn to replace it and hunt the players. This way there would always be 2 infantry/1 vehicle hunting the players, no matter how many got destroyed.

If that's not how it's supposed to work, I can just as easily set up a loop to run the call every so often and it'll do the same thing, just want to understand whether there's something not working with the script, or with my brain. :)

Share this post


Link to post
Share on other sites

ah got it. Yeap the script is not designed to work that way. You can easily set up a trigger/loop with conditions and keep spawning more units until the conditions are met. You can also change the delay from a number to TRUE

0=["HunterSpawn",[0,0,TRUE],["slpSpawn",25],[2,6],[1,1],[],[],["hunt",demoteam]] spawn SLP_spawn;

This will spawn 1 group of 6 infantry and 1 vehicle. After the first group of infantry as been killed it will then spawn another group of 6 infantry. You can of course change the number of groups you want to spawn. If you want groups to keep spawning for a long time just make the number high. Would probably be better on a trigger/loop with conditions to stop the spawning at some point.

I posted this before but if the delay is set to True the infantry/vehicles/armor/air work independently of one another. Meaning kill infantry group get another infantry group to spawn, kill vehicle group get another vehicle group to spawn....until the number of groups to spawn has been met.

Share this post


Link to post
Share on other sites

Ah, I get it. Sorry, I read it wrong the whole time then. :) Thanks for the clarification. Does the script give any variable or end result that I could set as a trigger to start a loop again once everything that was supposed to spawn has spawned?

Share this post


Link to post
Share on other sites

Yes and no. It uses an overall global variable to keep track of all the spawns. It really doesn't/can't keep up with each individual spawn line. I use SLP_Instances to track the total number of groups spawned. It encompasses everything infantry/vehicles/armor/air. It can be used for a base defense type mission, add up the total number of groups attacking the base

exp

0=["Baseattack",[0,0,20],[trg1],[12,[5,6],[4,1],[4,1],[],["attack",base]] spawn SLP_spawn;

Then for an ending condition you can use SLP_Instances >=19 , 12+4+4 = 20 so I use one less.. 19.

Another thing you can do is use the paramsarray and have the ability to change the delay and number of groups every time the mission is played.

exp

0=["Baseattack",[0,0,(paramsarray select 1)],[trg1],[(paramsarray select 2),[5,6],[],[],[],["attack",base]] spawn SLP_spawn;

You need to set up the paramsarray in the description.ext for this to work. The end condition would then be SLP_Instances >= (paramsarray select 2)

Share this post


Link to post
Share on other sites

Yeah, I'm already using the paramsArray to some extent. I've set it so players can choose how many enemies (based on how many players) and the AI skill level and I'm just feeding those values in using global variables in both the trigger call:

0=["HunterSpawn0",[0,0,True],["slpSpawn",25],[20,(4+(4*numEnemies))],[15,(4*numEnemies)],[],[15,1],["hunt",demoteam]] spawn SLP_spawn;

...and to set the AI Skill level in the SLP_Init.sqf

_setskill_inf= enemySkill          ;    // sets skill for infantry units
_setskill_veh= enemySkill          ;   	//sets skill for vehicles and armor units
_setskill_air= enemySkill          ; 	// sets skill for Air units

Both work fine, but I'm not using it to set the number of group spawns, just the size of the groups when they do spawn.

Edited by MeatballCB

Share this post


Link to post
Share on other sites

@MeatballCB

What you are doing will work fine. If you look at the demo I actually have an example of using the paramsarray to be able to change the number or groups and the size of each group

It uses ..-1..in the spawn line

exp:

0=["HunterSpawn0",[0,0,True],["slpSpawn",25],[-1,-1],[-1,-1],[],[-1,1],["hunt",demoteam]] spawn SLP_spawn

You need to define your paramsarray, which sounds like you have

description.ext

class Params
{
	class debug
       {
	// paramsArray[0]
               title = "Debug";
               values[] = {0,1};
               texts[] = {"Disabled","Enabled"};
               default = 1;
       };
	class EnemyInfgroups
       {
	// paramsArray[1]
               title = "Number of Enemy Infantry Groups";
               values[] = {15,20,25};
               texts[] = {"15", "20", "25"};
               default = 20;
       };
	class EnemyInfsize
       {
	// paramsArray[2]
               title = "		Number of Enemy Units in Infantry Groups";
               values[] = {6,9,12};
               texts[] = {"6", "9", "12"}; //or {"light","medium","heavy"},{"afew","afewmore","lotsofdirtnaps"} if you want to hide the actual numbers
               default = 6;
       };
	class Enemyvehgroups
       {
	// paramsArray[3]
               title = "Number of Enemy Vehicles Groups";
               values[] = {0,10,15,20};
               texts[] = {"none", "10", 15", "20"};
               default = 15;
       };
	class Enemyvehsize
       {
	// paramsArray[4]
               title = "		Number of Enemy Units in Vehicles Groups";
               values[] = {0,1,2,3};
               texts[] = {"none", "1", "2", "3"};
               default = 1;
       };
	class Enemyarmgroups
       {
	// paramsArray[5]
               title = "Number of Enemy Armor Groups";
               values[] = {0,10,15,20};
               texts[] = {"none", "10", 15", "20"};
               default = 15;
       };
	class Enemyarmgsize
       {
	// paramsArray[6]
               title = "			Number of units in Armor Groups";
               values[] = {0,1,2,3};
               texts[] = {"None", "1", "2", "3"};
               default = 1;
       };
	class Enemyairgroups
       {
	// paramsArray[7]
               title = "Number of Enemy Air";
               values[] = {1,2,3};
               texts[] = {"1", "2", "3"};
               default = 1;
       };

};

Then in the SLP_init.sqf set the global values

/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
//# of Groups and Group size...Global Values use... -1 in script call to activate 
//if you are not using paramsarray then set these values to 0
//_Infgrp_num=             0;
//_Infgrp_size=            0;

_Infgrp_num=                                	        (paramsarray select 1)                             ;        //Sets # of Infantry groups
_Infgrp_size=                                	        (paramsarray select 2)  +  random 3  	   ;        // Sets # of units in infantry groups
_Vehgrp_num=                              		(paramsarray select 3)                             ;        // Sets # of vehicle groups
_Vehgrp_size=                              		(paramsarray select 4)                             ;        // Sets # of units in vehicle groups
_Armgrp_num=                             		(paramsarray select 5)                             ;        // Sets # of Armor groups
_Armgrp_size=                              		(paramsarray select 6)                             ;      	// Sets # of units in Armor groups
_Airgrp_num=                                              (paramsarray select 7)                             ;     	// Sets # of Air groups
_Airgrp_size=                                               (paramsarray select 7)                            ;    	// Sets # of units in Air groups

/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/

Edited by Nomadd

Share this post


Link to post
Share on other sites

I will take a look at it, as soon as I can. I am not using the DEV build so have not encountered the problems. What I have read, sounds like the last update broke a whole lot of scripts.

Share this post


Link to post
Share on other sites

Just took a quick look using the latest DEV beta. I have no idea atm what is going on, but nothing is working. I can't even use the radio in game to activate triggers. Hopefully BI will fix whatever it is they broke. Otherwise I am going to have to try and figure out what they changed and how to work around it. Have to go to work , will probably be a day to two before I can work on this again.

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

×