Wolf3d Haven Forum

Please log in or register. Smile

Join the forum, it's quick and easy

Wolf3d Haven Forum

Please log in or register. Smile

Wolf3d Haven Forum

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Wolf3d Haven Forum

A friendly Wolfenstein 3D community, about Wolfenstein 3D, the game that gave birth to first person shooters...


2 posters

    Blockable Sprite That Causes Damage

    jayngo26
    jayngo26
    Spear of Destiny
    Spear of Destiny


    Male
    Number of posts : 643
    Age : 144
    Location : Random
    Job : Partime Evil Semi-Genius Plotting To Take Over Half The World. Partime Undead Charged With Keeping the Darkness Dark
    Hobbie : Staying Out Of Sunlight
    Message : Wolfenstein:Umbrella Beginnings Episode 2 released! Download now!

    Registration date : 2008-08-09

    Blockable Sprite That Causes Damage Empty Blockable Sprite That Causes Damage

    Post by jayngo26 Thu Dec 31, 2009 12:06 pm

    Does anyone know of a coding tutorial that explains how to make a blockable sprite damage your health.

    I know how to make a bo_damage sprite. But, I want something that will not disappear and also damage the player everytime he touches it..

    Could of sworn that I read a tutorial about this somewhere and at sometime, but I just can't seem to find anything with this now...



    http://jayngoware.com/
    avatar
    WLHack
    Senior Member
    Senior Member


    Male
    Number of posts : 800
    Age : 35
    Location : Finland
    Registration date : 2007-03-26

    Blockable Sprite That Causes Damage Empty Re: Blockable Sprite That Causes Damage

    Post by WLHack Thu Dec 31, 2009 12:38 pm

    I post a tutorial for blockable damaging object later
    but hurting bo_ that doesn't disappear is easy to make...
    In wl_agent.c in GetBonus() go to the very end of the function
    (looks something like this):
    Code:

            case    bo_spear:
                spearflag = true;
                spearx = player->x;
                speary = player->y;
                spearangle = player->angle;
                playstate = ex_completed;

        }
        StartBonusFlash ();
        check->shapenum = -1;
    }

    Change the final lines to this:
    Code:

        }
        if(check->itemnumber!=bo_hurt) //bo_hurt is the damaging bo_
        {  StartBonusFlash ();
          check->shapenum = -1;
        }
    }
    This if-clause makes sure that the
    hurting bo_ item won't be removed
    if player walks over it...

    Also you could define new special tile
    (like the Endgame-trigger) and then make
    something similar (also in wl_agent.c,
    this time in function Thrust() add
    this to the very end of the function):
    Code:

    if (*(mapsegs[1] + offset) == HURTTILE) //Define in wl.def.h
        TakeDamage(1,NULL);

    For the blocking item that hurts you - you need to go to
    the cmd_use() (also in wl_agent.c) and add a check wether
    player is standing next to the harming item - take damage.



    Hammer: I can see it now: you and the moon - wear a necktie so I'll know you.
    Building a new webpage...
    jayngo26
    jayngo26
    Spear of Destiny
    Spear of Destiny


    Male
    Number of posts : 643
    Age : 144
    Location : Random
    Job : Partime Evil Semi-Genius Plotting To Take Over Half The World. Partime Undead Charged With Keeping the Darkness Dark
    Hobbie : Staying Out Of Sunlight
    Message : Wolfenstein:Umbrella Beginnings Episode 2 released! Download now!

    Registration date : 2008-08-09

    Blockable Sprite That Causes Damage Empty Re: Blockable Sprite That Causes Damage

    Post by jayngo26 Thu Dec 31, 2009 1:12 pm

    Thanks for the quick code Blockable Sprite That Causes Damage Icon_biggrin . I will try and give this a shot whenever I get time. Oh, hehe, I almost forgot, this is also going to be an animated object with 2 frames of animation. I'm not sure, but I think this won't change things too much...



    http://jayngoware.com/

    Sponsored content


    Blockable Sprite That Causes Damage Empty Re: Blockable Sprite That Causes Damage

    Post by Sponsored content


      Current date/time is Thu Nov 21, 2024 3:46 am