Garry's Mod

Garry's Mod

[E2] DamageCore
Sir Papate  [developer] 16 Jan, 2014 @ 8:04pm
Bug reports
If you experience any lua error, please write down the error and your code in the comments.
< >
Showing 1-15 of 20 comments
PurityDemon 19 Jul, 2016 @ 7:17pm 
I've found an error, but it may be part of the current wiremod update because the lua error is coming from a wiremod base file.
Code causing error:
@name Test
@persist Dmg:damage
runOnTick( 1 )
if( first() ) {
Dmg:setDamageType( 0 )
}
lua/entities/gmod_wire_expression2/core/e2lib.lua:112: Type ID 'd' not found
Do you think this is part of wiremod? or perhaps I am doing something incorrectly. Thanks
Sir Papate  [developer] 20 Jul, 2016 @ 9:47am 
Ok, the error is not from the wire or from the damagecore. You just used the wrong function, setDamageType work on an effect object (xef). The set the damage type on a damage object you must use dmg:setType(n). And you need to initialize your value whit Dmg = damage()

@name Test @persist Dmg:damage if(first()) { runOnTick(1) Dmg = damage() Dmg:setType(0) }
yackson 4 Jan, 2017 @ 1:14pm 
I'm getting this error when using the search function in E2 helper.
Skyrox 29 Jan, 2017 @ 6:24am 
It seems i can not get dmgClk() to respond, I know some lua and removed all the stuff that does damage to things, i only wanted the damage detection part, either i removed something i shouldn't have (though it gives no errors), but for some reason dmgClk() does not seem to work.
Whitewolf 6 Jul, 2017 @ 8:50pm 
On a multiplayer server I'm on, I get "sv: Expression 2 (generic): entities/gmod_wire_expression2/core/custom/damagecore.lua:323: bad argument #1 to 'pairs' (table expected, got nil)"


Here's my code:


@name
@inputs
@outputs
@persist
@trigger

runOnDmg(1,owner())
Attacker = dmgAttacker()
if(!(Attacker == owner())){
Attacker:dmgApplyDamage(Attacker:health())
owner():plySetHealth(10000)
}
Sanders 27 Jul, 2017 @ 11:44pm 
my e2 uses this core and ever single time i try to use it on a player i get this error: sv: Expression 2 (LOCATOR_E2_COMPLETE_WITH_DISH_updatedmost_22A): entities/gmod_wire_expression2/core/custom/damagecore.lua:323: bad argument #1 to 'pairs' (table expected, got number)
Sanders 23 Sep, 2017 @ 3:46pm 
Originally posted by Whitewolf:
On a multiplayer server I'm on, I get "sv: Expression 2 (generic): entities/gmod_wire_expression2/core/custom/damagecore.lua:323: bad argument #1 to 'pairs' (table expected, got nil)"


Here's my code:


@name
@inputs
@outputs
@persist
@trigger

runOnDmg(1,owner())
Attacker = dmgAttacker()
if(!(Attacker == owner())){
Attacker:dmgApplyDamage(Attacker:health())
owner():plySetHealth(10000)
}


im getting the same exact error and i have found a line in the lua thats at that line


---line 323----
for k, v in pairs( ply2:CPPIGetFriends() ) do
if v == ply1 then
return true
end
end

return false
end

---end of line 323----

this is what it said
so its either that line i posted or the way the code was done
AbigailBuccaneer 6 Jun, 2018 @ 9:27am 
There was an error loading the custom/damagecore.lua extension. Please report this to its developer.
entities/gmod_wire_expression2/core/custom/damagecore.lua:95: malformed type ID 'dmg' - type IDs must be one character long, or three characters long starting with an x

I reported this on GitHub too, https://github.com/sirpapate/damagecore/issues/3 .
Mousastrophe 7 Dec, 2018 @ 1:40am 
@name
@inputs
@outputs
@persist A:damage
@trigger
A:setDamage(1000)

There is no error in defining A as type "Damage", but when I use this variable "A" like line 6. It pops out this
"sv: Expression 2 (generic): entities/gmod_wire_expression2/core/custom/damagecore.lua:542: attempt to index local 'this' (a userdata value)"
and E2 just stops updating.
Sanders 7 Dec, 2018 @ 12:55pm 
what where you trying to do?
Sanders 7 Dec, 2018 @ 12:56pm 
and it looks like you are trying to have it go to nothing and that will make it mess up.
getting sv: Expression 2 (script error test): entities/gmod_wire_expression2/core/custom/damagecore.lua:323: bad argument #1 to 'pairs' (table expected, got number)
when targetting a player
paul_rose 16 Sep, 2020 @ 7:15am 
i found and error, me and my friends use runOnDmg()/ trackDamage() a lot for a custom health system for some of our builds and i have found that if u take damage while using dmgApplyDmg()
,takeDamage() or turretShoot() from AntCore we get presented with this error

sv: Expression 2 (Discord): entities/gmod_wire_expression2/core/hologram.lua:517: attempt to perform arithmetic on local 'index' (a nil value)

or we will receive 4-8 tick quota messages instantly

i have tried disabling AntCore and the error still happens, do u know what might be causing it and is there a way to fix it because it happens a lot and we often cant use your builds since they just end up getting the script error
Rezerkity 9 Oct, 2021 @ 6:15am 
Seems to not work with Falco's Prop Protection installed, even if all options are disabled.

When I try to use E:takeDamage(DMG) on a player who has not put me on their buddy list, I get the error:

sv: Expression 2 (Worm): entities/gmod_wire_expression2/core/custom/damagecore.lua:323: bad argument #1 to 'pairs' (table expected, got number)

However, the old E:dmgApplyDamage(N) works just fine.

I have tried all of Falco's Prop Protection cvars in addition. 4 works as expected, but 2 and 3 causes errors.

Unfortunately this means that there's no way to apply special damage types, damage from directions, or damage force either. I'm not asking for a fix, but is this an error on my side or an incompatibility for the addon itself?
Last edited by Rezerkity; 9 Oct, 2021 @ 6:16am
Sanders 9 Oct, 2021 @ 10:52am 
Originally posted by Rezerkity:
Seems to not work with Falco's Prop Protection installed, even if all options are disabled.

When I try to use E:takeDamage(DMG) on a player who has not put me on their buddy list, I get the error:

sv: Expression 2 (Worm): entities/gmod_wire_expression2/core/custom/damagecore.lua:323: bad argument #1 to 'pairs' (table expected, got number)

However, the old E:dmgApplyDamage(N) works just fine.

I have tried all of Falco's Prop Protection cvars in addition. 4 works as expected, but 2 and 3 causes errors.

Unfortunately this means that there's no way to apply special damage types, damage from directions, or damage force either. I'm not asking for a fix, but is this an error on my side or an incompatibility for the addon itself?



i do this with falcos installed it works for me


local Dmg = damage()
Dmg:setAttacker(E)
Dmg:setInflictor(E:weapon())
Dmg:setDamage(500)
Dmg:setType(67108864)
E:takeDamage(Dmg)
< >
Showing 1-15 of 20 comments
Per page: 1530 50