Jump to content

dreadpirate

Member
  • Content Count

    537
  • Joined

  • Last visited

  • Medals

Posts posted by dreadpirate


  1. 7 hours ago, Stu13 said:

    Hi there! I apologize if this question has already been answered somewhere, but the continued support and update for this addon makes it very hard to follow what is a current feature, and what replies are already obsolete (too good support, what a strange thing to complain about....)
     

    I am currently trying to build a very large multiplayer mission for a dedicated server, probably spawning close to 50 patrols over whole chernarus. Players are going to move through the map, dispatch patrols, which will respawn after a while.

    My first question is this: Is JEBUS going to be an appropriate tool for me? I dont understand the different ways mods cache/virtualize units, are there differences in the effect on performance?

     

    My second question is more technical: Respawning my patrols works flawless, and so does 'REDUCE='. However, I cant seem to get 'CACHE' to work. I can always see the leader running around on the map, both in Zeus view, but also in the beginning of the mission on the zeus map (without Zeus camera being close to the unit).

    Here is my init line: 0 = [this, "DELAY=", [1,2], "PAUSE=", 1000, "CACHE=", 1500, "REDUCE=", 750] spawn jebus_fnc_main;

     

    PS: maybe this helps. As directed in the first post of this topic, from the latest example mission I did only copy the jebus folder and the description.ext into my mission, not "gaia" or "scripts"

    You can't use CACHE and REDUCE at the same time. REDUCE is taking precedence in this case.

     

    My new version *may* allow me to completely despawn and then rebuild groups, but there are a few technical hurdles to get over first.

     

    Is 50 patrols a lot for JEBUS? Depends on a lot of factors, but mostly how many groups will be active at once. Are your players concentrated in one area, activating only a few groups at a time? Or are they spread out doing different tasks?

     


  2. On 3/12/2020 at 7:30 PM, xtrickyxx said:

    Hey, love the mod. But I am having one minor problem. I want to spawn in Ravage Zombies. There are 3 zombies with this mod: bolter, runner, walker. I cannot get any of them to spawn. I can get normal civilians to spawn. This is another mod, so I can understand why it won't work. Right now I'd like to get one zombie_walker to respawn. I have this in their init: 0 = [this]  spawn jebus_fnc_main; ,<- removing that line to blank, the zombie will spawn in normally.  That line in the init makes any other unit respawn just fine. 

     

    If I use a transport truck, put a civilian driver in it, load it up with ravage zombies and add the init line above on the truck, it works! I use a get out command and a scripted waypoint to my position. The zombies spawn in before the truck, get deleted, then the truck spawns in full of zombies and works fine. Kinda weird. I love Jebus. I really appreciate that you have kept updating this mod. This really should be vanilla. 

     

    It seems that Ravage zombies can't join groups like other units. Seeing as JEBUS relies on groups, it won't work.... at the moment.

     

    I'm working on a JEBUS update which would allow the spawning of individual units, that might make a difference.

     

    I've pretty much rewritten JEBUS from the ground up, making it more modular and easier to read and maintain. Saving and spawning groups is much faster now.

     

    The only real feature I've added is the (optional) ability to recruit JEBUS units to your group. Instead of a recruit script with a menu, just run up to a unit and get him to join you, meaning you can customise loadouts for recruits.

     

    I'm also tinkering with other minor AI enhancements for recruits, like the ability to teleport them if they get stuck and unlimited ammo, so they aren't constantly whining about running out.....

    • Like 1

  3. 10 hours ago, xtrickyxx said:

    Hey, love the mod. But I am having one minor problem. I want to spawn in Ravage Zombies. There are 3 zombies with this mod: bolter, runner, walker. I cannot get any of them to spawn. I can get normal civilians to spawn. This is another mod, so I can understand why it won't work. Right now I'd like to get one zombie_walker to respawn. I have this in their init: 0 = [this]  spawn jebus_fnc_main; ,<- removing that line to blank, the zombie will spawn in normally.  That line in the init makes any other unit respawn just fine. 

     

    If I use a transport truck, put a civilian driver in it, load it up with ravage zombies and add the init line above on the truck, it works! I use a get out command and a scripted waypoint to my position. The zombies spawn in before the truck, get deleted, then the truck spawns in full of zombies and works fine. Kinda weird. I love Jebus. I really appreciate that you have kept updating this mod. This really should be vanilla. 

     

     

     

     

    There may be special Ravage scripts running on zombies that are interfering. You might have to ask in the Ravage thread about spawning zombies via script....

     

    If I get a chance over the weekend, I'll look into it.....


  4. 10 hours ago, guttersnipe said:

    @dreadpirate  enjoying your script very much, it has awakened a desire to make missions after a long absence. Finally, the frame rates I’ve been craving for years! 😍

     

    I know I'm being a bit thick, but I’m getting on a bit now & never was much good with the scripting - if I only want a squad to spawn once (ie just as I put them down in the editor and not returning from the grave) what do number do I use for “LIVES”,x ?     

     

    Is it 0, for no respawn, or 1, as in the Life they spawn with?

     

     

    0 = [this, "LIVES=", 1] spawn jebus_fnc_main;


  5. So, I think most mission makers and scripters have played around with @bangabob's excellent Enemy Occupation System (EOS) at some point:

     

    https://forums.bohemia.net/forums/topic/144150-enemy-occupation-system-eos/

     

    Basically you place a bunch of enemy zone markers, run the script which generates a trigger for each zone and when players enter the trigger, enemies are spawned.

    When players leave the trigger, the enemies are deleted.

    If players clear a zone of enemies, it turns green and no further enemies will spawn there.

    (There is more to it than that, but that's the basics.....)

     

    So, I made a script to auto-generate 100 x 100m markers for map grids with enterable buildings in them.

    On Altis, this creates 3898 markers! (I'm blacklisting some buildings)

     

    I'll blacklist friendly occupied areas and bases, but with EOS, I'll still wind up with over 3000 triggers, checking every 0.5 seconds.

     

    So, my idea is: Instead of having triggers attached to zones checking for players, how about having a script running on players checking for nearby zones?

     

    I modified my script to create Locations for each zone.

     

    Now I can use:

    https://community.bistudio.com/wiki/nearestLocations

    to check if players are near zones and activate them accordingly.

     

    Before I go much further down this rabbit hole, can you veteran scripters tell me: am I wasting my time here?

    Will trading triggers for locations actually save any processing time?

    What are some pitfalls I'll need to look out for in terms of multiplayer and locality?

     

    • Like 3

  6. 14 hours ago, sgtfuzzle17 said:

    Trying to set something up using JEBUS again. I'm using it to limit the range on an air defence VLS - Its got a roughly 10km range by default, so I want to set it up that a trigger spawns the VLS system once OPFOR gets into a trigger over the area they're protecting. The issue is, I need them to despawn after there's no threats present, but with the potential ability to spawn again should threats come back. The way I've currently got it set up (which is working before considering the despawning).

    • VLS placed with "0 = [this] spawn jebus_fnc_main;" in init
    • This is synced to a trigger, with the parameters of "OPFOR present", so once they're "in range", the VLS spawns and fires.

    I know exit triggers are a thing, however from my understanding that's more to do with disabling respawning rather than straight removing a unit. Any ideas?

    Here's the way I did it:

     

    https://drive.google.com/open?id=1ho7oivdkJX580Ls4qgDDaAbxuSeeilq2

     

    (The deactivation code in the trigger deletes the vehicle and its crew when OPFOR has left the area)

     


  7. On 12/17/2019 at 4:51 PM, sgtfuzzle17 said:

    How does setting the "Probability of Presence" attribute in the editor affect spawning within this script? Will the probability be calculated on each respawn leading to potentially different amounts of units in subsequent patrols, or is it just decided on mission start and from there on out respawns will always see the amount set at the start of the mission?

    Second option...


  8. 18 hours ago, slatosniper said:

    @dreadpirate Hey mate. Decided to update the version of Jebus I was using in my missions. I've downloaded the latest one from your github but when I launch into the mission I get the error:

     

    
    '...) then {systemChat "Exiting script."}r; |#|parameters>] spawn
    jebus_fnc_main;
    
    if ...'
    Error Missing ;
    File jebus\fnc_main.sqf [jebus_fnc_main]..., line 477

    This is the entire line for 477: 

    
    if (_debug) then {systemChat "Exiting script."};r parameters>] spawn jebus_fnc_main;

    Any ideas mate? Hopefully its an error I can just ignore.

    Shows how many people use the github, the entire main script was pasted in there twice.....

     

    Fixed now, thanks for the heads up @slatosniper

    • Like 1

  9. On 12/5/2019 at 9:18 PM, sgtfuzzle17 said:

    Alright, thanks. Have you got any tips for how to get the triggers working initially? I can't seem to get the units to spawn off them. Just so we're clear on how its currently set up, I'm using a trigger set to conditions of BLUFOR present, and repeatable. I then have the trigger synced to the leader of a group of two planes, which has the following in its init:

     

    
    0 = [this, "FLYING","RESPAWNMARKERS=", ["G11", "G12"]] spawn jebus_fnc_main;

    It all works fine unlinked from the trigger, but once I've got it linked nothing works. Do I need to add something to the init?

     

    JEBUS doesn't work well with multi-vehicle groups, especially planes. Other than that, your init should work fine. Add "DEBUG" to the init, maybe your trigger isn't firing for some reason.....


  10. On 12/2/2019 at 11:29 PM, sgtfuzzle17 said:

    If I'm using a trigger to spawn a given group and setting it up as repeatable so that if players leave and re-enter the trigger, the group respawns, will the group double up if they re-enter before the group is destroyed? Or will the script see the units are still alive and ignore the trigger?

     

    Edit: To clarify, I can't actually get the triggers working anyway. Standard spawns at scenario start work as intended but I'd like triggers to be in play here to keep the scenario a bit easier to manage and keep the amount of unnecessary units spawned at a minimum.

    The group won't respawn until the whole group is killed AND the trigger is activated...


  11. 18 hours ago, sgtfuzzle17 said:

     

    Got a hand from someone on the /r/armadev subreddit, who was able to walk me through some debugging. Issue was two-fold it seems, but he's got a fix for it - you may want to implement it in your release of the script so the issue doesn't pop up anymore.

     

     

    Thank you @sgtfuzzle17 I will include this fix in the next update.....

     

     

    8 hours ago, Rayjer said:

    Hello all,

    I'm using the script to spawn in ai aircraft to shoot down, the problem I come across is when the pilot ejects alive the script won't respawn another unit/aircraft until the pilot dies.

    Is there a trigger that can be set to delete/kill pilot when vehicle is destroyed?

    Any help would be appreciated thanks!

     

    @Rayjer If you look at the planes in the demo mission, you'll find that JEBUS already has a function called pilotKill that does what you want. Here's an example of how to call it:

    0 = [this, "FLYING", "INIT=", "[_proxyThis] call jebus_fnc_pilotKill"]  spawn jebus_fnc_main;

     


  12. On 11/6/2019 at 12:13 PM, pognivet said:

    Also, some Global Mobilization vehicles, most specifically the West German trucks, spawn half-way inside of the ground when you try to use JEBUS with them. They shoot out of the ground like a cannon when they spawn and blow up and kill everyone. Why this happens is unknown. Doesn't seem to happen to the East German trucks.

     

    I just had a look at this. Seems like the vehicles aren't configured correctly.

     

    As a workaround, look for the following line in fn_main.sqf:

    _newVehicle = createVehicle [_newVehicleType, _newVehiclePosition, [], 0, _special];

    (it's line number 278 if your editor shows line numbers.....)

     

    Add a line *above* that one that reads:

    _newVehiclePosition = [_newVehiclePosition select 0, _newVehiclePosition select 1, (_newVehiclePosition select 2)+ 1.5];

    This will spawn vehicles 1.5 metres above their default position and then they will drop to the ground.....

     

    Unfortunately, this may cause problems for other vehicles, particularly planes that may tip over and get damaged when dropped.....

     

    • Like 1

  13. 27 minutes ago, engima said:

     

    Ok, sorry. Try removing him in ON_UNIT_REMOVING then, which is executed right before the vehicle is removed.

     

    Success! Thank you @engima!!! I'm also experimenting with your Civilian, Ambient Infantry and Patrolled Areas scripts. Everything is working well!

     

    For the record, here is my ConfigAndStart.sqf. I don't know if what I've done will work in a dedicated or headless client environment, but for single player and listen servers it does the job.....

     

    ConfigAndStart.sqf

    Spoiler
    
    /* 
     * This file contains parameters to config and function call to start an instance of
     * traffic in the mission. The file is edited by the mission developer.
     *
     * See file Engima\Traffic\Documentation.txt for documentation and a full reference of 
     * how to customize and use Engima's Traffic.
     */
     
    private ["_parameters"];
    
    _possibleVehicles = [
    	"C_Offroad_01_F"
    	,"C_Offroad_01_repair_F"
    	,"C_Quadbike_01_F"
    	,"C_Hatchback_01_F"
    	,"C_Hatchback_01_sport_F"
    	,"C_SUV_01_F"
    	,"C_Van_01_transport_F"
    	,"C_Van_01_box_F"
    	,"C_Van_01_fuel_F"
    	,"C_Offroad_01_covered_F"
    ];
    
    possibleCivilians = [
    	"C_man_1"
    	,"C_Man_casual_1_F"
    	,"C_Man_casual_2_F"
    	,"C_Man_casual_3_F"
    	,"C_man_sport_1_F"
    	,"C_man_sport_2_F"
    	,"C_man_sport_3_F"
    	,"C_Man_casual_4_F"
    	,"C_Man_casual_5_F"
    	,"C_Man_casual_6_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"
    	,"C_man_shorts_1_F"
    	,"C_man_1_1_F"
    	,"C_man_1_2_F"
    	,"C_man_1_3_F"
    	,"C_Man_Fisherman_01_F"
    	,"C_man_hunter_1_F"
    ];
    
    replaceDriver = {
    	_vehicle = _this select 0;
    	_group = _this select 1;
    	
    	_newDriver = _group createUnit[selectRandom possibleCivilians, getPos _vehicle, [], 20, "NONE"];
    	deleteVehicle (driver _vehicle);
    	waitUntil {isNull (driver _vehicle)};
    	_newDriver moveInDriver	_vehicle;
    };
    
    deleteCrew = {
    	_vehicle = _this select 0;
    	
    	{
    		deleteVehicle _x;
    	} forEach (crew _vehicle);
    };
    
    // Set traffic parameters.
    _parameters = [
    	["SIDE", civilian],
    	["VEHICLES", _possibleVehicles],
    	["VEHICLES_COUNT", 5],
    	["MIN_SPAWN_DISTANCE", 800],
    	["MAX_SPAWN_DISTANCE", 1200],
    	["MIN_SKILL", 0],
    	["MAX_SKILL", 0.1],
    	["ON_UNIT_CREATED", replaceDriver],
    	["ON_UNIT_REMOVING", deleteCrew],
    	["DEBUG", true]
    ];
    
    // Start an instance of the traffic
    _parameters spawn ENGIMA_TRAFFIC_StartTraffic;

     

     

    • Like 2

  14. @engima This is what I tried...... 

     

    The driver is being replaced as I want, but when the vehicle leaves the spawn radius, only the vehicle is deleted and the civilian is either killed or severely injured as the car disappears from under him.....

     

    ConfigAndStart.sqf

    Spoiler
    
    /* 
     * This file contains parameters to config and function call to start an instance of
     * traffic in the mission. The file is edited by the mission developer.
     *
     * See file Engima\Traffic\Documentation.txt for documentation and a full reference of 
     * how to customize and use Engima's Traffic.
     */
     
    private ["_parameters"];
    
    _possibleVehicles = [
    	"C_Offroad_01_F"
    	,"C_Offroad_01_repair_F"
    	,"C_Quadbike_01_F"
    	,"C_Hatchback_01_F"
    	,"C_Hatchback_01_sport_F"
    	,"C_SUV_01_F"
    	,"C_Van_01_transport_F"
    	,"C_Van_01_box_F"
    	,"C_Van_01_fuel_F"
    	,"C_Offroad_01_covered_F"
    ];
    
    possibleCivilians = [
    	"C_man_1"
    	,"C_Man_casual_1_F"
    	,"C_Man_casual_2_F"
    	,"C_Man_casual_3_F"
    	,"C_man_sport_1_F"
    	,"C_man_sport_2_F"
    	,"C_man_sport_3_F"
    	,"C_Man_casual_4_F"
    	,"C_Man_casual_5_F"
    	,"C_Man_casual_6_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"
    	,"C_man_shorts_1_F"
    	,"C_man_1_1_F"
    	,"C_man_1_2_F"
    	,"C_man_1_3_F"
    	,"C_Man_Fisherman_01_F"
    	,"C_man_hunter_1_F"
    ];
    
    replaceDriver = {
    	_vehicle = _this select 0;
    	_group = _this select 1;
    	
    	_newDriver = _group createUnit[selectRandom possibleCivilians, getPos _vehicle, [], 20, "NONE"];
    	deleteVehicle (driver _vehicle);
    	waitUntil {isNull (driver _vehicle)};
    	_newDriver moveInDriver	_vehicle;
    };
    
    // Set traffic parameters.
    _parameters = [
    	["SIDE", civilian],
    	["VEHICLES", _possibleVehicles],
    	["VEHICLES_COUNT", 5],
    	["MIN_SPAWN_DISTANCE", 800],
    	["MAX_SPAWN_DISTANCE", 1200],
    	["MIN_SKILL", 0],
    	["MAX_SKILL", 0.1],
    	["ON_UNIT_CREATED", replaceDriver],
    	["DEBUG", true]
    ];
    
    // Start an instance of the traffic
    _parameters spawn ENGIMA_TRAFFIC_StartTraffic;

     

     


  15. Just now, engima said:

     

    Yes, possible vehicles is an array that goes into the start parameter set as VEHICLES. And the default driver can be replaced using the ON_UNIT_CREATED callback.

     

    And if you want some more control over spawned vehicle classes other than pure random, or number of vehicles during certain times of the day etc, use callback ON_UNIT_SPAWNING.

    I was going to use ON_UNIT_CREATED to delete the driver and add my own, but wouldn't that interfere with managing and despawning the vehicles and units?


  16. 2 minutes ago, jandrews said:

    hey. looks good. just added a whole lot more code for me to filter. have you come across an easy way to use editor made loadouts with EOS? 

     

    Because it was for enemies, I didn't bother with precise loadouts, but if that's what you want it will be a big script.

     

    At that point, you might want to look at creating your own faction.

     

    There are some good tools for doing that like the ALIVE Orbatron or Drongo's Config Generator:

     

    http://alivemod.com/wiki/index.php/ORBAT_Tool

     

    https://steamcommunity.com/sharedfiles/filedetails/?id=1771335720


  17. redressFIA.sqf:

     

    Spoiler
    
    // [this] execVM "redressFIA.sqf";
    
    if (!isServer) exitWith {};
    
    _unit = _this select 0;
    
    _unitType = typeOf _unit;
    
    _possibleUniforms = [
    	"U_IG_Guerilla1_1"
    	,"U_IG_Guerilla1_1"
    	,"U_IG_Guerilla1_1"
    	,"U_IG_Guerilla1_1"
    	,"U_IG_Guerilla1_1"
    	,"U_IG_Guerilla1_1"
    	,"U_IG_Guerilla1_1"
    	,"U_IG_Guerilla1_1"
    	,"U_IG_Guerilla2_1"
    	,"U_IG_Guerilla2_2"
    	,"U_IG_Guerilla2_3"
    //	,"U_IG_Guerilla3_1"
    //	,"U_IG_Guerilla3_2"
    //	,"U_IG_leader"
    	,"U_C_Poor_1"
    //	,"U_C_WorkerCoveralls"
    //	,"U_C_WorkerCoveralls"
    //	,"U_C_WorkerCoveralls"
    //	,"U_C_WorkerCoveralls"
    ];
    	
    _possibleHeads = [
    	"GreekHead_A3_01"
    	,"GreekHead_A3_02"
    	,"GreekHead_A3_03"
    	,"GreekHead_A3_04"
    	,"GreekHead_A3_05"
    	,"GreekHead_A3_06"
    	,"GreekHead_A3_07"
    	,"GreekHead_A3_08"
    	,"GreekHead_A3_09"
    ];
    
    _possibleVoices = [
    	"Male01GRE" 
    	,"Male02GRE"
    	,"Male03GRE"
    	,"Male04GRE"
    	,"Male05GRE"
    ];
    
    _possiblePrimaryWeapons = [
    	"arifle_TRG21_F"
    	,"arifle_TRG20_F"
    	,"arifle_Katiba_F"
    	,"arifle_Katiba_C_F"
    	,"arifle_Mk20_plain_F"
    	,"arifle_Mk20_F"
    	,"arifle_Mk20C_F"
    	,"arifle_Mk20C_plain_F"
    	,"SMG_02_F"
    ];
    
    _possibleGLWeapons = [
    	"arifle_TRG21_GL_F"
    	,"arifle_Katiba_GL_F"
    	,"arifle_Mk20_GL_F"
    	,"arifle_Mk20_GL_plain_F"
    ];
    
    _possibleMarksmanWeapons = [
    	"srifle_DMR_06_olive_F"
    	,"srifle_DMR_06_camo_F"
    	,"srifle_DMR_01_F"
    ];
    
    _possibleMGs = [
    	"LMG_Mk200_F"
    	,"LMG_Zafir_F"
    	,"MMG_01_tan_F"
    ];
    
    _possibleHandguns = [
    	"hgun_ACPC2_F"
    	,"hgun_Pistol_heavy_01_F"
    	,"hgun_Pistol_heavy_02_F"
    	,"hgun_Rook40_F"
    ];
    
    _possibleLaunchers = [
    	"launch_NLAW_F"
    	,"launch_RPG32_F"
    ];
    
    _possibleVests = [
    	"V_BandollierB_khk"
    	,"V_BandollierB_cbr"
    	,"V_BandollierB_rgr"
    	,"V_BandollierB_blk"
    	,"V_BandollierB_oli"
    	,"V_Chestrig_khk"
    	,"V_Chestrig_rgr"
    	,"V_Chestrig_blk"
    	,"V_Chestrig_oli"
    	,"V_TacVest_khk"
    	,"V_TacVest_brn"
    	,"V_TacVest_oli"
    	,"V_TacVest_blk"
    	,"V_TacVest_camo"
    ];
    
    _possibleBackpacks = [
    	"B_AssaultPack_rgr"
    	,"B_Bergen_rgr"
    	,"B_Carryall_oli"
    	,"B_AssaultPack_khk"
    	,"B_FieldPack_oli"
    	,"B_Kitbag_rgr"
    	,"B_TacticalPack_rgr"
    	,"B_TacticalPack_oli"
    ];
    
    _possibleHeadgear = [
    	"H_Shemag_khk"
    	,"H_Shemag_tan"
    	,"H_Shemag_olive"
    	,"H_ShemagOpen_khk"
    	,"H_ShemagOpen_tan"
    ];
    
    _possibleFacewear = [
    	"G_Aviator"
    	,"G_Lowprofile"
    	,"G_Shades_Black"
    	,"G_Shades_Blue"
    	,"G_Shades_Green"
    	,"G_Shades_Red"
    	,"G_Spectacles"
    	,"G_Spectacles_Tinted"
    	,"G_Sport_Blackred"
    	,"G_Sport_BlackWhite"
    	,"G_Sport_Blackyellow"
    	,"G_Sport_Checkered"
    	,"G_Sport_Greenblack"
    	,"G_Sport_Red"
    	,"G_Squares"
    	,"G_Squares_Tinted"
    	,""
    ];
    
    _GLSoldiers = [
    	"B_Soldier_GL_F"
    	,"B_Soldier_TL_F"
    	,"O_Soldier_GL_F"
    	,"O_Soldier_TL_F"
    	,"I_Soldier_GL_F"
    	,"I_Soldier_TL_F"
    ];
    
    _MarksmanSoldiers = [
    	"B_soldier_M_F"
    	,"B_spotter_F"
    	,"B_sniper_F"
    	,"O_soldier_M_F"
    	,"O_spotter_F"
    	,"O_sniper_F"
    	,"I_soldier_M_F"
    	,"I_spotter_F"
    	,"I_sniper_F"
    ];
    
    _ATSoldiers = [
    	"B_soldier_LAT_F"
    	,"B_soldier_AT_F"
    	,"O_Soldier_LAT_F"
    	,"O_Soldier_AT_F"
    	,"O_soldierU_LAT_F"
    	,"O_soldierU_AT_F"
    	,"I_Soldier_LAT_F"
    	,"I_Soldier_AT_F"
    ];
    
    _MGSoldiers = [
    	"B_soldier_AR_F"
    	,"O_Soldier_AR_F"
    	,"O_soldierU_AR_F"
    	,"I_Soldier_AR_F"
    ];
    
    _MedicSoldiers = [
    	"B_medic_F"
    	,"O_medic_F"
    	,"O_soldierU_medic_F"
    	,"I_medic_F"
    ];
    
    _RepairSoldiers = [
    	"B_engineer_F"
    	,"B_soldier_exp_F"
    	,"B_soldier_repair_F"
    	,"O_engineer_F"
    	,"O_engineer_U_F"
    	,"O_soldier_exp_F"
    	,"O_soldierU_exp_F"
    	,"O_soldier_repair_F"
    	,"O_soldierU_repair_F"
    	,"I_engineer_F"
    	,"I_Soldier_exp_F"
    	,"I_Soldier_repair_F"
    ];
    
    _possibleGarmentTextures = [
    	"\a3\characters_f_gamma\Civil\Data\c_cloth1_black.paa"
    	,"A3\Characters_F\Civil\Data\c_cloth1_kabeiroi_co.paa"
    	,"A3\Characters_F\Civil\Data\c_cloth1_bandit_co.paa"
    	,"\a3\characters_f_gamma\Civil\Data\c_cloth1_brown.paa"
    	,"A3\Characters_F\Civil\Data\c_cloth1_v3_co.paa"
    	,"A3\Characters_F\Civil\Data\c_cloth1_v2_co.paa"
    	,"A3\Characters_F\Civil\Data\c_cloth1_co.paa"	 
    ];
    
    _possibleCoverallTextures = [
    	"\A3\characters_f\common\data\coveralls_bandit_co.paa"
    	,"\A3\characters_f\common\data\coveralls_black_co.paa"
    	,"\A3\characters_f\common\data\coveralls_grey_co.paa"
    	,"\A3\characters_f\common\data\coveralls_urbancamo_co.paa"
    ];
    
    removeAllWeapons _unit;
    removeAllAssignedItems _unit;
    removeAllContainers _unit;
    removeHeadgear _unit;
    removeGoggles _unit;
    
    _unit setFace (_possibleHeads call Bis_fnc_selectRandom);
    _unit setSpeaker (_possibleVoices call Bis_fnc_selectRandom);
    
    _unit forceAddUniform (_possibleUniforms call Bis_fnc_selectRandom);
    
    if ((uniform _unit) == "U_IG_Guerilla1_1") then {
    	_unit setObjectTextureGlobal [0, _possibleGarmentTextures call Bis_fnc_selectRandom];
    	if (random 1 > 0.7) then {
    		_unit setobjectTextureGlobal [1, "#(argb,8,8,3)color(0.33,0.31,0.24,0.3)"]; //Olive pants and boots
    	};
    	if (random 1 > 0.7) then {
    		_unit setobjectTextureGlobal [1, "#(argb,8,8,3)color(0.1,0.1,0.1,0.3)"]; //Black pants and boots
    	};
    };
    
    if ((uniform _unit) == "U_C_WorkerCoveralls") then {
    	_unit setObjectTextureGlobal [0, _possibleCoverallTextures call Bis_fnc_selectRandom];
    };
    
    _unit addVest (_possibleVests call Bis_fnc_selectRandom);
    _unit addBackpack (_possibleBackpacks call Bis_fnc_selectRandom);
    _unit addHeadgear (_possibleHeadgear call Bis_fnc_selectRandom);
    _unit addGoggles (_possibleFacewear call Bis_fnc_selectRandom);
    {_unit linkItem _x} forEach ["ItemMap","ItemCompass","ItemWatch","ItemRadio"];	
    _unit addItem "FirstAidKit";
    
    //Add LMG for Autorifleman, otherwise give rifle
    if (_unitType in _MGSoldiers) then { 
    	[_unit, (_possibleMGs call Bis_fnc_selectRandom), 6] call BIS_fnc_addWeapon;
    } else {
    	if (_unitType in _GLSoldiers) then {
    		{_unit addMagazine "1Rnd_HE_Grenade_shell"} forEach [1,2,3,4,5,6];
    		[_unit, (_possibleGLWeapons call Bis_fnc_selectRandom), 6] call BIS_fnc_addWeapon;
    	} else {
    		if (_unitType in _MarksmanSoldiers) then {
    			[_unit, (_possibleMarksmanWeapons call Bis_fnc_selectRandom), 6] call BIS_fnc_addWeapon;
    			_unit addPrimaryWeaponItem "optic_Hamr";
    		} else {
    			[_unit, (_possiblePrimaryWeapons call Bis_fnc_selectRandom), 6] call BIS_fnc_addWeapon;
    		};
    	};
    };
    
    [_unit, (_possibleHandguns call Bis_fnc_selectRandom), 4] call BIS_fnc_addWeapon;
    
    //Give AT weapon where appropriate
    if (_unitType in _ATSoldiers) then { 
    	[_unit, (_possibleLaunchers call Bis_fnc_selectRandom), 3] call BIS_fnc_addWeapon;
    };
    
    //Give Medikit to Medics
    if (_unitType in _MedicSoldiers) then {
    	_unit addItemToBackpack "Medikit";
    	{_unit addItemToBackpack "FirstAidKit";} forEach [1,2,3,4,5,6,7,8,9,10];
    };
    
    //Give Toolkit to Engineers, etc.
    if (_unitType in _RepairSoldiers) then {
    	_unit addItemToBackpack "ToolKit";
    	_unit addItemToBackpack "MineDetector";
    	{_unit addItemToBackpack "FirstAidKit";} forEach [1,2];
    };
    
    {_unit addItem "HandGrenade"; _unit addItem "SmokeShell";} forEach [1,2,3];
    
    _primaryMagazineArray = getArray (configFile >> "CfgWeapons" >> (primaryWeapon _unit) >> "magazines"); 
    
    _i = 1;
    while {((load _unit) < 0.4) && (_i < 6)} do {
    	_unit addMagazine (_primaryMagazineArray select 0);
    	_i = _i + 1;
    };

     

     

    • Like 1

  18. On 10/20/2019 at 10:08 PM, sgtfuzzle17 said:

    Hi, I'm getting an issue whenever an air group that I'm testing with the script spawns. I'm calling the script in the group leader's init with the following code. I've also tried putting the script in the group init rather than just the leader's.

    
    0 = [this, "FLYING"] spawn jebus_fnc_main;

    but for some reason, I get a script error pop up stating

    
    11:19:19 Error in expression <tpointsDamageList select _vehicleIndex) select 2;
    {
    _newVehicle setHitPointDamag>
    11:19:19   Error position: <select 2;
    {
    _newVehicle setHitPointDamag>
    11:19:19   Error Zero divisor
    11:19:19 File jebus\fn_main.sqf [jebus_fnc_main]..., line 287
    11:19:20 Error in expression <tpointsDamageList select _vehicleIndex) select 2;
    {
    _newVehicle setHitPointDamag>
    11:19:20   Error position: <select 2;
    {
    _newVehicle setHitPointDamag>
    11:19:20   Error Zero divisor
    11:19:20 File jebus\fn_main.sqf [jebus_fnc_main]..., line 287

    It doesn't seem to be malfunctioning in terms of practical application but I just want to be sure I'm implementing this right and not making any stupid syntax errors. Any ideas?

    I can't recreate this error. Are you using vanilla aircraft or modded?

     

    On 10/8/2019 at 11:38 PM, avibird 1 said:

    @anfo the problem is when you use custom mechanized or motorized groups. For example a transport truck with 16 infantry units that you group with the transport truck after a while the script starts to double spawn in the truck and units! 

     

    The issue may be how the units get into the truck? What I've noticed so far if I place the units into the truck through the editor drag-and-drop the issue occurs at a very high rate but if I use the command moveindriver and movein cargo it occurred very rarely in my testing the mission last night.

     

    It also does not appear to be an issue with Jeeps with few units like 3-4 units more testing needed to see if this is 100%.

     

    A consideration I have not seen the issue with only infantry units. So the question is does it have something to do with the group leader and the jebus code in it's init and when he spawns into the trunk the double spawn occurs? 

     

    The "START=" will help with lag but what is considered a lot of groups using JEBUS in a mission?

     

    @avibird 1 Try putting the JEBUS init code in the *group* init rather than the leader. I think this is what is causing the problem.....

     

    If you're spawning 3 JEBUS groups at once using "START=", use:

    0 = [this] spawn jebus_fnc_main;

    0 = [this, "START=", 10] spawn jebus_fnc_main;

    0 = [this, "START=", 20] spawn jebus_fnc_main;

    This will space out the spawns, reducing lag.....

     

    It's hard to say how many groups is too many for JEBUS. A lot depends on your PC's performance.

     

    One of the problems with JEBUS is having multiple groups respawning at once causing lag. One solution may be to have a central JEBUS respawning queue, which will make sure groups respawn one at a time. But that requires a *major* rewrite that I'm not really up to doing at the moment.....

    • Thanks 1
×