Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED] Player in Airboat gets too much damage!  (Read 3988 times)

0 Members and 1 Guest are viewing this topic.

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
[SOLVED] Player in Airboat gets too much damage!
« on: March 31, 2013, 07:38:02 PM »
Hi Guys, I need your help!

Basically, its like this: When the player is in the airboat and gets shot, the damage dealt to him is much bigger than it is when hes not using the airboat.

This makes some scenes in the HL2 campaign almost unplayable, like after you leave that Combine base in d1_canals_07 and there are alot of APCs shooting you etc.

I made a little vid to demonstarte this, excuse the bad quality, I made this in a hurry(I used buddha mode in this vid).

[HELP] SMOD: Realism - Player in Airboat gets too much damage!

Anyone has an idea how to fix this??
« Last Edit: April 03, 2013, 08:53:05 PM by Counter-Life™ »

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Re: [HELP] Player in Airboat gets too much damage!
« Reply #1 on: March 31, 2013, 08:15:21 PM »
I'm going to take a stab at this, but it may have to do with the fact that you have location damage on.

Offline Pepsifan04

  • *
  • *
  • +12% chance to make useful post
  • Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.
Re: [HELP] Player in Airboat gets too much damage!
« Reply #2 on: April 03, 2013, 07:34:57 AM »
Also what is multiplier value for torso damage? try lowering that.
Officially Unofficial BSNOOCH Discord:
https://discordapp.com/invite/eBqezeR

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: [HELP] Player in Airboat gets too much damage!
« Reply #3 on: April 03, 2013, 07:38:34 AM »
I will try this out, but sadly that would also effect the damage taken when ur not in the airboat.

Offline Pepsifan04

  • *
  • *
  • +12% chance to make useful post
  • Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.
Re: [HELP] Player in Airboat gets too much damage!
« Reply #4 on: April 03, 2013, 07:48:41 AM »
I bet that you can check via mapadd if player is in the boat, and mess around with commands from mapadd level
Officially Unofficial BSNOOCH Discord:
https://discordapp.com/invite/eBqezeR

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Re: [HELP] Player in Airboat gets too much damage!
« Reply #5 on: April 03, 2013, 08:07:56 AM »
I bet that you can check via mapadd if player is in the boat, and mess around with commands from mapadd level

That doesn't sound like something that can be accomplished through mapadd. :P

And btw, Counter-Life, you call your SMOD "realism", so shouldn't this be right up your alley?  ;)

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: [HELP] Player in Airboat gets too much damage!
« Reply #6 on: April 03, 2013, 10:01:26 AM »
I bet that you can check via mapadd if player is in the boat, and mess around with commands from mapadd level

That doesn't sound like something that can be accomplished through mapadd. :P

And btw, Counter-Life, you call your SMOD "realism", so shouldn't this be right up your alley?  ;)

Well, the game must still be playable, if u die like after 3 shots, u will have trouble clearing scenes like the escape trough the canals, after u blown open the 2 big doors in that Combine base.

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: [SOLVED] Player in Airboat gets too much damage!
« Reply #7 on: April 03, 2013, 08:54:35 PM »
Big Thanks go to Happy Cat for helping me out with a small mapadd script that fixed all my problems I had with this airboat damage thingy.

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Re: [SOLVED] Player in Airboat gets too much damage!
« Reply #8 on: April 04, 2013, 02:53:51 AM »
Big Thanks go to Happy Cat for helping me out with a small mapadd script that fixed all my problems I had with this airboat damage thingy.

Intriguing! So it is possible. How did he help you fix it?

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: [SOLVED] Player in Airboat gets too much damage!
« Reply #9 on: April 04, 2013, 07:47:02 AM »
Big Thanks go to Happy Cat for helping me out with a small mapadd script that fixed all my problems I had with this airboat damage thingy.

Intriguing! So it is possible. How did he help you fix it?

Well sadly hes banned from this forum(long story, but I really cant understand why, hes a very helpful and nice person actually), so he contacted me directly via Steam. He then gave me a DL for a mapadd script he made that fixed all my problems with that.

Offline Pepsifan04

  • *
  • *
  • +12% chance to make useful post
  • Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.Pepsifan04 is on the verge of being accepted.
Re: [SOLVED] Player in Airboat gets too much damage!
« Reply #10 on: April 04, 2013, 12:10:23 PM »
Mind sharing it with us?  I'd like to learn more :)
Officially Unofficial BSNOOCH Discord:
https://discordapp.com/invite/eBqezeR

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: [SOLVED] Player in Airboat gets too much damage!
« Reply #11 on: April 04, 2013, 02:57:56 PM »
Mind sharing it with us?  I'd like to learn more :)

I will ask for permission to upload it ASAP.

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: [SOLVED] Player in Airboat gets too much damage!
« Reply #12 on: April 06, 2013, 04:00:36 PM »
Happy Cat gave me permission to share a re-worked version of his script.

This is the .lua:

Code: [Select]
    --[[
            Simple "boat armor" script, by Happy Cat/ArmoredKitty.
            Nothing too exciting. ~60 lines altogether, minus the notes.
            Intended to run at map start. Scans the map's entity lump for airboats.
            Upon finding one, two outputs are added to trigger relays when the player
            enters/exits. The scan is repeated until no more boats can be found.
           
            The relays use the console to tweak player damage received with the
            sk_dmg_take_scaleX variables. These scale (nigh) all player damage received
            by a float value, per AdjustPlayerDamageTaken in hl2_gamerules.cpp:
            http://fal.xrea.jp/plugin/SourceSDK/hl2__gamerules_8cpp-source.html#l01497
           
            There's also an env_global and logic_auto set up so loading a savegame or
            transitioning to a map that starts with the player mounted won't reset the
            damage scaling. Assuming the loaded map has this same script going, anyway.
           
            May be worth mentioning that this can be painlessly adapted for other
            player-drivable vehicles (e.g. crane, jeep, stalker pod).
    ]]--
     
    function airboatArmorPrep()
            -- Run once at map startup
            local damage = {
                    driving = {
                            easy = 0.25,
                            normal = 0.50,
                            hard = 0.75
                    },
                    walking = {
                            easy = 0.50,
                            normal = 1.00,
                            hard = 1.50
                    }
            }
            local command = HL2.CreateEntity('point_clientcommand', VECTORZERO, VECTORZERO)
            if command then
                    HL2.KeyValue(command, 'targetname', 'clientCommand')
                    HL2.SpawnEntity(command)
            end
            local mount = HL2.CreateEntity('logic_relay', VECTORZERO, VECTORZERO)
            if mount then
                    HL2.KeyValue(mount, 'targetname', 'boatArmorOn')
                    HL2.KeyValue(mount, 'OnTrigger', 'clientCommand,Command,sk_dmg_take_scale1 ' ..damage.driving.easy.. ',,0,-1')
                    HL2.KeyValue(mount, 'OnTrigger', 'clientCommand,Command,sk_dmg_take_scale2 ' ..damage.driving.normal.. ',,0,-1')
                    HL2.KeyValue(mount, 'OnTrigger', 'clientCommand,Command,sk_dmg_take_scale3 ' ..damage.driving.hard.. ',,0,-1')
                    HL2.KeyValue(mount, 'OnTrigger', 'boatArmorState,TurnOn,,0,-1')
                    HL2.SpawnEntity(mount)
            end
            local dismount = HL2.CreateEntity('logic_relay', VECTORZERO, VECTORZERO)
            if dismount then
                    HL2.KeyValue(dismount, 'targetname', 'boatArmorOff')
                    HL2.KeyValue(dismount, 'OnTrigger', 'clientCommand,Command,sk_dmg_take_scale1 ' ..damage.walking.easy.. ',,0,-1')
                    HL2.KeyValue(dismount, 'OnTrigger', 'clientCommand,Command,sk_dmg_take_scale2 ' ..damage.walking.normal.. ',,0,-1')
                    HL2.KeyValue(dismount, 'OnTrigger', 'clientCommand,Command,sk_dmg_take_scale3 ' ..damage.walking.hard.. ',,0,-1')
                    HL2.KeyValue(dismount, 'OnTrigger', 'boatArmorState,TurnOff,,0,-1')
                    HL2.SpawnEntity(dismount)
            end
            local check = HL2.CreateEntity('logic_auto', VECTORZERO, VECTORZERO)
            if check then
                    HL2.KeyValue(check, 'targetname', 'boatArmorCheck')
                    HL2.KeyValue(check, 'OnMapSpawn', 'boatArmorOn,Trigger,,0,-1')
                    HL2.KeyValue(check, 'OnMapSpawn', 'boatArmorState,TurnOn,,0,-1')
                    HL2.KeyValue(check, 'globalstate', 'is_driving_boat')
                    HL2.SpawnEntity(check)
            end
            local state = HL2.CreateEntity('env_global', VECTORZERO, VECTORZERO)
            if state then
                    HL2.KeyValue(state, 'targetname', 'boatArmorState')
                    HL2.KeyValue(state, 'globalstate', 'is_driving_boat')
                    HL2.KeyValue(state, 'initialstate', '0')
                    HL2.SpawnEntity(state)
            end
            airboatArmor()
    end
     
    function airboatArmor()
            -- Can be run later. Only call if spawning boats after map start
            local boat = HL2.FindEntityByClass(nil, 'prop_vehicle_airboat')
            -- find first boat, if any
            while boat do
                    -- keep going through the entity lump until no more boats
                    HL2.KeyValue(boat, 'PlayerOn', 'boatArmorOn,Trigger,,0,-1')
                    HL2.KeyValue(boat, 'PlayerOff', 'boatArmorOff,Trigger,,0,-1')
                    boat = HL2.FindEntityByClass(boat, 'prop_vehicle_airboat')
                    -- find next boat, if any, starting at last boat's position in the list
            end
    end

and this goes into the .txt file of the mapadd:

Code: [Select]
"entities" {
"lua"
{ "callfunc" "airboatArmorPrep" }
}


« Last Edit: April 06, 2013, 04:28:30 PM by Counter-Life™ »