axeman Posted January 7, 2015 Report Share Posted January 7, 2015 A quick question for you guys making the mods. If you are having the issue with no AI to player damage initially, do you have the built in Anti Hack enabled or disabled ? thanks for your time, axeman. Link to comment Share on other sites More sharing options...
KiloSwiss Posted January 7, 2015 Report Share Posted January 7, 2015 Enabled.I run my test server with the default settings.The problem is, in the file "\compile\epoch_player\EPOCH_server_loadPlayer.sqf" located in the "a3_epoch_server.pbo" where the Server sets "allowDamage" to "false" on the player object (but only does this for the first time the client spawns in).For anyone interested in how to "fix" this:A simple fix for this is, to wait until the player object returns the variable "SETUP" with true (because this happens after allowDamage is set to false) and then simply use "allowDamage true" on the player object.After that, everything works fine, AI spawned by the Server can kill the player and so far I have not seen any EPOCH vanilla script or function being broken or showing unwanted behaviour after adding this "fix" to my AI Mission System (currently not released version).So may I ask You a question back:Why do You even need to have this line "_av allowDamage false;" in the Script and could You change "allowDamage" back to "true" after whatever You needed to set this command to "false" in the first place?Another question (not relatet to this topic directly) is in the spoiler:In the fileYou have this line of CodeonPlayerConnected{"EpochServer" callExtension format["001|%1",_uid]};Could You please use the A3 function "BIS_fnc_addStackedEventHandler" instead, so addon creators do not need to do ugly workarounds like waiting until a global variable after this line is defined in Your code to add their stackedEH for "onPlayerConnected".If You need an example, here You have one:waitUntil{!isNil "epoch_centerMarkerPosition"}; ["KS_Random_id", "onPlayerConnected", "KS_fnc_allowPlayerDamage"] call BIS_fnc_addStackedEventHandler;If I don't wait until the variable "epoch_centerMarkerPosition" gets defined, my stacked EH for "onPlayerConnected" simply gets overwritten by the "blank" use of "onPlayerConnected" in Your code.For now, the method I'm showing you here does work, but what if You change the Name of the Variable or decide to define this variable before adding Your "onPlayerConnected" eventHandler?Please use "BIS_fnc_addStackedEventHandler" when ever possible, it was added by BIS exactly for such compatibility reasons.Sorry for my bad writing, but I'm in a hurry, will later have more time if You have some questions or want to discuss some details.Greez KiloSwiss Link to comment Share on other sites More sharing options...
1Man Posted January 7, 2015 Report Share Posted January 7, 2015 I run 2 seperate mission systems server side and 1 client side and have not had any issues with AI to client damage. Link to comment Share on other sites More sharing options...
axeman Posted January 7, 2015 Author Report Share Posted January 7, 2015 Also been testing with missions and have not run into the issue yet, have seen that setting and where it is enabled again. KiloSwiss, to answer your question, I don't know the exact answer, I am just getting back into the sqf to continue with the mission system I started on a while back, but from experience with A2, spawning a player in and applying the persistence is not altogether straight forward, especially when dealing with players logging / losing connection / deliberately disconnecting. I suspect it will be to do with transfer from 'debug' to real in-game life. Is also a question myself and Skaronator are looking at.. Edit: And Skaro has a fix :) Link to comment Share on other sites More sharing options...
Darth_Rogue Posted January 7, 2015 Report Share Posted January 7, 2015 Kilo I think their intent is to prevent players from somehow taking damage in the spawn building (cloning facility). It's possible that a scripter could find their way into the building and massacre freshies. Using setdamage to false on first spawn would fix that. But if they would change it to setdamage true after a player teleports out of it then the problem would be solved. Link to comment Share on other sites More sharing options...
Face Posted January 7, 2015 Report Share Posted January 7, 2015 The "allowDamage false" has been an infuriating issue to fix due to the problems it causes to AI addons. It only prevents damage caused by server sources (ie: AI spawned by server) but not damage caused by players. There isn't any server-spawned AI in vanilla Epoch so it's strange why allowDamage is needed. If it's to prevent damage to the player unit between the time it's created on the server and transferred to the player's control, then "allowDamage true" needs to be invoked on the player unit once the transfer is complete. At the moment I'm using a constant server-side loop to apply a one-time "allowDamage true" to each connecting player to allow server-sourced damage but this not an optimal solution. Using a stacked onPlayerConnected eventhandler to apply "allowDamage true" once to each connecting player could have been an easy workaround but Epoch's use of the old non-stacked onPlayerConnected EH prevents this. TheVampire 1 Link to comment Share on other sites More sharing options...
KiloSwiss Posted January 7, 2015 Report Share Posted January 7, 2015 I'm using a stacked "onPlayerConnected" EH to set allowDamage true on the player object.I released it in a small, simple to use addon form yesterday, but the thread is still not approved by one of the mods. Link to comment Share on other sites More sharing options...
Face Posted January 7, 2015 Report Share Posted January 7, 2015 @KiloSwiss: Does your stacked EH work? I can't seem to get even a basic OPC EH to perform a simple diag_log even though I verified the EH was added. I assumed it was Epoch's non-stacked EH that was overriding it. Link to comment Share on other sites More sharing options...
KiloSwiss Posted January 7, 2015 Report Share Posted January 7, 2015 Yes it works. Look at the spoiler in my first post, that's how I make sure the stacked EH does not get overwritten (or overrided?) by the blank "onPlayConnected" EH in the Epoch scripts. Greez KiloSwiss Link to comment Share on other sites More sharing options...
TheVampire Posted January 7, 2015 Report Share Posted January 7, 2015 Looking forward to seeing this resolved. KiloSwiss 1 Link to comment Share on other sites More sharing options...
Darth_Rogue Posted January 7, 2015 Report Share Posted January 7, 2015 Yes it works. ... does not get overwritten (or overrided?)..... Greez KiloSwiss overridden :) KiloSwiss 1 Link to comment Share on other sites More sharing options...
KiloSwiss Posted January 7, 2015 Report Share Posted January 7, 2015 @TheVampire @Face As long as it's not fixed by the EPOCH devs, feel free to use this dirty little workaround: @Darth_Rogue Learned something new today. Thank You very much. Greez KiloSwiss Link to comment Share on other sites More sharing options...
Face Posted January 8, 2015 Report Share Posted January 8, 2015 This is my current workaround for the allowDamage issue. It's a simpler and more efficient solution in my opinion and uses only a single playableUnits loop - remember, if you have 50 players online, using "count playableUnits" will iterate through 50 different objects. if (!isNil "A3EAI_allowDamageFix_active") exitWith {}; A3EAI_allowDamageFix_active = true; uiSleep 5; while {true} do { private ["_playersModified"]; _playersModified = { if ((_x getVariable ["noDamageAllowed",true]) && {!(_x isKindOf "VirtualMan_EPOCH")}) then { if (isPlayer _x) then { _x allowDamage true; _x setVariable ["noDamageAllowed",false]; true }; }; } count playableUnits; if (_playersModified > 0) then {diag_log format ["DEBUG :: Applied allowDamage:true to %1 players.",_playersModified]}; uiSleep 10; }; If anyone wishes to use the script as-is, try to keep the "A3EAI_allowDamageFix_active" variable unchanged so that there aren't multiple copies of this loop running if multiple people wish to use this code in their own scripts. Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted January 8, 2015 Report Share Posted January 8, 2015 How do the AI that spawn due to the drone cause damage but the ones in the community made addons don't? I tried the script that spawns AI in towns but abandoned it because it required modifying core Epoch files which I want to avoid. Link to comment Share on other sites More sharing options...
KiloSwiss Posted January 8, 2015 Report Share Posted January 8, 2015 They are spawned clientside. You can use the Script You are talking about, together with the little addon from my previous post. Greez KiloSwiss Link to comment Share on other sites More sharing options...
axeman Posted January 8, 2015 Author Report Share Posted January 8, 2015 The allow damage restriction is on the server so doesn't effect client to client damage, it only works locally. This will be fixed on next update I believe. KiloSwiss 1 Link to comment Share on other sites More sharing options...
Face Posted January 8, 2015 Report Share Posted January 8, 2015 @axeman: I've always wondered, what is the actual purpose of the allowDamage false setting then, if you're aware of it? I'm not sure what type of server-side damage is expected that would make this necessary, other than preventing fall damage during creation of the player unit, before locality is transferred to the player client. Link to comment Share on other sites More sharing options...
axeman Posted January 8, 2015 Author Report Share Posted January 8, 2015 The idea was to block any damage during player creation. I also have a feeling we added it in during the hacker frenzy, we were on the servers at the time fighting against them as best we could, is mostly how we discovered the vulnerability reported and was subsequently fixed by BIS. I expect it may stay in, it will just be handled differently during player creation. Face 1 Link to comment Share on other sites More sharing options...
KiloSwiss Posted January 9, 2015 Report Share Posted January 9, 2015 Thanks for the insights so far axeman, your appearance here in this forum is well appreciated. Do You (the dev. team) plan to use "BIS_fnc_addStackedEventHandler" in the future to allow better compatibility with user mods? I'm talking especially about the current (not so smart) use of "onPlayerconnected" in the EPOCH MOD server files. Greez KiloSwiss Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now