Jump to content
Sign in to follow this  
cervantes

Strange troubls vith EH fired

Recommended Posts

Hi here 🙂

 

i post today for one strange issue with my flak 36 firing script.

A script working perfectly before the first air taget is destroyed.

when the first target is destroyed a script is totaly disturbed and not working.

 

this issue is really strange because is one eprouved script and normaly working without issue.

 

The EH launching is define in config

 

Fired = "[_this select 0,_this select 6] execvm ""\88mm\scripts\88_flak.sqf"";";

 

a script 88_flak.sqf:

 

//_unit = _this select 0;
//_shell = _this select 1;

 

params ["_unit","_shell"];


flak_shrapnels = _unit setvariable ["flak_shrapnels",false];
publicVariable "flak_shrapnels";

_trigger = createTrigger ["EmptyDetector", [0,0,0]];
_trigger setTriggerStatements ["true", "", ""];
_trigger attachTo [_shell, [0, 0, + 0.5]];


while {alive _shell} DO
{
_pos = _trigger modelToWorld [0,0,0];
_targets = _pos nearentities [["Air"],60];
_trigger setpos (_shell modelToWorld [0,0,+ 0.5]);

if !(alive _shell) exitwith {deleteVehicle _trigger;};
sleep 0.1;

if (count _Targets > 0) exitwith 
{
   deleteVehicle _shell;
   flak_shrapnels = _unit setvariable ["flak_shrapnels",true];
   publicVariable "flak_shrapnels";
  _effect = "88mm_flak" createvehicle (_trigger modelToWorld [0,0,0]);
  //[_unit,_trigger] execvm "\88mm\scripts\shrapnel.sqf";
  [_unit,_trigger,_effect] exec "\88mm\scripts\flak88cam.sqs";
};
};

 

If anyone known if this Eh is altered or while loop not correct 🙂

help appreciating ^^

Share this post


Link to post
Share on other sites
5 hours ago, cervantes said:

Hi here 🙂

 

i post today for one strange issue with my flak 36 firing script.

A script working perfectly before the first air taget is destroyed.

when the first target is destroyed a script is totaly disturbed and not working.

 

this issue is really strange because is one eprouved script and normaly working without issue.

 

The EH launching is define in config

 

Fired = "[_this select 0,_this select 6] execvm ""\88mm\scripts\88_flak.sqf"";";

 

If anyone known if this Eh is altered or while loop not correct 🙂

help appreciating ^^

 

Couple of things:

  1.  When asking for help use the code brackets <> button at the top of your reply editor to wrap your code inside one of these:
    /* Your code here */

    Makes everybody happier. Remember to change from HTML to C Languages.
     

  2. You are using this in a few places:
    flak_shrapnels = _unit setvariable ["flak_shrapnels",false];
    publicVariable "flak_shrapnels";

    I don't think this is the cause of your issues but it doesn't do anything useful.
    setVariable returns Nothing which means flak_shrapnels always contains Nothing and the publicVariable call sends Nothing over the net (though probably still generates traffic)
    If you want the value of flak_shrapnels to be the same value on all clients make sure you assign a useful value.
    Just keep in mind that when you start sending global data over the network it can override the state of your scripts on other machines, in your case it seems odd to have flak_shrapnels be equal on all clients so the use of publicVariable is probably incorrect.
     

  3. You aren't giving us the full picture either, when the loop finds a target you're exec-ing a .sqs (which is the older format btw), what are the contents of  "\88mm\scripts\flak88cam.sqs"?

Share this post


Link to post
Share on other sites

this variable is used for select 2 effects.

when this variable to true one other effect is apply.

and i d'ont think that caused this troubls 😉

the sqs script working well why d'ont use that? 😉

is one simple check script camera.

 

how i mean a script working but is after a first plane destroying that troubls appears.

the variables and others scripts do not affect this troubls.

 

i actualy limiting a numbers of my scripts for find a troubls but this script is not affected by others scripts.

alone this script is affected by this troubls.

 

/*

_unit = _this select 0;
_trigger = _this select 1;
_effect= _this select 2;


?(_unit getvariable "FLAK_CAM"):exit;


_camera = "camera" camCreate (_trigger modelToWorld [0,0,0]);
_camera cameraEffect ["internal","back"];
_camera camCommit 0;
flak_CAM = _unit setvariable ["FLAK_CAM",true];
publicVariable "flak_CAM";
setAccTime 0.1;


#cam2
_camera camSetTarget _trigger;
_camera camSetRelPos [0,38,0];
_camera camCommit 0;
?!(alive _effect) or (isnull _effect):goto "exit";
goto "cam2"


#exit
setAccTime 1.0;
~4
player cameraEffect ["terminate","back"];
camDestroy _camera;
setAccTime 1.0;
flak_CAM = _unit setvariable ["FLAK_CAM",false];
publicVariable "flak_CAM";

deleteVehicle _trigger;

*/

 

simple cam script

Share this post


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

this variable is used for select 2 effects.

when this variable to true one other effect is apply.

and i d'ont think that caused this troubls 😉

 

Let me clarify.

 

The missionNamespace variable flak_shrapnels isn't used that way, because it's overriden with Nothing at all places shown.

If you mean you are using the _unit namespace variable flak_shrapnels to select between the effects you can just remove the redundant code, and you should.

 

The reason for this is simple: Getting rid of the publicVariable calls.

publicVariable only broadcasts the variable to the network, nothing else. It does so reliably (resending info if need be) even if the variable broadcast is nil or Nothing.

This means you are currently generating network traffic for something that doesn't need it. With just one or a few object this isn't much but if someone places a lot of your vehicles on the map it's gonna add up.

On top of that the broadcast goes to all clients so larger the player counts is the worse it's going to affect the network.


Here's the changes required to make it not waste network resources, if you don't wanna do it all just get rid of all the publicVariable calls...

Spoiler

In your .sqf file


// Remember to change ["flak_shrapnels",false] to ["flak_shrapnels",true] where appropiate
// Replace this, 
flak_shrapnels = _unit setvariable ["flak_shrapnels",false];
publicVariable "flak_shrapnels";

// With this
_unit setvariable ["flak_shrapnels",false];

Same goes for this in your .sqs file


// Replace this
flak_CAM = _unit setvariable ["FLAK_CAM",true];
publicVariable "flak_CAM";

// With this
_unit setvariable ["FLAK_CAM",true];

 


 

 

2 hours ago, cervantes said:

the sqs script working well why d'ont use that? 😉

is one simple check script camera.

 

Well I guess it depends what standard you hold yourself and your code too. SQS is considered obsolete these days.

 

But you say the flak88cam.sqs works... so when the problem occurs:

  • What kind of behaviour do you expect?
  • What kind of behaviour do you get?

 

 

Share this post


Link to post
Share on other sites

a cam script is optional alternative for observing the flak explosions.

and is enabled when a flak explode.

i try this script without and with and the result is a same 🙂

yes the public variable is for a multiplayer game.

Bi devs advise to use that into sqs script and for a real time informations on the network trafic.

that fix sync of variables and get rid a retard of this informations.

 

i observing that fix also a sync of scripts in sp gametype.

Because this variables is awaiting by others script for selecting différents effects.

 

im not totaly sure because i encoutering always a troubls with my developements.

but a sheduled scripts not working in the same way on the editor and on sp or mp game.

my old scripts worked and after one lot of updates they troubleds.

 

that is one of mysterious issue i encountering ^^

 

this script how you can read.

is a shell range detection from air entities.

and when the entitie is detected in the range the second loop is enabled and the script exit with the effects.

after te first airplane destroying the script is disturbed the second loop not working correctly.

 

and is not executed or the explosions do not explode on the correct position.

Share this post


Link to post
Share on other sites

Hi here finaly i have find a troubls ^^

 

i have focused my search on my custom flak36 88mm scripts.

But the troubls is caused by scripts inside the mission testing directory 😉

 

for that mission test i spawn 2 planes and 2 pilots by script and when the 2 planes is destroyed 2 planes spawn again 🙂

a script attached to this planes create this troubls.

 

i removed this scripts and now my script reworking perfectly 😉

 

Ty for your reply and try to helping me 😉

 

if you want known more on this project you can be read

 

 

and 

 

 

Friendly.

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
Sign in to follow this  

×