Jump to content
nomadd

SLP Spawning script

Recommended Posts

Just curious, has the newest DEV build removed some marker files making the debug for AI marker not to work?

Edit : I went back to non dev and they appeared fine.

Edited by Milosan

Share this post


Link to post
Share on other sites

Yeah i'm finding the 'attack' and 'hunt' tasks arent working with this script now - it that likely to be linked to the removal of processInitCommands etc? (sorry im a somewhat of a beginner with scripting) :-)

Share this post


Link to post
Share on other sites

Haven't been keeping up with ARMA3. My father has been in the hospital for the last 2 weeks (he is home now and doing fine). I will try and take a look at what has changed. I just read BIS removed setvehicleinit, which would only break a small part of the SLP script and only if that part was being used. I have know idea about the markers. I will update to latest dev build and take a look.

Share this post


Link to post
Share on other sites

ok I had a chance to look at SLP today. I removed setvehicleinit stuff and have everything working with the latest dev build. I want to do some more tests before I upload the new version. I have been doing some reading on what is to replace setvehicleinit, looks like BIS_fnc_MP will be the animal. Before I spend the time to learn how it works and if it will work, I am going to wait and make sure it is the permanent replacement. I don't want to change everything , just to have to go back and change it all again. When I was doing my tests I noticed CBA and UPS kicking out scripterrors because of setvehicleinit.

Until I have to time to implement whatever changes BIS is going to use instead of setvehicleinit, SLP will lose the ability to process the inits on the spawned units. Hopefully this will not affect too many missions. The spawning,tasks,debug markers etc are all working fine.

Share this post


Link to post
Share on other sites

i can not get this to work

is this what you put in the on act field of a trigger?

0= ["nameofspawn",[side,faction,delay(optional)],[position,offset distance(optional)],[infantry],[vehicles],[armor],[air],[tasks,taskinfo1,taskinfo2](optional),'string for unit init'(optional)] spawn SLP_spawn;

Share this post


Link to post
Share on other sites

Anyone else getting error:

Error in expression <ect 1)-(_dist select 0)));

};

[((_origo select 0) + (_dist * sin _dir)),((_origo>

Error position: <select 0) + (_dist * sin _dir)),((_origo>

Error select: Type Number, expected Array,Config entry

This looks like a bad call to SHK_POS, but I'll be damned if I can figure out the issue...

Edited by StrongHarm

Share this post


Link to post
Share on other sites

Nevermind.. figured it out. I had ["location",1],1] instead of ["location"],1] somehow... it was me not the script.

Share this post


Link to post
Share on other sites

Newest Version

SLP_spawn 3.4

It has been awhile since I have done anything with ARMA. I saw the beta was released and had alittle time so I updated SLP to the beta. The newest version has the class changes and includes the independent faction. I remove the ability of having spawned units process anything in the inits. I may add this feature back at a future date. I did some testing and everything appears to be working.

In game path finding is still an issue in the towns/citys. This has nothing to do with SLP. Units after time just seem to get stuck. Guard rails are still a problem for units, they no longer get stuck on them. They will go prone to go under a guardrail but will never stand up again. Getting units to patrol on water still does not work, but Kronzkys UPS script seems to work find on water. These are a few issues I noticed while testing.

Changelog

-updated to match new classes in beta

-removed setvehicleinit

-some code fixes

-a few typo fixes

Newest Version front page

Share this post


Link to post
Share on other sites

hello, First Thanks for the update, however, it seems the link is not working for me anyone else confirm this?

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!

Edited by Guest

Share this post


Link to post
Share on other sites

Having an issue using the latest version of your script. I was originally calling it from my init.sqf using

0= ["SLP_Spawn",[1,1,2],[sLP_Trig,10],[2,6],[],[],[],["patrol",60]] spawn SLP_spawn;

but for some reason this was not working at all. I was getting "Error undefined variable in expression: slp_spawn".

I then put in a trigger with the same name and copied the same OnAct string from the sample mission just to test, and my units spawn fine, but instead of patrolling, they just run to the trigger and stand there not doing anything. If I load up your test mission it works fine no problems. Any ideas why this is happening, and also why I cannot seem to use your script from my init.sqf, but only in a trigger placed in the editor?

Share this post


Link to post
Share on other sites

I seem to be having an issue with getting the script to run as well. Want to set up a group of enemies that will spawn based on a trigger and hunt the players. Once that enemy is wiped out, another one starts hunting.

I've copied the SLP folder into my mission folder and added "execVM "SLP\SLP_init.sqf"; to my init.sqf. I've left the SLP_init.sqf in it's default state (tried tweaking it a bit to make things work, but just went back to the base till I can figure this out).

I placed 2 Rifleman units on the map (BluFor & OpFor) with 0% probability and I have a trigger on the map that is set to fire once on entry by the players with the following "On ACT:"

hunters = ["huntspawn",[0,0,true],[huntSpawn1],[2,6],[1,2],[1,1],[1,1,"plane"],["hunt",playedPlayers]] spawn SLP_spawn;

Unless I'm formatting this wrong, I thought this would spawn 2 groups of 6 infantry, 1 group of 2 vehicles, 1 group of 1 armored and 1 group of one heli (all Opfor) at the "huntSpawn1" marker and the groups would then go hunt the players (groupname playedPlayers). On mission load and in the briefing I get a "... (paramsarray |#| select 1) ; _Infgrp_size..." Error Zero divisor error pointing at Line 28 in the SLP_init.sqf. I can continue past, but on the firing of the trigger I get a ''Error 0 element provided, 3 expected' error on lines 43, 125 and a "Error Type Any, expected String" error on line 235 in SLP_fnc_spawn.sqf.

I've looked through the demo mission (which seems to work fine) and I can't really find anywhere that I've got anything different than what's in there.

One other quick question on the delay variable. I assume if I leave this empty or put a seconds value in there, the code would just keep churning out new units. But setting the value to True means "All the units must be killed for a new group to spawn." Is that all the units in each individual group, or all the groups spawned together? So if those 5 groups spawn in my above example and the armored group is destroyed, does the code immediately spawn a new armored unit, or does it wait till all the infantry, vehicles and aircraft are destroyed as well?

Edited by MeatballCB

Share this post


Link to post
Share on other sites

@thestuntman

don't use SLP_spawn, try something else. That should fix the problem.

Edit: lol realized the way that sounded when it was read. Don't use "SLP_spawn" as the name,use something else like "spawn1" or "1stspawn" or if you are using a trigger use the name of the trigger. That way if there is a problem you can quickly track it down to which trigger is messing up

@MeatballCB

"plane" can only be used if you have something in the plane array in SLP_units_config.sqf. I used "plane","helo" or "boat" to be able to choose what you want to spawn. If nothing is used then it will default to "helo". In the SLP_units_config.sqf you will find arrays for _plane = []; _helo= []; _boat=[]. The arrays have to be defined. Look at the demo missions to see how I have done it. You can put whatever you want in the arrays, meaning user made vehicles etc. The same goes for units. You can use any vehicle with any faction. If you want opfor to have M1 tanks , you just have to define it in the array.

Also, not sure about playedplayers. Do you have a group named this?

Hope this helps, post any other problems

Edited by Nomadd

Share this post


Link to post
Share on other sites

@MeatballCB

"plane" can only be used if you have something in the plane array in SLP_units_config.sqf. I used "plane","helo" or "boat" to be able to choose what you want to spawn. If nothing is used then it will default to "helo". In the SLP_units_config.sqf you will find arrays for _plane = []; _helo= []; _boat=[]. The arrays have to be defined. Look at the demo missions to see how I have done it. You can put whatever you want in the arrays, meaning user made vehicles etc. The same goes for units. You can use any vehicle with any faction. If you want opfor to have M1 tanks , you just have to define it in the array.

Also, not sure about playedplayers. Do you have a group named this?

Hope this helps, post any other problems

Sweet, I'll give that a shot. I do have a group defined for all the players, but some of the scripts I'm using was choking on them, so I created a cheese group by putting "this = playedPlayers" in the initialization string of all the playable units. This way no matter which units get played I can always use playedPlayers to point scripts at the players (or at least the last player that initialized.)

Thanks!

Share this post


Link to post
Share on other sites

I'll try changing "SLP_Spawn" in my init.sqf version to see if I don't get the script error any more.

I still have the issue of units not moving though if I use the script in the editor.. I had it setup using a trigger named "trg5" and the OnAct

0=["trg5",[1,1],[trg5],[5,[1,2]],[],[],[],["patrol",150]] spawn SLP_spawn;

which is exactly as you have it in your mission file. The units will run to the trigger and just stand there. If i set them up to use UPSMON to handle the movement, the same thing happens.

---------- Post added at 00:05 ---------- Previous post was at 23:49 ----------

Changed "SLP_Spawn" to "SLP_Trig"....(i even put a swear word in there in my frustration too lol) but still getting the same error "Error undefined variable in expression: slp_spawn" even if I use a direct copy\paste from your working mission into my init.sqf (making sure i have a trigger called "trg5" obviously). Is there no way to use your script outside the editor at all? It seems to give that script error no matter how I try and use it in my mission's init.sqf.

Units still move to trigger, get in formation and then just stand there in the editor also

Share this post


Link to post
Share on other sites

@thestuntman

I have used SLP outside the editor in many missions with no problems. If you want send me your mission and I will take a look at it. I don't see any errors in the way you are activating the spawn. Not sure why you are getting "Error undefined variable in expression: slp_spawn".

Share this post


Link to post
Share on other sites

Hey Nomadd, if you're still about, I forgot I asked this as well. Can you clarify how the delay works?

One other quick question on the delay variable. I assume if I leave this empty or put a seconds value in there, the code would just keep churning out new units. But setting the value to True means "All the units must be killed for a new group to spawn." Is that all the units in each individual group, or all the groups spawned together? So if those 5 groups spawn in my above example and the armored group is destroyed, does the code immediately spawn a new armored unit, or does it wait till all the infantry, vehicles and aircraft are destroyed as well?

Share this post


Link to post
Share on other sites

The code will use whatever delay you set to churn out units until the total number of groups has been met. If the delay is set to "true" then every unit of a group will have to be killed before the next group will spawn. It is set for each type, infantry, vehicles,armor,air. Meaning kill all the infantry next infantry group will spawn, kill all the vehicles next vehicle group will spawn etc. The infantry,vehicle,armor,air work independently of each other. If no delay is set the default is 10 sec

Hope that makes sense

Edited by Nomadd

Share this post


Link to post
Share on other sites

@Nomadd

PM'd you a link to my mission to have a look at. Much appreciated. Also forgot to mention i'm running the latest Dev Beta if that makes any difference

Share this post


Link to post
Share on other sites

Man I still can't get this working, but I did find something you might want to add to the readme.

I kept getting errors when the script was launching out of my init, but after looking at your demo mission I noticed in your description.ext you had all those class Params defined there. I added that to my description.ext and that launch error went away.

I copied the folders over directly from your demo mission (which works fine), added the line to my init and those params in the description.ext, but now I keep getting a "Error 0 elements provided, 3 expected" when I try to trigger the spawn. It's happening on lines 43, 125 and 235 in the SLP_fnc_spawn.sqf file. I'm running a radio trigger with the following On act: "0=["trg8",[0,0,2],[huntSpawn1],[[2,3],6],[2,1],[0,0],[1,1],["hunt",test1]] spawn SLP_spawn;" I've got an inisible marker named huntSpawn1 about 100m from my test guy and he's named test1.

I don't see anything different in the files between the demo and my mission other than those tweaks to the On act above, but it's just not running, any thoughts?

Share this post


Link to post
Share on other sites

I figured it out, but don't know why it now works. :) All I did was add quotation marks around the position/marker. My Condition line now reads "0=["HunterSpawn",[0,0,true],["slpSpawn",20],[3,6],[2,1],[],[1,1],["hunt",demoteam]] spawn SLP_spawn;" and it's working like a champ.

Share this post


Link to post
Share on other sites

I am terrible at writing the readme. I know it needs improvement. Don't try and run the line from your init.sqf. There is not enough time for SLP_init.sqf to full initialize. So in effect you are trying to run slp to spawn something before everything that makes it work has been initialized. You can use a delay but I hate putting delays in init.sqf. You would be better off using a seperate .sqf execvm'd from the init.sqf with the slp line in that. At the top use a delay or waituntil {SLP_init == 1};

The params are just there to show another example of how the script can be utilized. You can delete all the params stuff if you like. If you look in the SLP_init.sqf you will see where I tell you if you don't want to use the parmasarray then just make everything 0. All the params stuff does is allow the mission to be changed every time it is played. The host can make changes in the lobby increasing/decreasing the number of units before a mission starts.

The last thing, whenever you use a marker you have to use ""...... "huntspawn1"

Share this post


Link to post
Share on other sites

Yeah, that's working like a charm. Do you know if when the script spawns to hunt a group, whether they'll go after the group even if they're in a vehicle? Or does the group need to be on foot?

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

×