Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-10-24 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
October 24, 2012, 03:27:34 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Set someone on fire without dealing damage or slowing them?  (Read 759 times)
Wangwang
Newbie
*
Posts: 20


View Profile Email
« on: June 27, 2011, 05:08:55 AM »

So basically I had an idea for a race I'm making, but wouldn't know how to go about doing this.

I've got everything set up, and the race is set to be 100% invis, but I want to ignite the client on a loop, so they would have the fire trail, but without being slowed or taking any damage. I considered a fire temp ent, but I couldn't seem to set it up so it looked like the ignite.

Any way around this? D:
Logged
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2045



View Profile WWW Email
« Reply #1 on: June 27, 2011, 08:39:31 AM »

maybe sdkhooks hurt you can block it if you can detect which kind of damage burn is
Logged

DarkEnergy
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #2 on: June 27, 2011, 02:24:35 PM »

Code:
public OnW3TakeDmgAllPre(victim,attacker,Float:damage){
if(ValidPlayer(victim, true))
{
if(War3_GetRace(victim) == thisRaceID)
{
new resistance_skill = War3_GetSkillLevel(victim, thisRaceID, SKILL_FIRE_ARMOR);
if (W3GetDamageType() & DMG_BURN)
War3_DamageModPercent(FireResistance[resistance_skill]);
}
}
}

This is from one of my l4d races that gets 25/50/75/100% resistance to fire damage. Alternatively you could look into the netprops, I know the common infected entity has a effect netprop that you can set to make them burn, so maybe players have that too.
Logged

Wangwang
Newbie
*
Posts: 20


View Profile Email
« Reply #3 on: June 27, 2011, 10:10:10 PM »

Code:
public OnW3TakeDmgAllPre(victim,attacker,Float:damage){
if(ValidPlayer(victim, true))
{
if(War3_GetRace(victim) == thisRaceID)
{
new resistance_skill = War3_GetSkillLevel(victim, thisRaceID, SKILL_FIRE_ARMOR);
if (W3GetDamageType() & DMG_BURN)
War3_DamageModPercent(FireResistance[resistance_skill]);
}
}
}

This is from one of my l4d races that gets 25/50/75/100% resistance to fire damage. Alternatively you could look into the netprops, I know the common infected entity has a effect netprop that you can set to make them burn, so maybe players have that too.

Would this still work since the damage isn't coming from an attacker, I'd be using igniteentity(client)? I'll take a look in to ownz's suggestion, and if not I'll try this. DMG_BURN looks promising, now to find out if it's the same in CSS.

Thanks again for the replies guys Smiley
Logged
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #4 on: June 28, 2011, 02:40:04 AM »

Yes. If you examine the code you'll see I don't check anywhere for a valid attacker.
Funny thing is we were playing a map with laser traps that appareantly did fire damage. I was 100% resistent - I survived the trap... my friend didn't Cheesy.

Also Ownz suggestion is exactly what my code does, except for me wrapping this into our native war3 interface. Where do you think OnW3TakeDmgAllPre comes from? That's just an sdkhook we forward... W3GetDamageType() gets the damage type from a internally stored variable wich normally gets passed into the sdk hook.
Logged

Revan
Sr. Member
****
Posts: 275



View Profile
« Reply #5 on: July 03, 2011, 04:53:02 AM »

or simply use the particle system for css  Tongue (since the ob update css supports them)
Example
Code:
//using env_fire_medium_smoke is just a example...
//other particles may look better
//like: "burning_character"
new firefx = CreateParticleSystem(victim, "env_fire_medium_smoke", true, "rfoot", _);

// ------------------------------------------------------------------------
// CreateParticleSystem()
// ------------------------------------------------------------------------
// >> Original code by J-Factor
// ------------------------------------------------------------------------
stock CreateParticleSystem(iClient, String:strParticle[], bool:bAttach = false, String:strAttachmentPoint[]="", Float:fOffset[3]={0.0, 0.0, 0.0})
{
    new iParticle = CreateEntityByName("info_particle_system");
    if (IsValidEdict(iParticle))
    {
        decl Float:fPosition[3];
        decl Float:fAngles[3];
        decl Float:fForward[3];
        decl Float:fRight[3];
        decl Float:fUp[3];
        
        // Retrieve entity's position and angles
        GetClientAbsOrigin(iClient, fPosition);
        GetClientAbsAngles(iClient, fAngles);
        
        // Determine vectors and apply offset
        GetAngleVectors(fAngles, fForward, fRight, fUp);    // I assume 'x' is Right, 'y' is Forward and 'z' is Up
        fPosition[0] += fRight[0]*fOffset[0] + fForward[0]*fOffset[1] + fUp[0]*fOffset[2];
        fPosition[1] += fRight[1]*fOffset[0] + fForward[1]*fOffset[1] + fUp[1]*fOffset[2];
        fPosition[2] += fRight[2]*fOffset[0] + fForward[2]*fOffset[1] + fUp[2]*fOffset[2];
        
        // Teleport and attach to client
        TeleportEntity(iParticle, fPosition, fAngles, NULL_VECTOR);
        DispatchKeyValue(iParticle, "effect_name", strParticle);

        if (bAttach == true)
        {
            SetVariantString("!activator");
            AcceptEntityInput(iParticle, "SetParent", iClient, iParticle, 0);            
            
            if (StrEqual(strAttachmentPoint, "") == false)
            {
                SetVariantString(strAttachmentPoint);
                AcceptEntityInput(iParticle, "SetParentAttachmentMaintainOffset", iParticle, iParticle, 0);                
            }
        }

        // Spawn and start
        DispatchSpawn(iParticle);
        ActivateEntity(iParticle);
        AcceptEntityInput(iParticle, "Start");
    }

    return iParticle;
}
« Last Edit: July 03, 2011, 04:57:58 AM by Revan » Logged

#war3source
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2045



View Profile WWW Email
« Reply #6 on: July 03, 2011, 10:40:55 AM »

ooooooooooooo
Logged

DarkEnergy
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #7 on: July 03, 2011, 10:47:16 AM »

I'm with Ownz here... Stupid to not think of that, when half my races use this kinda stuff %)
Logged

Revan
Sr. Member
****
Posts: 275



View Profile
« Reply #8 on: July 04, 2011, 01:21:09 PM »

I'm glad to help you, that's why there is a community or?^^
Logged

#war3source
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2045



View Profile WWW Email
« Reply #9 on: July 04, 2011, 08:18:32 PM »

wana create effects for our stock races? when it comes to effects im a complete noob
Logged

DarkEnergy
Revan
Sr. Member
****
Posts: 275



View Profile
« Reply #10 on: July 05, 2011, 05:39:31 AM »

Sure, I will give it a try  Grin
« Last Edit: July 05, 2011, 05:49:21 AM by Revan » Logged

#war3source
zero
Full Member
***
Posts: 191



View Profile WWW Email
« Reply #11 on: July 06, 2011, 09:48:36 PM »

Interesting, I just blocked all fire dmg as I wanted any dmg being given to trace back to a given user. However, doing it this way is cool if you want the fire effect to be different from stock. This could help me improve client fps on my zombie server by using a less resource intensive fire effect!
Logged

qwerty
Jr. Member
**
Posts: 87


View Profile
« Reply #12 on: July 07, 2011, 10:55:12 PM »

Interesting, I just blocked all fire dmg as I wanted any dmg being given to trace back to a given user. However, doing it this way is cool if you want the fire effect to be different from stock. This could help me improve client fps on my zombie server by using a less resource intensive fire effect!

fps on zm is good. :wtg:
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!