Jump to content

Recommended Posts

I have a mission that I have to get done by Sunday, and I think I'm having a locality issue.
It's weird, units are spawning when people join or jog out, regardless of what the triggers conditions are, however, the vehicles spawn on time every time, but, the units delete from the crew on log in or out. So, I'm positive it's a locality issue, or a server syncing issue with the trigger possibly ??
It is also not a dedicated server, just a game server so I'm told, and, works flawlessly in single player naturally 

PLease HALP


Call method
null = [this] execVM "IQ_Spawn\RED\IQ_A13.sqf";

if (isServer) then {

_a13 = [[3596.33,11325.9], EAST, ["rhs_msv_emr_sergeant","rhs_msv_emr_arifleman","rhs_msv_emr_grenadier","rhs_msv_emr_RShG2","rhs_msv_emr_junior_sergeant"],[],[],[],[],[],265.921] call BIS_fnc_spawnGroup;

{
    [_x] execVM "IQ_Skill\RedCon\RedCSkill.sqf";
    //[_x] execVM "IQ_Load\RedL\Adv_Load_ISIS.sqf";
    [_x] execVM "IQ_INIT\RedInit\Rin.sqf";
} forEach units _a13;

_a13wp1 = _a13 addWaypoint [[3828.04,10900.5], 0];
    _a13wp1 setWaypointType "MOVE";
    _a13wp1 setWaypointSpeed "NORMAL";
    _a13wp1 setWaypointBehaviour "AWARE";
    _a13wp1 setWaypointFormation "LINE";
    _a13wp1 setWaypointCombatMode "RED";
    _a13wp1 setWaypointCompletionRadius 5;
    _a13wp1 setWaypointDescription "Move here.";
};

 

Share this post


Link to post
Share on other sites

Where are you calling this from?

 

init.sqf will be executed every time a player joins the mission, have a read.

If you put it inside initServer.sqf then the isServer check is redundant.

 

Also use CfgFunctions instead of execVMing stuff a lot.

execVM is okay if you need it to run once and preferably only upon mission start, for something that runs during mission runtime for multiple units without delay it's better to set up your own function library.

You only ever need to set it up once then you can easily port all your functions from one mission to another one.

 

Cheers

 

  • Like 2

Share this post


Link to post
Share on other sites

What he said Î 😉
Also you don't need [this] if you're not going to use parameters in your script
 

58 minutes ago, 3l0ckad3 said:

null = [this] execVM "IQ_Spawn\RED\IQ_A13.sqf";

Share this post


Link to post
Share on other sites

I call it from IQ_Spawn\RED\IQ_A13.sqf, so, it has its own space, helps keeps things tidy as well, I'd never call it from the init.sqf, I don't even use init.sqf anymore, I use  initServer.sqf now, from all the threads I've read init.sqf is redundant now.

My only problem with running multiple spawn calls through the initServer is that I wouldn't want all the units to spawn at once, I use this method because I can spawn large amounts of units, when I need them, and delete them and their empty group just to respawn them again.

I'll look at your functions idea, my whole aim has been to push myself to learn as of late, so, I'm certainly not afraid to sit in my editor, you should see my hours on ARMA lol like 20k

However, could you help me with an example that could get me back into a flow, because I'm REALLY late, and our campaign finale is on Sunday, and this just curb stomped me into a corner after testing it on the unit server. 😕

Share this post


Link to post
Share on other sites
44 minutes ago, Grumpy Old Man said:

Where are you calling this from?

 

init.sqf will be executed every time a player joins the mission, have a read.

If you put it inside initServer.sqf then the isServer check is redundant.

 

Also use CfgFunctions instead of execVMing stuff a lot.

execVM is okay if you need it to run once and preferably only upon mission start, for something that runs during mission runtime for multiple units without delay it's better to set up your own function library.

You only ever need to set it up once then you can easily port all your functions from one mission to another one.

 

Cheers

 


And yeah, I'm trying to get out of execVming, been doing lots of reading on remoteExec spawns and calls, and a few other methods, I know it is a bad habit to overload the scheduler 

Share this post


Link to post
Share on other sites
9 minutes ago, Mr H. said:

What he said Î 😉
Also you don't need [this] if you're not going to use parameters in your script
 


Actually I knew better tbh, I have no clue why that is there. 

  • Haha 1

Share this post


Link to post
Share on other sites
18 minutes ago, 3l0ckad3 said:

from all the threads I've read init.sqf is redundant now.

nonsense. it depends on task

Share this post


Link to post
Share on other sites
13 minutes ago, sarogahtyp said:

nonsense. it depends on task


Tbh, I find that initServer serves the same purpose, but obviously I wouldn't know any better, I have looked it up and read some threads on it, and most threads I read had most people in agreeance that it had little to no use, but, with my limited understanding I'd have to take their word for it. I do A LOT of reading, but some of the deeper arguments are out of my grasp. 

 

Share this post


Link to post
Share on other sites
1 hour ago, 3l0ckad3 said:

I call it from IQ_Spawn\RED\IQ_A13.sqf, so, it has its own space, helps keeps things tidy as well, I'd never call it from the init.sqf, I don't even use init.sqf anymore, I use  initServer.sqf now, from all the threads I've read init.sqf is redundant now.

This doesn't explain the problem you're having.

You described your problem that units spawn when people join or log out, which would indicate init.sqf or initPlayerLocal.sqf executing the spawn script (or disconnect event scripts/eventhandlers).

Unless you exactly state from which file/function/trigger you're execVMing your spawn script it's hard to tell what's causing it.

Also check every file twice, forgetting to delete stuff after doing some testing runs can also lead to weird/unwanted stuff, heh.

 

Cheers

 

Share this post


Link to post
Share on other sites

Yeah, I'm sorry. The units don't spawn, even if the trigger is activated, they only spawn when players join or leave, I'll show you the files you're referencing..
But, oddly enough the vehicles still spawn, but, if someone leaves the server, or joins, the units spawn or delete, it is so weird. 


initPlayerLocal.sqf

waitUntil {alive player};
enableSaving [false, false];

player setUnitTrait ["camouflageCoef",0.3];

["InitializePlayer", [player]] call BIS_fnc_dynamicGroups;



initServer.sqf

["Initialize"] call BIS_fnc_dynamicGroups;



[
    1000, // seconds to delete dead bodies (0 means don't delete)
    500, // seconds to delete dead vehicles (0 means don't delete)
    500, // seconds to delete immobile vehicles (0 means don't delete)
    1000, // seconds to delete dropped weapons (0 means don't delete)
    3600, // seconds to deleted planted explosives (0 means don't delete)
    3600 // seconds to delete dropped smokes/chemlights (0 means don't delete)
] execVM 'repetitive_cleanup.sqf';



 /* --- testing ---
_b1fltrg = createTrigger ["EmptyDetector", [3522.32,11539.6,0], true];
_b1fltrg   setVariable ["DELRED1", _this];
_b1fltrg   setTriggerArea [1111, 1111, -0, false];
_b1fltrg   setTriggerType "NONE";
_b1fltrg   setTriggerActivation ["EAST", "PRESENT", true];
_b1fltrg   setTriggerStatements [
"REDSRG1 in thisList && isTouchingGround REDSRG1", "{if ((_x != player) && {(side _x) == east && {_x distance DELRED1 <= ((triggerArea DELRED1) select 0)}}) then {deleteVehicle _x;};} forEach allUnits; hint ""WORKS""", ""];
*/




I don't have access to their server yet, so, I want to do a bunch of footwork tonight so I can get back to troubleshooting the issue.
It works just fine on single local hosting, but, when more than one person connects the issues start..

And thnx for pushing me off to the functions, when I'm done with this mission I'm going to start trying my hand at them. 

Share this post


Link to post
Share on other sites

The code you posted in the first post doesn't show anywhere in the files you just posted, kinda weird, since you mentioned you run it from initServer.sqf, yet there's nothing even remotely related to unit spawning, neither are you spawning any vehicles in any of the code snippets you posted up to now, unless I missed something.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites
On 6/1/2019 at 4:00 AM, Grumpy Old Man said:

The code you posted in the first post doesn't show anywhere in the files you just posted, kinda weird, since you mentioned you run it from initServer.sqf, yet there's nothing even remotely related to unit spawning, neither are you spawning any vehicles in any of the code snippets you posted up to now, unless I missed something.

 

Cheers


 Oh
I didn't provide all the snippets, because I wanted to keep this post fairly short, however, it is the exact same script, I just copy pasted it from another sqf that was shortened, and the problem remain on this one too..  I'm confident that if I find the solution to this problem, I'll find a problem to all the issues for the multiple sqfs I'm running in this mission to spawn troops.

Let's say BLU is present in a trigger, after, mission start, it calls this script, I do not want the units spawn at mission start, just when I need them. I only added the IsServer so that only the server runs the block, and not every client, or one group would turn into multiple groups depending on how many clients are connected to the server.

I'll leave what I have below on the vehicles, but they spawn fine for some reason, it is the units that delete out of it when people join, or disconnect, and, same with the units that I spawn, like what is provided above. But here is what you were inquiring about. 

Sorry for the belated reply, doing renos on my house, busy busy 

 

// Alpha East  null = [this] execVM "IQ_Spawn\RED\IQ_R_TRUCK1.sqf";
//_rtruck1 = [];
//_rt1crew = [];

if (isServer) then {

_rt1crew = creategroup EAST;
_rtruck1 = [[3818.07,11259.9], EAST, ["rhs_tigr_sts_msv"], _rt1crew] call BIS_fnc_spawnGroup;

{
    [_x] execVM "IQ_INIT\RedInit\Rin.sqf";
    //[_x] execVM "IQ_Load\RedL\RLoad.sqf";
    [_x] execVM "IQ_Skill\RedCon\RedCSkill.sqf";
} forEach units _rt1crew;

_rt1wp1 = _rtruck1 addWaypoint [[3924.22,10844.8], 0];
    _rt1wp1 setWaypointType "MOVE";
    _rt1wp1 setWaypointSpeed "NORMAL";
    _rt1wp1 setWaypointBehaviour "AWARE";
    _rt1wp1 setWaypointFormation "LINE";
    _rt1wp1 setWaypointCombatMode "RED";
    _rt1wp1 setWaypointCompletionRadius 5;
    _rt1wp1 setWaypointDescription "Move here.";

_rt1wp2 = _rtruck1 addWaypoint [[4223.9,10441.4], 0];
    _rt1wp2 setWaypointType "HOLD";
    _rt1wp2 setWaypointSpeed "NORMAL";
    _rt1wp2 setWaypointBehaviour "AWARE";
    _rt1wp2 setWaypointFormation "LINE";
    _rt1wp2 setWaypointCombatMode "RED";
    _rt1wp2 setWaypointCompletionRadius 5;
    _rt1wp2 setWaypointDescription "Move here.";
    _rt1wp2 setWaypointStatements [" this setFuel 0; true", ""];


 };



skill script

 

_unit = _this select 0;
_unit setSkill ["aimingspeed", 0.3];
_unit setSkill ["spotdistance", 0.9];
_unit setSkill ["aimingaccuracy", 0.6];
_unit setSkill ["aimingshake", 0.5];
_unit setSkill ["spottime", 0.6];
_unit setSkill ["commanding", 1];
_unit setSkill ["general", 0.1];
_unit setskill ["Endurance", 0.1];
_unit setskill ["courage", 1];
_unit setskill ["reloadSpeed", 0.5];
_unit setUnitAbility 0.5;
//RedInit\Rin.sqf";

_unit = _this select 0;

_unit allowFleeing 0;
_unit allowDamage true;
_unit enableFatigue false;
_unit enableStamina false;

 

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

×