Jump to content
nomadd

SLP Spawning script

Recommended Posts

ok i downlaoded the new vershion but now my units just arent spawning heres what i got.... first i brought over the slp and slp scripts files cause im gessing thats what you do and heres the rest of my files

Description.ext

author = "zdowgg"; // Author
onLoadName = "Battlefield Arma Editon"; // Mission name (temporary solution; actual name set in editor will be used later in the alpha)
onLoadMission = "Keep the teams even select sqwad commanders if avaible to control the AI in your sqwad"; // Description
loadScreen = "battelfeild 3.jpg"; // Preview picture
class Header
{
gameType = Coop; // MP misison type
};

respawn= "base";
respawndelay= 10;


init.sqf

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

//execvm "group.sqf";



group.sqf

0= ["respawn_vehicle_west",[1,1,true],[respawn_vehicle_west,10],[3,8],[4,4],[],[1,2],[attack,city]] spawn SLP_spawn;

i have a marker named respawn_vehicle_west and another maker named city

i also have another marker named respawn west cause i was doing basic respawn for players not shure if i need to delete that and change the description ext also not shure if i brought the right files over from the exsample misshion over to my misshion let me know

Share this post


Link to post
Share on other sites

where are you execvm'ing the group.sqf? You have the line commented out in you init.sqf.

You can do this

SLP_init = [] execvm "SLP\SLP_init.sqf";
waituntil {scriptdone SLP_init};

execvm "group.sqf";  

I personally do not like using waituntils in the init.sqf, but you can do it. Another option is to use a trigger in the editor.

Share this post


Link to post
Share on other sites

I ended up commenting those out in the two function calls that had them listed Nomadd (SLP_Spawn and SLP_markers), were kicking out undefined variable errors for me. And since I don't call any SLP spawns other than in triggers in game, I know SLP_init has already run.

Share this post


Link to post
Share on other sites

i have the spawn code in the group swf cause u said not to put it in init sqf so im not shure what to put in my init sqf

i thought thats what i was supposed to do

---------- Post added at 01:55 AM ---------- Previous post was at 01:47 AM ----------

ok i so redid it a lil bit but now im getting error in my group sqf saing invalid varible heres what it looks like now

init.sqf

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

group.sqf

0= ["BLUEFOR",[1,1,true],[bLUEFOR,10],[3,8],[4,4],[],[1,2],[attack,city]] spawn SLP_spawn;

description.ext

author = "zdowgg"; // Author
onLoadName = "Battlefield Arma Editon"; // Mission name (temporary solution; actual name set in editor will be used later in the alpha)
onLoadMission = "Keep the teams even select sqwad commanders if avaible to control the AI in your sqwad"; // Description
loadScreen = "battelfeild 3.jpg"; // Preview picture
class Header
{
gameType = Coop; // MP misison type
};

respawn= "base";
respawndelay= 10;


ive changed my spawn marker to bluefor to make it more easy also not shure what else im suposed to put in my init sqf besides what the read me told me to im basicle only doing what the read me tells me to and its not working im not getting any error now and there still not spawing hope u can find my problem in my code

Edited by zdowggg

Share this post


Link to post
Share on other sites

@MeatballCB

I am not sure I follow what you are saying. When you tried to call a spawn from the init.sqf you got errors or you are getting errors now?

@zdowggg

EDIT: Your spawn line is wrong. If you are using markers , then the marker name has to be in "" (quotes).

try this

init.sqf

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

execvm "group.sqf";

group.sqf

waituntil {scriptdone SLP_init};
["BLUEFOR",[1,1,true],["BLUEFOR",10],[3,8],[4,4],[],[1,2],[attack,"city"]] spawn SLP_spawn;

If you want to send me your mission I will be glad to take a look at it.

Edited by Nomadd

Share this post


Link to post
Share on other sites
@MeatballCB

I am not sure I follow what you are saying. When you tried to call a spawn from the init.sqf you got errors or you are getting errors now?

Well, I'm using a trigger call in game to run the SLP Spawn script and when I do I'm getting the following error:

...er) exitwith{};
waituntil {scriptdone |#|SLP_init};

_spawnname = _this select 0;...'
Error Undefined variable in expression: slp_init

I found that waitUntil in both the SLP_Spawn and SLP_markers the sqf files and since I'm calling the SLP Spawn with a trigger way after the mission has started, I'm not worried about the SLP_init.sqf not having been run since it's in my init.sqf, so I just commented that out in both the spawn/markers files.

Share this post


Link to post
Share on other sites

ah got it, I will take a look at it. The way everything is initialized now, the waituntils are probably not needed. I don't know why they would throw an error, the triggers get initialized after the init.sqf.

Edit:

Been testing some different things and I can't get that error to show up.

I screwed up in v3.42 and had

SLP = [] execVM "SLP\SLP_init.sqf"

I changed eveything in v3.43 to be

SLP_init = [] execVM "SLP\SLP_init.sqf"

Make sure in your init.sqf you have

SLP_init = [] execVM "SLP\SLP_init.sqf"

Edited by Nomadd

Share this post


Link to post
Share on other sites

There you go, that was my problem. Still had the old init.sqf code. Sorry about that.

Share this post


Link to post
Share on other sites

Mr. Nomadd,

I am using stable version 0.74 of A3, and SLP version 3.43. I fired up the game with no mods at all, and started your demo mission, and this is what I saw on launching it;

VwjROZX.gif

And of course as you already know, the 3.43 init in the demo does in fact read;

SLP_init = [] execVM "SLP\SLP_init.sqf"

Also wanted to say thank you very much for continuing to support this great script.

Edited by R.Flagg

Share this post


Link to post
Share on other sites

@R.Flagg

I will take a look at it. I think I know what is going on. In the demo mission, I show an example of how to use the SLP_markers with editor places units. I am pretty sure this is causing the error. If you want to test this, open the demo mission in editor, in the bottom left corner you will find an editor placed boat. Just delete the boat, see if the error goes away. Of course, this is also just a guess. I will test all this later, cant test anything atm.

Share this post


Link to post
Share on other sites

That seems to have done the trick! Let it be said you are a man of many talents and virtues.

I hope to spend much more time with it soon, and I'll let you know if I see anything unusual.

Good day, sir!

Share this post


Link to post
Share on other sites

keep getting an error stating _armor array is empty...

Share this post


Link to post
Share on other sites

@Desrat

The tank array is in the SLP_unit_config.sqf. This is user defined. In the demo I have all the BIS class names but you can add or change what ever you like. The only two armors are for opfor and bluefor, nothing is defined for indepentent or civilian. You want to double check your call line and also check the SLP_units_config.sqf and make sure whatever you are trying to call has the _tanks = [] (array) has something in it.

/*/////////////////////////////////////////////////////////////////////////////////////
When you set up the arrays the pilot class is first, then the crew type classes are second
Example:
_units = [ pilot, crew , units....]

*//////////////////////////////////////////////////////////////////////////////////////
//=============================================================================================================================================
switch (_faction) do 
{    
case 0: //opfor
{
	_Leaderunits = 	["O_Soldier_TL_F","O_officer_F","O_Soldier_SL_F","O_recon_TL_F"];
	_units =	   	["O_helipilot_F","O_crew_F","O_Soldier_F","O_Soldier_lite_F","O_Soldier_GL_F","O_Soldier_AR_F","O_soldier_M_F","O_Soldier_LAT_F","O_medic_F","O_soldier_repair_F",
					"O_soldier_exp_F","O_spotter_F","O_sniper_F","O_Soldier_A_F","O_Soldier_AT_F",
					"O_Soldier_AA_F","O_engineer_F","O_recon_F","O_recon_M_F","O_recon_LAT_F","O_recon_medic_F","O_recon_exp_F","O_recon_JTAC_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_rcws_F"];
	_tanks = 		["O_APC_Wheeled_02_rcws_F"];
	_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"
};
case 1: //bluefor
{
	_Leaderunits = 	["B_officer_F","B_Soldier_TL_F","B_recon_TL_F","B_Soldier_SL_F"];
	_units =		["B_Helipilot_F","B_crew_F","B_Soldier_F","B_Soldier_02_f","B_Soldier_03_f","B_Soldier_lite_F","B_Soldier_GL_F","B_soldier_AR_F",
					"B_soldier_M_F","B_soldier_LAT_F","B_medic_F","B_soldier_repair_F","B_soldier_exp_F",
					"B_spotter_F","B_sniper_F","B_RangeMaster_F","B_Soldier_A_F","B_soldier_AT_F","B_soldier_AA_F","B_engineer_F","B_Competitor_F",
					"B_recon_F","B_recon_LAT_F","B_recon_exp_F","B_recon_medic_F","B_recon_M_F","B_recon_JTAC_F","B_soldier_AAR_F","B_soldier_AAT_F","B_soldier_AAA_F"
					];//,"Underwear_F","B_diver_exp_F","B_diver_TL_F","B_Soldier_diver_base_F","B_diver_F",
	_vehicles = 	["B_MRAP_01_F","B_MRAP_01_gmg_F","B_MRAP_01_hmg_F","B_Quadbike_01_F","B_Truck_01_transport_F","B_Truck_01_covered_F","B_APC_Wheeled_01_cannon_F"];
	_tanks = 		["B_APC_Tracked_01_rcws_F"];
	_helo = 		["B_Heli_Light_01_F","B_Heli_Light_01_armed_F","B_Heli_Attack_01_F","B_Heli_Transport_01_F"];
	_plane =        [];
	_boat = 		["B_Boat_Armed_01_minigun_F","B_Boat_Transport_01_F","B_Lifeboat"];		
	};
case 2: //greenfor	
{
	_Leaderunits = 	["I_Soldier_AR_F","I_Soldier_SL_F","I_Soldier_TL_F"];
	_units =		["I_helipilot_F","I_crew_F","I_Soldier_02_F","I_soldier_F","I_Soldier_lite_F","I_Soldier_A_F","I_Soldier_GL_F","I_Soldier_M_F","I_Soldier_LAT_F",
					"I_Soldier_AT_F","I_Soldier_AA_F","I_medic_F","I_Soldier_repair_F","I_Soldier_exp_F","I_engineer_F","I_helicrew_F","I_officer_F","I_Spotter_F",
					"I_Sniper_F","I_Soldier_AAR_F","I_Soldier_AAT_F","I_Soldier_AAA_F"
					];//"I_Soldier_diver_base_F","I_diver_F","I_diver_exp_F","I_diver_TL_F",
	_vehicles = 	["I_MRAP_03_F","I_MRAP_03_hmg_F","I_MRAP_03_gmg_F","I_Quadbike_01_F","I_Truck_02_covered_F","I_Truck_02_transport_F"];
	_tanks = 		[];
	_helo = 		["I_Heli_Transport_02_F"];
	_plane =		[];
	_boat = 		["I_Boat_Armed_01_minigun_F","I_Boat_Transport_01_F"];		
};
case 3: //Civilian	
{
	_Leaderunits = 	["C_man_1","C_man_1_1_F","C_man_polo_1_F"];
	_units =		["Civilian_F","C_man_1","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_polo_1_F","C_man_polo_2_F","C_man_polo_3_F","C_man_polo_4_F","C_man_polo_5_F","C_man_polo_6_F"];
	_vehicles = 	["C_Offroad_01_F","C_Quadbike_01_F"];
	_tanks = 		[];
	_helo = 		[];
	_plane =		[];
	_boat = 		["C_Rubberboat"];		
};		 		 

/*case #: //Takistan army	
{
	_Leaderunits = 	[""];
	_units =		["pilot class","Crew class","units"];
	_vehicles = 	[];
	_tanks = 		[];
	_helo = 		[];
	_plane =		[];
	_boat =         [];
};		 
*/

If this doen't help or solve the problem, I will probably need to see the error that is in your .rpt.

Share this post


Link to post
Share on other sites

yeah I've seen that but it's the same as your code there - tanks array should have 1 unit namely "O_APC_Wheeled_02_rcws_F", if I try to spawn armor I don't get an error in the rpt I get the error message you defined in SLP_Spawn.sqf namely

hint  format [ "Error: spawnname %1\n\n  _armor array in units_config is empty", _spawnname];

I'm not at my gaming rig right now but I'll investigate further this evening.

---------- Post added at 21:37 ---------- Previous post was at 20:10 ----------

ok tried it again with no success - Ill try and spell out exactly how I'm using it.

Firstly using paramsarray to set how many units to spawn using description.ext

class Params{
   class NoInfantry
   {
       // paramsArray[0]
       title = "Number of Enemy Infantry Groups:";
       values[] = {0,3,5,8,10};
       texts[] = {"No Infantry","Low","Medium","High","Extreme"};
       default = 5;
   };
   class InfantrySize
   {
       // paramsArray[1]
       title = "Size of Enemy Infantry Groups:";
       values[] = {4,6,8,10};
       texts[] = {"Small","Medium","Large","Largest"};
       default = 6;
   };
   class NoWheeled
   {
       // paramsArray[2]
       title = "Number of Enemy Wheeled Vehicles:";
       values[] = {0,1,2,3,4};
       texts[] = {"Number of Wheeled Vehicles","Low","Medium","High","Extreme"};
       default = 2;
   };    
   class NoTracked
   {
       // paramsArray[3]
       title = "Number of Enemy Tracked Vehicles:";
       values[] = {0,1,2,3,4};
       texts[] = {"No Tracked Vehicles","Low","Medium","High","Extreme"};
       default = 1;
   };
   class NoAir
   {
       // paramsArray[4]
       title = "Number of Enemy Air Vehicles:";
       values[] = {0,1,2,3,4};
       texts[] = {"No Air Vehicles","Low","Medium","High","Extreme"};
       default = 1;
   };
};

Then in my mission script to call the units spawning.

_infantry = [(paramsArray select 0),(paramsArray select 1)];
_vehicles = [(paramsArray select 2), 1, true];
_armor = [(paramsArray select 3)];
_air = [(paramsArray select 4)];


0 = ["spawn",[0,0],["target_marker",[25,150]],_infantry,_vehicles,_armor,_air,["defend",300]] spawn SLP_spawn;

Your code in SLP_units_config.sqf

case 0: //opfor    {
       _Leaderunits =     ["O_Soldier_TL_F","O_officer_F","O_Soldier_SL_F","O_recon_TL_F"];
       _units =           ["O_helipilot_F","O_crew_F","O_Soldier_F","O_Soldier_lite_F","O_Soldier_GL_F","O_Soldier_AR_F","O_soldier_M_F","O_Soldier_LAT_F","O_medic_F","O_soldier_repair_F","O_soldier_exp_F","O_spotter_F","O_sniper_F","O_Soldier_A_F","O_Soldier_AT_F","O_Soldier_AA_F","O_engineer_F","O_recon_F","O_recon_M_F","O_recon_LAT_F","O_recon_medic_F","O_recon_exp_F","O_recon_JTAC_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_rcws_F"];
       _tanks =         ["O_APC_Wheeled_02_rcws_F"];
       _helo =         ["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"
   };

Now everything spawns just fine except the armored units.

Error in Rpt

if (_vehgrp_size == -1) then {
if (typename _SLP_ARRAY ==>
 Error position: <== -1) then {
if (typename _SLP_ARRAY ==>
 Error ==: Type Bool, expected Number,String,Object,Side,Group,Text,Config entry,Display (dialog),Control,Network Object,Team member,Task,Location
File H:\DocumentsLinked\Arma 3 - Other Profiles\%7cVOWS%7c%20Desrat\mpmissions\RandomEncountersStratis.Stratis\SLP\scripts\SLP_fnc_spawn.sqf, line 117

Share this post


Link to post
Share on other sites

Nomadd,

Great piece of work here. Is there any way to give the newly spawned group a specific groupname. Either before spawn or after through a trigger, or perhaps the ability to join another existing group? This way I could name them in other triggers.

Thanks

Share this post


Link to post
Share on other sites

@Desrat

I will have to do some testing. To find out why it is throwing that error, in the meantime try this and see if it works

_infantry = [(paramsArray select 0),(paramsArray select 1)];
_vehicles = [(paramsArray select 2), 1, true];
_armor = [(paramsArray select 3),1];
_air = [(paramsArray select 4),1];


["spawn",[0,0],["target_marker",[25,150]],_infantry,_vehicles,_armor,_air,["defend",300]] spawn SLP_spawn;

Let me know. I will not be able to fire up ARMA3 until tomorrow night.

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

@papareap

SLP use to have the capability to name a spawned group, but with all the recent changes it doesn't work anymore. It can be implemented again, I just have not had the time to look into the new commands that BIS has put out.

Share this post


Link to post
Share on other sites
SLP use to have the capability to name a spawned group, but with all the recent changes it doesn't work anymore. It can be implemented again, I just have not had the time to look into the new commands that BIS has put out.

Thank you for your response, I understand about the changes. Maybe when things die down a bit on the changes side, if you have time you could point me in the right direction.

Share this post


Link to post
Share on other sites
Let me know. I will not be able to fire up ARMA3 until tomorrow night.

No change..

Share this post


Link to post
Share on other sites

@Desrat

I took a look and think I might have found the problem (well I found a problem, hopefully this fixes it)

Replace your SLP_fnc_spawn.sqf with the new file

http://www.mediafire.com/download/cb2027y03ak0xiv/SLP_fnc_spawn.sqf

Also make sure in your SLP_init.sqf set everything to 0.

/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
//# 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

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

Give this a try and let me know. If this fixes the problem I will put out a new version of SLP.

Share this post


Link to post
Share on other sites

haven't had chance to check yet, will do when I'm home at the weekend.

Share this post


Link to post
Share on other sites

Sorry man but I'm not home and I can't check the read me, is possibile to spawn the units without an item? Like the NVG for example.

Inviato dal mio GT-I9300 usando Tapatalk 4

Share this post


Link to post
Share on other sites

I will be touch and go for awhile with ARMA. I sold my house, so going to be very busy the next couple of months moving my family. ATM I am not sure where we are moving or how long it will be before I have internet again. SLP is free to be used/changed/modified, if you would be nice enough to keep my name attached to it. Once Desrat lets me know if the last fix I did takes care of his problem I will upload the newest version. I plan on supporting SLP but maybe awhile before I can do anything.

@Antorugby

This is another of the things that SLP used to be able to do but was lost with all the changes made to ARMA3. When(if) live settles down I want to look at reimplementing it.

Share this post


Link to post
Share on other sites

Nomadd, good luck with the move. Hope all goes well for you and your family.

Share this post


Link to post
Share on other sites

apologies for the delay - error however remains.

I'm gonna test a blank mission with only SLP used in the way I want to ensure it's not something I've introduced.

Share this post


Link to post
Share on other sites

managed to fix it by stripping out SLP entirely and starting over - now working flawlessly with your updated code..Thanks

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

×