Jump to content

caddrel

Member
  • Content Count

    25
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About caddrel

  • Rank
    Private First Class

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Originally I was under the impression the damage handler applied additional damage to the unit. However, from what I can tell it only applies total damage. So if the unit is already injured in the hand (0.15) and the hand is hit for an extra (0.5) the amount of damage the handler will apply will be 0.65. This makes everything significantly easier; there's no need to check the health of the unit; the damage in the damage handler will only ever be total amount. We can use the same safe damage value used by BIS Revive (0.95). Have done some testing; the script below should work. Used with the BIS Revive basic damage system, a player can only ever be incapacitated. If they take enough damage in a vehicle to be incapacitated, they are ejected from the vehicle and lay incapacitated on the ground. //initPlayerLocal.sqf params[ "_unit" ]; //Waituntil REVIVE handleDamage EH has been applied waitUntil{ !isNil { _unit getVariable "bis_revive_ehHandleDamage" } }; //Remove REVIVE HandleDamage EH _unit removeEventHandler[ "HandleDamage", _unit getVariable "bis_revive_ehHandleDamage" ]; //Only damage from last applied handleDamage EH is taken into consideration by the engine //Apply a new EH so as we can override the damage applied _unit addEventHandler [ "HandleDamage", { private[ "_damage","_newDamage" ]; params [ "_unit" ]; //If we are not incapacitated if ( lifeState _unit != "INCAPACITATED" ) then { //Get revives handle damage _newDamage = _this call bis_fnc_reviveEhHandleDamage; } else { //if we are incapacitated _newDamage = 0; }; //if damage is enough to kill the player and they're in a vehicle, force them out of the vehicle. if ((_newDamage > 0.95) && (vehicle player != player)) then { moveOut _unit; //Call the BIS revive function again; if the player is in a vehicle it sometimes returns 100 damage. _newDamage = _this call bis_fnc_reviveEhHandleDamage; }; _newDamage }]; Another interesting discovery is the damage handler is now called fifteen times for every bullet or source of damage; once for each hitpoint area of the unit. This is the log for a single bullet hitting the test unit. 0:19:38 "Damage applied to HitHead of testguy is 0" 0:19:38 "Damage applied to of testguy is 0.0865005" 0:19:38 "Damage applied to of testguy is 0.0865005" 0:19:38 "Damage applied to HitFace of testguy is 0" 0:19:38 "Damage applied to HitNeck of testguy is 0" 0:19:38 "Damage applied to HitHead of testguy is 0" 0:19:38 "Damage applied to HitPelvis of testguy is 100" 0:19:38 "Moving testguy out of B Alpha 1-1:1 (Caddrel) (testguy)" 0:19:38 "RECALCULATED damage applied to HitPelvis of testguy is 0.95" 0:19:38 "Damage applied to HitAbdomen of testguy is 0.95" 0:19:38 "Damage applied to HitDiaphragm of testguy is 0" 0:19:38 "Damage applied to HitChest of testguy is 0" 0:19:38 "Damage applied to HitBody of testguy is 0" 0:19:38 "Damage applied to HitArms of testguy is 0" 0:19:38 "Damage applied to HitHands of testguy is 0" 0:19:38 "Damage applied to HitLegs of testguy is 0" 0:19:38 "Damage applied to Incapacitated of testguy is 7.83344e-005"
  2. So the above script appears to work, however on testing it runs into issues when "reduced damage" is enabled in the difficulty options. The reduced damage seems to make it eject the player from the vehicle before they take lethal damage (in some fringe cases.) If I can find some way to replicate MAX_SAFE_DAMAGE from the BIS Revive functions this can be fixed. Or I can write the code manually, but I'd need to find out how much the game is reducing the damage to the players by. Anyone know the answer to either of these?
  3. After further tinkering, have found a solution. Not sure how elegant it is, but it works. If a player is in a vehicle and receives lethal damage (>1), they are forced out of the vehicle. This has been combined with the previous script, that reduces all damage to 0 if a player is incapped. So far in the test environment, dropping a bomb on a vehicle with a player in it leaves the player incapacitated next to the burning wreck. Will do further testing to see if there are unintended consequences. Thanks to r3vo for the potential other answer; unfortunately I'm completely unfamiliar with the animation system/states in Arma 3! //initPlayerLocal.sqf params[ "_unit" ]; //Waituntil REVIVE handleDamage EH has been applied waitUntil{ !isNil { _unit getVariable "bis_revive_ehHandleDamage" } }; //Remove REVIVE HandleDamage EH _unit removeEventHandler[ "HandleDamage", _unit getVariable "bis_revive_ehHandleDamage" ]; //Only damage from last applied handleDamage EH is taken into consideration by the engine //Apply a new EH so as we can override the damage applied _unit addEventHandler [ "HandleDamage", { private[ "_damage","_newDamage" ]; params [ "_unit" ]; //If we are not incapacitated if ( lifeState _unit != "INCAPACITATED" ) then { //Get revives handle damage _newDamage = _this call bis_fnc_reviveEhHandleDamage; } else { //if we are incapacitated _newDamage = 0; }; //if damage is enough to kill the player and they're in a vehicle, force them out of the vehicle. if (((_newDamage + (getDammage _unit)) >= 1) && (vehicle player != player)) then { moveOut _unit; //Recalculate damage now player is out of the vehicle. _newDamage = _this call bis_fnc_reviveEhHandleDamage; }; _newDamage }];
  4. So have done some looking into this. Was trying to alter the default function BIS_fnc_reviveEhDammaged: #include "defines.inc" /* unit: Object - Object the event handler is assigned to hitSelection: String - Name of the selection where the unit was damaged damage: Number - Resulting level of damage hitPartIndex: Number - hit index of the hit selection hitPoint: String - hit point Cfg name shooter: Object - shooter reference (to get instigator use getShotParents on projectile) projectile: Object - the projectile that caused damage */ params ["_unit", "", "_damage","","_hitPoint","_source"]; if (alive _unit && {_damage >= 1 && {REVIVE_ENABLED(_unit) && {_hitPoint == "Incapacitated" && {IS_ACTIVE(_unit)}}}}) then { //["[i] Incapacitated by dependence: %1",_this] call bis_fnc_logFormat; //award attacker with +1 'infantry kill' point [_source] spawn bis_fnc_reviveAwardKill; //incapacitate unit outside of vehicle if (!IN_VEHICLE(_unit)) then { if (isNull _source || {!bis_revive_killfeedShow}) then { SET_STATE(_unit,STATE_INCAPACITATED); } else { SET_STATE_XTRA(_unit,STATE_INCAPACITATED,_source); }; } //kill unit in vehicle else { _unit setDamage 1; }; }; Removed it from the unit via initPlayerLocal.sqf, and replaced it with this: params ["_unit", "", "_damage","","_hitPoint","_source"]; if ((alive _unit) && ((_damage >= 1) && (_hitPoint == "Incapacitated"))) then { //If unit is inside vehicle, move them out and set unconscious. Otherwise proceed as normal. if (vehicle player != player) then { [_source] spawn bis_fnc_reviveAwardKill; moveOut _unit; _unit setUnconscious true; } else { _this call bis_fnc_reviveEhDammaged; }; } else { diag_log format ["LOG:Conditions not met: Alive is %1, damage is %2, hitpoint is %3",alive _unit,_damage,_hitPoint]; }; This seems to preserve previous behaviour when a player is out of a vehicle; they become incapacitated and (because of my other script) are impossible to damage in that state. However when a player is inside the vehicle, the dammaged handler is only called once for the unit, and by that time "alive == false"; "13:19:31 "CADLOG:Conditions not met: Alive is false, damage is 1, hitpoint is Incapacitated"" I've been testing the different interactions by dropping explosives on units and vehicles. Even if you remove the alive condition from the if statement, but the time the event handler is even called the unit is not alive, and so can't be set to incapacitated/unconscious/etc.
  5. Hello there, Am trying to put together missions where a player group can only be incapacitated, never killed. The mission is only ever failed when all players are incapacitated; so there's always a chance of recovery and "no man is left behind." Have been able to handle most situations using a modified version of the script from this thread: https://forums.bistudio.com/forums/topic/199665-damage-handling-scripts-broken-since-166-update/?do=findComment&comment=3191125 However, when players are shot/injured/exploded while inhabiting a vehicle they're dead dead, they never even enter the incapacitated state. This even applies to relatively innocuous "vehicles" like M2 tripods. Is there a workaround for this that could be used? Am very happy putting together something that ejects players from the vehicle on receiving otherwise lethal damage and incapping them, or having a script monitor vehicles and making sure this happens as well. Just don't know enough about all the event handlers / triggers / functions to make that happen. Looking into it now! Anyone know of a potential solution/workaround? Even if it is just pointing in the right direction to look.
  6. OK, have just done some tests and this new script appears to work as intended. Big thanks to Larrow for creating it in the first place, and Bohemia for their fantastic new functions library in the Eden Editor. Turns out it was just some changed function names. //initPlayerServer.sqf params[ "_unit" ]; //Waituntil REVIVE handleDamage EH has been applied waitUntil{ !isNil { _unit getVariable "bis_revive_ehHandleDamage" } }; //Remove REVIVE HandleDamage EH _unit removeEventHandler[ "HandleDamage", _unit getVariable "bis_revive_ehHandleDamage" ]; //Only damage from last applied handleDamage EH is taken into consideration by the engine //Apply a new EH so as we can override the damage applied _unit addEventHandler [ "HandleDamage", { private[ "_damage" ]; params [ "_unit" ]; //If we are not incapacitated if ( lifeState _unit != "INCAPACITATED" ) then { //Get revives handle damage _damage = _this call bis_fnc_reviveEhHandleDamage; } else { //if we are incapacitated _damage = 0; }; _damage }];
  7. Having looked into this a bit further it seems the script above is stalling at: waitUntil{ !isNil { _unit getVariable "bis_revive_ehDamage" } }; Has the name of "bis_revive_ehDamage" changed?
  8. Am trying to create a mission where it's not possible to kill the players, only incapacitate them. The mission is only failed if the entire team is incapacitated. Have tried using the script from this and another thread (placed in initPlayerLocal.sqf.) //initPlayerLocal.sqf params[ "_unit" ]; //Waituntil REVIVE handleDamage EH has been applied waitUntil{ !isNil { _unit getVariable "bis_revive_ehDamage" } }; //Remove REVIVE HandleDamage EH _unit removeEventHandler[ "HandleDamage", _unit getVariable "bis_revive_ehDamage" ]; //Only damage from last applied handleDamage EH is taken into consideration by the engine //Apply a new EH so as we can override the damage applied _unit addEventHandler [ "HandleDamage", { private[ "_damage" ]; params [ "_unit" ]; //If we are not incapacitated if ( lifeState _unit != "INCAPACITATED" ) then { //Get revives handle damage _damage = _this call BIS_fnc_reviveOnPlayerHandleDamage; }else{ //if we are incapacitated _damage = 0; }; _damage }]; However on testing it on a multiplayer server, a friend was able to incapacitate me (fine) and then able to kill me while incapacitated (not so fine.) Is there something in the setup that I may have done wrong, or something further that should be added? Link to another relevant thread: https://forums.bistudio.com/forums/topic/200447-how-to-disable-damage-when-unconscious/
  9. caddrel

    Connecting Failed

    Just as a follow-up this problem appears to be resolved for our group (no setup changes were needed). We can now join the previously affected servers via the server browser again. Does appear to have been a problem on Gamespy's end.
  10. No, you need to actually read up on the problem before throwing around false information. One of the problems being reported was apparently an issue with Gamespy which has now been resolved. There are numerous threads and posts on this across this forum and the Day Z forum: http://forums.bistudio.com/showthread.php?137619-Connecting-Failed&p=2193229&viewfull=1#post2193229 Read up on the issue before misleading people. Maybe some people are experiencing setup issues, but a lot of people were hit by an outage or other problem that seemed to be on Gamespy's end.
  11. caddrel

    NAT Negotiation failed

    A temporary solution which works for clients. Quoting my friend again: You CAN join servers that you get Connecting Failed to by using the Six Updater. The Six Updater adds the command line parameters " -connect=<the Server IP here> -port=2302".
  12. caddrel

    Connecting Failed

    There's a thread on the multiplayer forum here with server owners reporting this same issue. A lot of server owners began reporting this problem Sunday at 8:30pm to 9:30pm GMT: http://forums.bistudio.com/showthread.php?135123-Dedicated-Server-NAT-Negotiation-Failed&p=2192882&viewfull=1#post2192882 A lot of Day Z users having the same issue (a few unrelated posts, but mostly all reporting exactly the same symptoms): http://dayzmod.com/forum/index.php?/topic/36686-connecting-failed/page__st__20 Here's the thread with Day Z server owners where you can see the time scale clearly. Contrary to what one person says, this problem hasn't been resolved: http://dayzmod.com/forum/index.php?/topic/41828-server-suddenly-stopped-working/ ---------- Post added at 04:06 PM ---------- Previous post was at 03:45 PM ---------- A friend did some research: "On the servers where I can connect, Arma immediately tries to connect to port 2302 Whereas the games where it doesn't work, ArmA tries to negotiate the UDP using 69.10.30.x IPs - I'm guessing those are the negotiation servers. (And they answer with ICMP Destination unreachable) IGN owns Gamespy, right? The 69.10.30.x IPs resolve through IGN's dns servers. It could be that in case where the server is behind a NAT it'll do the negotiation." ---------- Post added at 04:25 PM ---------- Previous post was at 04:06 PM ---------- A temporary solution which works. Quoting my friend again: You CAN join servers that you get Connecting Failed to by using the Six Updater. You can use the Six Updater's built in server browser. The Six Updater adds the command line parameters " -connect=<the Server IP here> -port=2302". We still can't join using the in-game browser. But we can get a game going by all joining the server via the Six Updater.
  13. A lot of people are now reporting this problem: http://dayzmod.com/forum/index.php?/topic/36686-connecting-failed/page__st__20 Have tried reinstalling Battleye, running game without any mods, running game without beta, downgrading beta, and all the usual things with routing/network (though my server was working fine up until the same point when a lot of server owners started reporting issues with new players being unable to connect). Can connect to several servers just fine, but some show up Connecting Failed with the NNThink error in the .rpt log. Am also no longer able to host. Our group of players had four of us each try hosting and no-one could connect to anyone else. Others show these same error codes I'm describing earlier in this thread. The main error on clients connecting is, "NAT Negotiation failed (NNThink - result 2)" The server error being shown is, "NAT Negotiation failed - unable to communicate with the server" ---------- Post added at 03:54 PM ---------- Previous post was at 03:31 PM ---------- Another thread on this forum which appears to be the same issue: http://forums.bistudio.com/showthread.php?136844-Can-no-longer-host-multiplayer-games-with-a-friend
  14. Hey there, you seem to be having the same issue as the people in these threads (for some reason there's no solution/official response yet): http://forums.bistudio.com/showthread.php?137619-Connecting-Failed http://forums.bistudio.com/showthread.php?135123-Dedicated-Server-NAT-Negotiation-Failed http://dayzmod.com/forum/index.php?/topic/41828-server-suddenly-stopped-working/page__st__20 http://dayzmod.com/forum/index.php?/topic/36686-connecting-failed/page__st__40
  15. We had multiple people, who had previously been able to host without problems, try to rehost for our group. No-one was able to connect to anyone else. Occasionally we'd be able to get one other person onto a server consistently, but he would only be able to get onto that server and not one hosted by someone else. There's also a Day Z thread here with people who began experiencing similar issues as of an hour or two ago: http://dayzmod.com/forum/index.php?/topic/41845-95208-connecting-failed/
×