Raised This Month: $32 Target: $400
 8% 

[L4D2]Damagetype fire?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gilmon
Senior Member
Join Date: Feb 2011
Location: China
Old 07-15-2014 , 04:51   [L4D2]Damagetype fire?
Reply With Quote #1

Hello there,SDKHook have a parameter called damagetype, anyone know which is the fire type in this game? thanks.

And I already get some but dont know their real type:
Code:
8
2056
268435464

Last edited by gilmon; 07-15-2014 at 04:52.
gilmon is offline
Send a message via MSN to gilmon
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 07-15-2014 , 08:05   Re: [L4D2]Damagetype fire?
Reply With Quote #2

Quote:
Originally Posted by gilmon View Post
Hello there,SDKHook have a parameter called damagetype, anyone know which is the fire type in this game? thanks.

And I already get some but dont know their real type:
Code:
8
2056
268435464
Those look like bits.
Edit: Too bad SourceMod doesn't have an include for l4d2 bitstrings.
Edit3: Wait, I got it, the 8 you got is DMG_BURN:
PHP Code:
//In SDKHooks.inc:
#define DMG_BURN                                    (1 << 3)    /**< heat burned */
// (1 << 3) = 8 

Last edited by WildCard65; 07-15-2014 at 08:07.
WildCard65 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-15-2014 , 11:23   Re: [L4D2]Damagetype fire?
Reply With Quote #3

As WildCard65 alluded to, the defines in SDKHooks are the numbers you're looking for.

Anytime you see (1 << X) that's actually 2 to the power of X.

However, they can also be added together.

Code:
DMG_GENERIC = 0
DMG_CRUSH = 1
DMG_BULLET = 2
DMG_SLASH = 4
DMG_BURN = 8
DMG_VEHICLE = 16
DMG_FALL = 32
DMG_BLAST = 64
DMG_CLUB = 128
DMG_SHOCK = 256
DMG_SONIC = 512
DMG_ENERGYBEAM = 1024
DMG_PREVENT_PHYSICS_FORCE = 2048
DMG_NEVERGIB = 4096
DMG_ALWAYSGIB = 8192
DMG_DROWN = 16384
DMG_PARALYZE = 32768
DMG_NERVEGAS = 65536
DMG_POISON = 131072
DMG_RADIATION = 262144
DMG_DROWNRECOVER = 524288
DMG_ACID = 1048576
DMG_SLOWBURN = 2097152
DMG_REMOVENORAGDOLL = 4194304
DMG_PHYSGUN = 8388608
DMG_PLASMA = 16777216
DMG_AIRBOAT = 33554432
DMG_DISSOLVE = 67108864
DMG_BLAST_SURFACE = 134217728
DMG_DIRECT = 268435456
DMG_BUCKSHOT = 536870912
8 = DMG_BURN
2056 = DMG_PREVENT_PHYSICS_FORCE + DMG_BURN
268435464 = DMG_DIRECT + DMG_BURN

Note that you can check if a specific damage type is present using the & operator... that's the bitwise AND operator.

Code:
if (damagetype & DMG_BURN)
{
    // DMG_BURN was present
    // damagetype & DMG_BURN == DMG_BURN if it's present or == 0 if it isn't
}
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-15-2014 at 11:30.
Powerlord is offline
gilmon
Senior Member
Join Date: Feb 2011
Location: China
Old 07-16-2014 , 08:28   Re: [L4D2]Damagetype fire?
Reply With Quote #4

Thanks for the help, it will help a lot.
gilmon is offline
Send a message via MSN to gilmon
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode