Jump to content
nomadd

SLP Spawning script

Recommended Posts

Well I just tried the newest update, .72.0.107486. So far no errors in game or the .rpt. The .rpt is a mess of errors but nothing I can find relating to SLP_spawn. I have not tried the latest DEV build. If anyone has a problem please post it and I will take a look.

Share this post


Link to post
Share on other sites

hey nomadd - having a strange bug

it's only spawning one particular chopper , not really random choppers - The larger transport chopper for EAST - mi 48 i think?

any idea on the cause ?

0=["trg1",[0,2],[trg1,50],[],[],[],[2,1,"helo"],["ups","sm1p"]] spawn SLP_spawn;

/nvm I see what you did there... changed up the whole first section to a new set of params... needed to be 0=["trg1",[0,0]

Edited by MassAsster

Share this post


Link to post
Share on other sites

@Massasster

What in is the SLP_units_config.sqf array for _helos?

switch (_faction) do 
{    
case 0: //opfor
{
	_Leaderunits = 	["O_Soldier_TL_F","O_officer_F"];
	_units =	   	["O_helipilot_F","O_crew_F","O_Soldier_base_F","O_Soldier_F","O_Soldier_lite_F","O_Soldier_GL_F","O_Soldier_AR_F","O_Soldier_SL_F","O_soldier_M_F","O_Soldier_LAT_F","O_medic_F","O_soldier_repair_F",
					"O_soldier_exp_F","O_Soldier_sniper_base_F","O_spotter_F","O_sniper_F","O_Soldier_A_F","O_Soldier_AT_F",
					"O_Soldier_AA_F","O_engineer_F","O_Soldier_recon_base","O_recon_F","O_recon_M_F","O_recon_LAT_F","O_recon_medic_F","O_recon_exp_F","O_recon_JTAC_F","O_recon_TL_F",
					"O_Soldier_support_base_F","O_Soldier_AAR_F","O_Soldier_AAT_F","O_Soldier_AAA_F"
					];//"O_Soldier_diver_base_F","O_diver_F","O_diver_TL_F","O_diver_exp_F",
	_vehicles = 	["O_MRAP_02_F","O_MRAP_02_hmg_F","O_MRAP_02_gmg_F","O_Quadbike_01_F","O_Truck_02_covered_F","O_Truck_02_transport_F","O_APC_Wheeled_02_base_F","O_APC_Wheeled_02_rcws_F"];
	_tanks = 		[];
	[b][color="#FF0000"]_helo[/color][/b] = 		["O_Heli_Light_02_F","O_Heli_Light_02_unarmed_F","O_Heli_Attack_02_F","O_Heli_Attack_02_black_F"];
	_plane =     	[];
	_boat = 		["O_Boat_Armed_01_hmg_F","O_Boat_Transport_01_F","O_Lifeboat"];
};

It should use whatever is in the array, unless I have the class names wrong or the class names have changed

Edit: Missed your last line in the post, glad you figured it out

Edited by Nomadd

Share this post


Link to post
Share on other sites

Nomadd,

really awesome scripts.I don`t fully understand it yet,so I used your demo mission,with just some vehicle,VAS,and BTC revive. Mission is multiplayer,however when the mission launches my friends get this error:..._cur_mp.stratis\slpcall.sqf

wait until slp_init==1

slpcall 11 player

error undefined variable in expression:slp_init

File mp missions\__CUR_MPStratis\SLPCall.sqf, line 1

I got this from friends screenshot.

Thanks for any help, I really like your scripts !

Share this post


Link to post
Share on other sites

@Wolf72nd

Just go into the init.sqf and delete the line

execvm "SLPcall.sqf";

That was in the demo as an example of how to call SLP_spawn from an .sqf. Unfortunately BI has been changing quite a few things involving the engine/script execution/variables. I have not been able to keep up with the changes. Once the dust settles, I will look into how I need to change SLP_spawn. I just can't see spending the time to try and learn what is new if things are going to change again, plus the documentation on the changes is not anything to get excited about. I am not complaining about the changes, it is beta so things will happen.

You can still call SLP_spawn from scripts just not in the init.sqf. Just do everything from triggers for the time being.

---------- Post added at 07:12 PM ---------- Previous post was at 07:03 PM ----------

For anyone running the DEV build:

Guess BI released some new armor/track classes. I am not running the DEV build and steam is too much of a pain in the a** switching between stable beta and DEV. I realize how much I miss the beta folder in ARMA2 very easy to switch out the different beta builds and switch back to stable build....

Anyway, back to post, Just go into SLP_units_config.sqf and add the new class names to the armor array , remember to use ""

switch (_faction) do 
{    
case 0: //opfor
{
	_Leaderunits = 	["O_Soldier_TL_F","O_officer_F"];
	_units =	   	["O_helipilot_F","O_crew_F","O_Soldier_base_F","O_Soldier_F","O_Soldier_lite_F","O_Soldier_GL_F","O_Soldier_AR_F","O_Soldier_SL_F","O_soldier_M_F","O_Soldier_LAT_F","O_medic_F","O_soldier_repair_F",
					"O_soldier_exp_F","O_Soldier_sniper_base_F","O_spotter_F","O_sniper_F","O_Soldier_A_F","O_Soldier_AT_F",
					"O_Soldier_AA_F","O_engineer_F","O_Soldier_recon_base","O_recon_F","O_recon_M_F","O_recon_LAT_F","O_recon_medic_F","O_recon_exp_F","O_recon_JTAC_F","O_recon_TL_F",
					"O_Soldier_support_base_F","O_Soldier_AAR_F","O_Soldier_AAT_F","O_Soldier_AAA_F"
					];//"O_Soldier_diver_base_F","O_diver_F","O_diver_TL_F","O_diver_exp_F",
	_vehicles = 	["O_MRAP_02_F","O_MRAP_02_hmg_F","O_MRAP_02_gmg_F","O_Quadbike_01_F","O_Truck_02_covered_F","O_Truck_02_transport_F","O_APC_Wheeled_02_base_F","O_APC_Wheeled_02_rcws_F"];
	_tanks = 		["[color="#FF0000"]"ADD_NEW_CLASSNAME_HERE"[/color]];
	_helo = 		["O_Heli_Light_02_F","O_Heli_Light_02_unarmed_F","O_Heli_Attack_02_F","O_Heli_Attack_02_black_F"];
	_plane =     	[];
	_boat = 		["O_Boat_Armed_01_hmg_F","O_Boat_Transport_01_F","O_Lifeboat"];
};

Then in your SLP_spawn line just spawn armor like you would anything else

Share this post


Link to post
Share on other sites

@Nomadd,

Thank you that worked,mission plays awesome, It`s really nice of you to continue support for your scripts and much appreciated !

:beeeers:

Share this post


Link to post
Share on other sites

Nomad awesome script! I almost exclusively use this script in all of my clans missions. Flexibility is great! I do have a question or maybe a request.

In my mission i have an opfor unit spawning (SLP) on a trigger and I'd like them to "hunt" the player. However with your "hunt", the enemy goes straight to my position. I though if maybe I had a marker(ellipse 500m) that followed (refreshes every 60 seconds) my player throughout the mission, and rather than use hunt I used attack or patrol. This would simulate the enemy searching for me and not just "knowing where i am". However it appears the enemy only goes to where the marker was when your script is triggered, therefore not following me as I move across the map and the marker refreshes.

Like I said I tried different options between "attack, "hunt" but the enemy didn't chase the marker I had set on me, and setting it to "hunt" the player made the enemy land right on top of our group too often.

Any suggestions thanks!

---------- Post added at 08:29 AM ---------- Previous post was at 07:42 AM ----------

Nomad awesome script! I almost exclusively use this script in all of my clans missions. Flexibility is great! I do have a question or maybe a request.

In my mission i have an opfor unit spawning (SLP) on a trigger and I'd like them to "hunt" the player. However with your "hunt", the enemy goes straight to my position. I though if maybe I had a marker(ellipse 500m) that followed (refreshes every 60 seconds) my player throughout the mission, and rather than use hunt I used attack or patrol. This would simulate the enemy searching for me and not just "knowing where i am". However it appears the enemy only goes to where the marker was when your script is triggered, therefore not following me as I move across the map and the marker refreshes.

Like I said I tried different options between "attack, "hunt" but the enemy didn't chase the marker I had set on me, and setting it to "hunt" the player made the enemy land right on top of our group too often.

Any suggestions thanks!

Not sure what I did, but managed to solve the problem, sure it was some silly error on my part! but works as I wanted!! Thanks!

Keep up the great work!

Share this post


Link to post
Share on other sites

I just tried the newest beta and got lots of wonderful errors. I have everything working error free (at least until the next patch). I need to do some more testing,just to make sure I have not missed anything. I will also add the new armor/tracked vehicles. I should have the newest version up this weekend.

Share this post


Link to post
Share on other sites

Newest Version:

v3.42 linked first page

Changelog:

-fixed the errors caused by the latest beta

-added class names for armor

-the line in init.sqf has changed to SLP= [] execVM "SLP\SLP_init.sqf";

-call line requires 8 elements now...0= ["nameofspawn",[side,faction],[position],[infantry],[vehicles],[armor],[air],[tasks]] spawn SLP_spawn;

-fixed bad class name in SLP_units_config

If you have any problems, let me know. I did not receive any errors while testing.

---------- Post added at 07:55 PM ---------- Previous post was at 07:32 PM ----------

I made a very quick mission for the group I play with. Thought I would put it out here if anyone wants to look at it and see a basic defend type set-up using SLP. I put this mission together in about 10-15 mins, it is no where near complete, nor (for you die hard realism fans) is it realistic. However, it is fun to play with some friends and pretty much all action.

The host can decide on the # of attacking waves of infantry , the size of the groups, # of vehicles, # of helos. The delay/speed at which the groups will spawn and attack. It also uses VAS and a basic respawn.

Defend the base, enemy gets to the flag pole, you lose.

Again, this is just a demo mission not really a "real" coop mission

http://www.mediafire.com/download/v05ofnbxpu9mm1e/Defend.Stratis.7zhttp://

Share this post


Link to post
Share on other sites

Nomadd, I got error:

waituntil {|#|SLP_init == 1};

_grp = _this select 0;

Error Undefined variable in expression: slp_init

file X:\..\SLP\SCRIPTS\SLP_fnc_common.sqf, line 136

I did notice that in your init.sqf, you have:

SLP = [] execvm "SLP\SLP_init.sqf";

Did you intend for that to be:

SLP_init = [] execvm "SLP\SLP_init.sqf";

Share this post


Link to post
Share on other sites
Nomadd, I got error:

waituntil {|#|SLP_init == 1};

_grp = _this select 0;

Error Undefined variable in expression: slp_init

file X:\..\SLP\SCRIPTS\SLP_fnc_common.sqf, line 136

I did notice that in your init.sqf, you have:

SLP = [] execvm "SLP\SLP_init.sqf";

Did you intend for that to be:

SLP_init = [] execvm "SLP\SLP_init.sqf";

If you get this message, I would go changing the waituntil in the "X:\..\SLP\SCRIPTS\SLP_fnc_common.sqf, line 136" to

waituntil {!isNil "SLP_init" && {SLP_init == 1}};

with this lazy condition, it will not try to evaluate slp_init == 1 if it is not defined, and then no error will spawn. But it may be more complex than just that...

Share this post


Link to post
Share on other sites

It seems that the intention of the waituntil is to assign hunt or attack parameters to units with that action assigned, but after they're spawned. Perhaps this was supposed to be SLP_instances.. as I did find that in the SLP_fnc_spawn.sqf. I did not however find slp_init defined or called in any code in any file except for in that wait statement.

For now I just replaced the waituntil with sleep 30;

Edited by StrongHarm

Share this post


Link to post
Share on other sites

Sorry about that StrongHarm, I didn't test SLP_hunt, but I did test SLP_attack and it did not throw any errors. I missed the

waituntil {|#|SLP_init == 1};

in both of them. I took the variable out completely, or I thought I did anyway. I will fix the problem and get a new version up. You can try just deleting the waituntil ,see if that takes care of your errors

---------- Post added at 07:52 AM ---------- Previous post was at 07:25 AM ----------

I realize making corrections yesterday and drinking rum may not have been the best combination. Anyway here is a new version with the hotfixes. I am going to wait to put it on first page until I get some feed back to make sure it is error free. I have not had a chance to test it.

new version v3.43

http://www.mediafire.com/download/8wv1huhtmmss4sy/SLP_spawn_v3%252e43.Stratis.7z

I did make one change to be aware of in your init.sqf , the line should be

SLP_init = [] execvm "SLP\SLP_init.sqf";

Thanks again Strongharm for bringing this to my attention

Share this post


Link to post
Share on other sites

No problem Nomadd.. I appreciate all the work you put into this script.. it's pretty ingenious. I tested the changes you made and they seem to be good. Thanks!

Share this post


Link to post
Share on other sites

ok i like it but i got down to the delay part and im not shure what im supposed to do here i put the numbers for side and faction but what do i put for the delay i want it to be like 30 seconds how would i do so heres what it looks like in my file

0= ["respawn_vehicle_west",[1,1,delay(optional)],[position,offset distance(optional)],[infantry],[vehicles],[armor],[air],[tasks,taskinfo1,taskinfo2](optional)] spawn SLP_spawn;

---------- Post added at 07:48 AM ---------- Previous post was at 06:34 AM ----------

ok i think i fugured out that part but now im wondering about how to tell wich units are witch im looking at the slp unit config file and im on bluefor and im looking at vhecles wich one is the tracked apc in the code

---------- Post added at 08:46 AM ---------- Previous post was at 07:48 AM ----------

also my units arent spawning at all saying erre in small wrighting with the slp/slp init folder line 28 (paramsarray select 1) ; ; or something like that how do i fix this

Share this post


Link to post
Share on other sites

The beautiful thing about delay is that you can spawn multiple groups around an objective, and have that delay staggered.. so the result is, if you're spawning a total of 50 troops, you can do 10 at a time at 5 different positions staggered by 10 seconds. This prevents a visible lag from being perceived by the client. 0=[1,1,0], 1=[1,1,10], 2= [1,1,20], etc.

It sounds like you don't have the SLP folder in place. You need the following to docs\Arma3(! or arma3 - other profiles)\missions\(yourMishName).Stratis:

SCRIPTS folder

SLP folder

init.sqf file (or just the line SLP_init = [] execvm "SLP\SLP_init.sqf"; in your existing init.sqf)

I would highly suggest reading the SLP_readme.txt thoroughly. This is more involved than just doing an installation, but not nearly as involved as having to write the functions out yourself.

Share this post


Link to post
Share on other sites

Hmm, can you expand on that Strong? I'm actually wondering if it's possible to have variable delays for the different types of groups. So, say I have infantry and helicopters spawning. If an infantry platoon is destroyed, I don't mind if a replacement spawns right away, but if a heli is destroyed, I'd like to have a delay of a minute or two before the next one spawns so the players aren't overloaded with helicopters constantly. I think that's possible, just trying to understand the syntax. Would something like this work to spawn 5 groups of 8 infantry with a 5 second delay, and 5 units of 1 heli with a 2 minute delay?

0=["trg1",[0,2,true],[trg1,50],[5,8,5]],[],[],[5,1,120],["patrol",30]] spawn SLP_spawn;

If that's not possible in one call, I know I can probably do it with different calls for the different units, but just trying to see if there's a way to do it all in one call.

---------- Post added at 09:07 ---------- Previous post was at 08:56 ----------

Hmm, looks like my hope to do varying delays per unit type won't work and it's one set delay for all spawns. Unless I'm missing something I'll just need to set up different spawn calls.

Edited by MeatballCB

Share this post


Link to post
Share on other sites

You could conceivably spawn 20 individual units with 20 different sp_spawn calls... you can split it up as much as you want. You could put together a script that says

UnitDead = {code to tell if unit is dead};

execvm {params} spawn slp_spawn;

wait until UnitDead;

execvm {params} spawn slp_spawn;

Share this post


Link to post
Share on other sites

Think I got it.

Edited by MeatballCB

Share this post


Link to post
Share on other sites

when i do it it isint working its giving me an errroe saying the slp/slp init line 28 or something like that how do i fix that

Share this post


Link to post
Share on other sites

Newest Version:

v3.43 posted on front page

---------- Post added at 05:34 PM ---------- Previous post was at 05:25 PM ----------

@zdowgg

First make sure you are using the latest version older versions had examples of using paramsarray, which could be confusing if you are not familiar with it. The error looks like you are trying to define global variables for the number of spawns for infantry/vehicles/armor/air but you have nothing defined in the description.ext. If you open SLP_init.sqf, you can edit values. Look for this...

/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
//# 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=                                	0         ;        //Sets # of Infantry groups
_Infgrp_size=                                	0     	   ;        // Sets # of units in infantry groups
_Vehgrp_num=                              		0        ;        // Sets # of vehicle groups
_Vehgrp_size=                              	0        ;        // Sets # of units in vehicle groups
_Armgrp_num=                             		0         ;        // Sets # of Armor groups
_Armgrp_size=                              		0       ;      	// Sets # of units in Armor groups
_Airgrp_num=                                    0        ;     	// Sets # of Air groups
_Airgrp_size=                                   0        ;    	// Sets # of units in Air groups

/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
[color="#B22222"][/color]

If you are not using paramsarray in description.ext set the above values to 0.

If you want to understand how to use paramsarray download the demo mission Defend. I will post a link on the first page

Share this post


Link to post
Share on other sites

yea i was trying to set them to 0 but i dont know ware to actuly put the 0 at in the options file im new to this

---------- Post added at 11:32 PM ---------- Previous post was at 11:21 PM ----------

ok i got it the way u have it now its giving me a new error same file line 60 SLP_array set skil inf set skill veh set skill air

is there something i have to do here as well?

---------- Post added at 11:40 PM ---------- Previous post was at 11:32 PM ----------

also yes ive put nothing in my decription ext ive been following ur read me and it dosent say to put any thing in there so i havent

---------- Post added at 11:45 PM ---------- Previous post was at 11:40 PM ----------

also ive downloaded the vershion you posted on this fourm post i hope i have the newest copy lol

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

@zdowgg

Not sure why you are getting an error with the setskill arrays. I have not encountered any errors with that. If you use just the demo mission, do you get any errors? I think, this is just a guess, that when you edited the SLP_init.sqf you have mistake somewhere and it is kicking out the error. A great tool is squint, it will help check .sqfs.

Squint download:

http://forums.bistudio.com/showthread.php?105860-Squint-the-sqf-editor-and-error-checker&highlight=squint

---------- Post added at 03:56 PM ---------- Previous post was at 03:54 PM ----------

Thanks Foxhound for the update

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

×