Jump to content
dreadpirate

Jebus - Just Editor Based Unit Spawning

Recommended Posts

@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?

 

Share this post


Link to post
Share on other sites
16 hours ago, 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?

 

 

Can I ask if this occurs in vanilla? Whenever I have an issue like this, I make sure I strip it down to no mods first, before considering if Jebus is responsible.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Does

On 10/26/2019 at 4:32 PM, dreadpirate said:

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

 

@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.....

Yeah, spacing out the spawns helps immensely. I highly recommend this and also if you put the spawning groups close to each other and they're using vehicles I'd give it about 30 seconds in between spawns so nothing glitches out in a weird way and kills people or blows up.

 

Does anyone know how to get transport vehicles working such as a helicopter while using this?

 

I've already been able to write a couple scripts where units will use trucks to drive around and get out of them to fight and get back in and drive off once the battle is over, but the squad leader of the infantry squad has to be the one driving it.

 

I've achieved some success in two WW2 scenarios, one set on D-Day and another in the Pacific. They're both large-scale invasions using landing craft. I was able to write a script that spawns a landing craft and puts a squad inside of it, along with giving the landing craft the waypoint necessary to unload the squad so they can do whatever they're supposed to. All you have to do is run this script in the init of a squad leader of a group and place him in the middle of the water and the script takes care of the rest:

 

Spoiler

_unit = _this select 0;

//Summons a boat using black magic
_boatarray = [getPos _unit, 200, "LIB_LCVP", INDEPENDENT] call bis_fnc_spawnvehicle;
_boat = _boatarray select 0;

//This is just to give them the D-Day style gear with the gas-mask bag and shit
removeBackpack driver _boat;
driver _boat addBackpack "B_LIB_US_Backpack_dday";

//Moves the squad leader into the landing craft cargo positions
{_x moveInCargo _boat} forEach units group _unit;

//This just finds a random safe place along the beach for the landing craft to do its duty
_pos1 = [getPos gl1, 0, 1500, 1, 1, 0, 1] call BIS_fnc_findSafePos;

//Disable a bunch of the AI of the landing craft driver so he doesn't freak out and do something stupid once bullets start flying
driver _boat disableAI "FSM";
driver _boat disableAI "AUTOTARGET";
driver _boat disableAI "TARGET";
driver _boat disableAI "SUPPRESSION";
driver _boat disableAI "COVER";
driver _boat disableAI "LIGHTS";
driver _boat disableAI "AUTOCOMBAT";

//Create a waypoint at the safe position found earlier and send this bastard there full speed ahead. Also once he gets there enable all the AI for the squad right before the ramp drops(which I disabled in their init in the editor so they don't freak out and jump out of the boat 2 miles at sea).
_wp0 = (group driver _boat) addWaypoint [_pos1, 0, 0];
_wp0 setWaypointBehaviour "CARELESS";
_wp0 setWaypointStatements ["true", "{_x enableAI 'ALL'} forEach units group _unit"];
_wp0 setWaypointSpeed "FULL";
_wp0 setWaypointType "MOVE";
_wp0 setWaypointCompletionRadius 25;

//Makes another waypoint on top of the other one whose only purpose is to drop the ramp and kick the squad out of the boat
_wp1 = (group driver _boat) addWaypoint [_pos1, 0, 1];
_wp1 setWaypointBehaviour "CARELESS";
_wp1 setWaypointSpeed "FULL";
_wp1 setWaypointType "SCRIPTED";
_wp1 setWaypointScript "WW2\Core_f\WW2_System_Curator_F\waypoints\fn_wpSeaAssault.sqf";

//Just sets the landing craft driver on his first waypoint
(group driver _boat) setCurrentWaypoint _wp0;

_grp = group _unit;

//This just takes a MOVE waypoint that the group already has and sticks it in a random position 5 meters from the boat give or take so the squad gets the hell away from it once they disembark
[_grp, 0] setWaypointPosition [_pos1, 5];

_grp setCurrentWaypoint [_grp, 0];

//Just an insurance policy on re-enabling the AI for the squad
waitUntil {({_x in _boat} count (units _grp) == 0) or (count (units _grp) == 0)};
{_x enableAI "ALL"} foreach units _grp;

//Re-enable the landing craft driver's AI so he can do whatever he wants now that his job is complete
driver _boat enableAI "FSM";
driver _boat enableAI "AUTOTARGET";
driver _boat enableAI "TARGET";
driver _boat enableAI "SUPPRESSION";
driver _boat enableAI "COVER";
driver _boat enableAI "LIGHTS";
driver _boat enableAI "AUTOCOMBAT";

 

 

The only problem is that if I try to use this script or something similar to spawn a helicopter or an APC or a truck or whatever it just flat out doesn't work. I tried using:

 

Spoiler

_unit = _this select 0;
_gl = _this select 1;

{_x allowDamage false} forEach units group _unit;

_boat = "uns_UH1D_m60" createVehicle position _unit;
sleep 1;
_group = createGroup [west, true];

createVehicleCrew _boat;

{_x moveInCargo _boat} forEach units group _unit;

_pos1 = [getPos _gl, 0, 1500, 20, 0, 0.3, 0] call BIS_fnc_findSafePos;
_pos1pad = "Land_HelipadEmpty_F" createVehicle _pos1;

driver _boat disableAI "LIGHTS";
_boat setCollisionLight false;

_wp0 = (group driver _boat) addWaypoint [_pos1, 0, 0];
_wp0 setWaypointBehaviour "CARELESS";
_wp0 setWaypointSpeed "NORMAL";
_wp0 setWaypointType "TR UNLOAD";
_wp0 setWaypointCompletionRadius 25;
_wp0 setWaypointStatements ["true", "{unassignVehicle _x} forEach units group _unit;group _unit leaveVehicle _boat;_bs = (group _unit) addWaypoint [_pos1, 0, 0];_bs setWaypointType 'GETOUT';(group _unit) setCurrentWaypoint _bs;"];

_wp1 = (group driver _boat) addWaypoint [exitGl, 0, 1];
_wp1 setWaypointType "MOVE";

_wp2 = (group driver _boat) addWaypoint [exitGl, 0, 2];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointStatements ["true", "{deleteVehicle _x} forEach units group driver _boat;deleteVehicle _boat"];

(group driver _boat) setCurrentWaypoint _wp0;

{_x allowDamage true} forEach units group _unit;

 

 

Obviously I left the variables the same and just changed the classnames so "_boat" refers to the helicopter, but you get the idea. When I do it like this the heli spawns and seems to work somewhat. I'll fly off to where it's supposed to drop the troops, but it refuses to ever land or drop anyone off and instead skips to its next waypoint. I've tried other variations using other methods of spawning vehicles and putting crew in them, but the results I got were less successful and varied from the vehicle refusing to spawn whatsoever, to it spawning fine but never moving no matter what, to it spawning with no simulation and being stuck that way, to a bunch of other problems. Just can't figure it out, wondering if someone else had yet. Also wanted to share what info I've collected on how to do it, at least with boats. I think I'm on the cusp of solving the helicopter dilemma but I need like-minded thinkers to build upon what I've started.

 

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.

Share this post


Link to post
Share on other sites
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

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

×