+ Reply to Thread
Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: [E2]Damage Functions Mk2: Complete Rehash

  1. #21
    Wirererer Flieboy's Avatar
    Join Date
    Jul 2008
    Posts
    243

    Default Re: [E2]Damage Functions Mk2: Complete Rehash

    OK, you win, it's a shit set of functions, I just wish I knew something that E2 actually needs that I could get my teeth into..

  2. #22
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: [E2]Damage Functions Mk2: Complete Rehash

    Quote Originally Posted by Drunkie View Post
    *picture*
    Oh cool I didn't know that
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  3. #23
    Wire Sofaking Jimlad's Avatar
    Join Date
    Dec 2008
    Posts
    941

    Default Re: [E2]Damage Functions Mk2: Complete Rehash

    Quote Originally Posted by Fliecheese View Post
    OK, you win, it's a shit set of functions, I just wish I knew something that E2 actually needs that I could get my teeth into..
    It's not bad in isolation, but you have to consider wiremod as a whole when thinking about adding things to the svn. Personally, the way I got into wiremod was just bumping up against its limitations while building, so I'd suggest and add things I thought would be practical solutions to real problems. To be honest, I don't think there's very much you can't build with wiremod these days since most of the hard work has already been done. That's not a bad thing by any means, it means you have that much more freedom to build. Personally I see adding features as a necessary step towards making better contraptions; wiremod development being a process rather than a goal by itself.

  4. #24
    Wirererer Flieboy's Avatar
    Join Date
    Jul 2008
    Posts
    243

    Default Re: [E2]Damage Functions Mk2: Complete Rehash

    Very true, I just wish I contributed more to the mod itself, as it has done so much for me, clearly this was a miss for wiremod as a whole but I will see if I can find something useful to do.

  5. #25
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,010

    Default Re: [E2]Damage Functions Mk2: Complete Rehash

    Exclusive holograms.

    Ready? Set. Go!
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  6. #26
    Wirererer Flieboy's Avatar
    Join Date
    Jul 2008
    Posts
    243

    Default Re: [E2]Damage Functions Mk2: Complete Rehash

    I'll do it! perhaps I will stick in my holoAnimate as well, though that's more a holoModelAny type function, but I will do exclusive holograms now!

  7. #27
    Wire Noob GilgaCat's Avatar
    Join Date
    Jan 2011
    Posts
    6

    Default Re: [E2]Damage Functions Mk2: Complete Rehash

    Ok, i know this is a year old thread but may we add two of those E2 functions? I mean those that get the attacker and damage of an entity. Yeah, i know the damage detector but for coders like me its more comfortable to use functions.

    Let's me see what i mean:

    [ cl_dmginfo.lua ]
    Code:
    E2Helper.Descriptions["getAttacker"] = "Get the attacker of the entity."
    E2Helper.Descriptions["getDamage"] = "Get the damage of the entity."
    [ dmginfo.lua ]
    Code:
    /*
    	name: DamageInfo
    	author: GilgaCat
    */
    
    E2Lib.RegisterExtension("dmginfo", true)
    
    DmgInfoTbl = {}
    
    function GetDmgInfo(ent, inflictor, attacker, amount, dmginfo)
    	local index = ent:EntIndex()
    	if(not index) then return nil end
    
    	local dmginfotbl = {}
    	dmginfotbl.entity = ent
    	dmginfotbl.attacker = attacker
    	dmginfotbl.inflictor = inflictor
    	dmginfotbl.damage = amount
    	dmginfotbl.dmginfo = dmginfo
    
    	DmgInfoTbl[index] = dmginfotbl
    
    	timer.Simple( 0.01, ResetDmgInfo, index)
    end
    
    hook.Add( "EntityTakeDamage", "GetDmgInfo", GetDmgInfo)
    
    function ResetDmgInfo(index)
    	if(not index or not DmgInfoTbl[index]) then return nil end
    	DmgInfoTbl[index] = {}
    end
    
    e2function entity entity:getAttacker()
    	if (not validEntity(this)) then return nil end
    	local index = this:EntIndex()
    
    	local table = DmgInfoTbl[index]
    	if(not table) then return nil end
    
    	return table.attacker
    end
    
    e2function number entity:getDamage()
    	if (not validEntity(this)) then return 0 end
    	local index = this:EntIndex()
    
    	local table = DmgInfoTbl[index]
    	if(not table or not table.damage) then return 0 end
    	return table.damage
    end
    Simple, it is? I have tested it and it works perfectly!
    I wish to see that in Wire Svn or UWSVN.

    What are your opions?

    PS: If you wanna add/remove some code then post it.

  8. #28
    Wire Amateur uke94's Avatar
    Join Date
    Dec 2010
    Posts
    77

    Default Re: [E2]Damage Functions Mk2: Complete Rehash

    Quote Originally Posted by GilgaCat View Post
    Simple, it is? I have tested it and it works perfectly!
    I wish to see that in Wire Svn or UWSVN.
    yes should be in wiremod its very useful to have the e2 without linking it to a damage detector
    it would be great to have everything from wiremod in e2

    if i give e2s away i dont want to explain everyone that he have to link this to this and then the first thing to a third and so on
    just spawn the chip and let it work

    as divran said
    Quote Originally Posted by Divran View Post
    Say you want to have a battle with regular Wire or GMod turrets, and not PewPew or GCombat, and you want to use metal props and not wooden ones. Naturally, you'd want the driver to die if the tank he's sitting in gets shot. With the damage detector entity you'd have to spawn dozens of them, linked to each prop in the tank and then wire the "deal damage" input of the adv pod controller to an add chip adding them all together. Or you use E2 to automatically find all constrained props and check if any of them get hit.

    Just one example.
    and to not have long tutorials for e2 like this:

+ Reply to Thread
Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots