Wolf3d Haven Forum

Please log in or register. Smile
Wolf3d Haven Forum

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


    [HELP] Exploding Barrels

    Share
    avatar
    Raziel
    Seasoned Wolfer
    Seasoned Wolfer

    Male
    Number of posts : 361
    Age : 29
    Location : Israel
    Hobbie : Blasphemous Noise and Wolfenstein3D
    Registration date : 2007-07-08

    [HELP] Exploding Barrels

    Post by Raziel on Thu Aug 09, 2007 8:03 am

    EDIT:

    I think I got it fixed! Very Happy instead of putting this part of the code
    Code:
    case 76:
    SpawnBarrel (x,y);
    break;
    After the SpawnAngel (x,y); I have putted it after
    Code:
    SpawnStatic(x,y,tile-23);
    break;
    and it worked Very Happy and none of the Static objects were gone like before hehe

    @Eric: if you can please delete\lock this post, I no longer need help on this topic Smile


    Last edited by on Fri Aug 10, 2007 3:35 am; edited 1 time in total




    STORMING THE FRONT WITH A SCHMEISSER IN HAND!
    Raziel A.

    WLHack
    Senior Member
    Senior Member

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

    Re: [HELP] Exploding Barrels

    Post by WLHack on Thu Aug 09, 2007 8:05 am

    Hmm... What ID did you use for it?
    avatar
    Dark_wizzie
    I am Death Incarnate!
    I am Death Incarnate!

    Male
    Number of posts : 5092
    Age : 23
    Location : USA or Tawain
    Job : Student, Part time Cactuar fanatic
    Hobbie : Planting Cactuars.
    Message : I made this forum when I was 13 High on Drugs
    Registration date : 2007-03-24

    Re: [HELP] Exploding Barrels

    Post by Dark_wizzie on Thu Aug 09, 2007 8:49 am

    maybe you messed it up and it became invisible?
    or you mean by the matter simply isn't there?

    avatar
    Raziel
    Seasoned Wolfer
    Seasoned Wolfer

    Male
    Number of posts : 361
    Age : 29
    Location : Israel
    Hobbie : Blasphemous Noise and Wolfenstein3D
    Registration date : 2007-07-08

    Re: [HELP] Exploding Barrels

    Post by Raziel on Thu Aug 09, 2007 8:59 am

    WLHack wrote:Hmm... What ID did you use for it?

    ID? you mean like case? I used case 76: so I used ID 004c
    And the exploding barrels are just not there...

    Just a little note: I used Zuljins tutorial

    @Eric: No not invisible... Just not there...




    STORMING THE FRONT WITH A SCHMEISSER IN HAND!
    Raziel A.

    WLHack
    Senior Member
    Senior Member

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

    Re: [HELP] Exploding Barrels

    Post by WLHack on Thu Aug 09, 2007 9:47 am

    Hmm... Hows your SpawnBarrel routine in WL_Act2.C?
    avatar
    Raziel
    Seasoned Wolfer
    Seasoned Wolfer

    Male
    Number of posts : 361
    Age : 29
    Location : Israel
    Hobbie : Blasphemous Noise and Wolfenstein3D
    Registration date : 2007-07-08

    Re: [HELP] Exploding Barrels

    Post by Raziel on Thu Aug 09, 2007 10:43 am

    WLHack wrote:Hmm... Hows your SpawnBarrel routine in WL_Act2.C?

    Here it is:

    Code:

    //
    // barrel
    //
    void A_BarrelAttack (objtype *ob);

    extern statetype s_barrelstand;

    extern statetype s_barreldie1;
    extern statetype s_barreldie2;
    extern statetype s_barreldie3;
    extern statetype s_barreldie4;
    extern statetype s_barreldie5;
    extern statetype s_barreldie6;

    statetype s_barrelstand = {false,SPR_BARREL,0,NULL,NULL,&s_barrelstand};

    statetype s_barreldie1 = {false,SPR_BARREL,1,NULL,NULL,&s_barreldie2};
    statetype s_barreldie2 = {false,SPR_BARREL,1,NULL,NULL,&s_barreldie3};
    statetype s_barreldie3 = {false,SPR_BARRELBOOM1,10,NULL,A_Barrel,&s_barreldie4};
    statetype s_barreldie4 = {false,SPR_BARRELBOOM2,10,NULL,A_BarrelAttack,&s_barreldie5};
    statetype s_barreldie5 = {false,SPR_BARRELBOOM3,10,NULL,NULL,&s_barreldie6};
    statetype s_barreldie6 = {false,SPR_BARRELDEAD,130,NULL,NULL,&s_barreldie6};

    #pragma argsused
    void A_Barrel (objtype *ob)
    {
    SD_PlaySound(SLURPIESND);
    }

    /*
    ===============
    =
    = SpawnBarrel
    =
    ===============
    */

    void SpawnBarrel (int tilex, int tiley)
    {
    unsigned far *map,tile;

    SpawnNewObj (tilex,tiley,&s_barrelstand);
    new->obclass = barrelobj;
    new->hitpoints = starthitpoints[gamestate.difficulty][en_barrel];
    new->flags |= FL_SHOOTABLE|FL_AMBUSH;
    }

    /*
    =================
    =
    = A_BarrelAttack
    =
    =================
    */
    int Damage (long dx, long dy, long range, int max)
    {
    double ddx = (double) dx ;
    double ddy = (double) dy ;
    double drange = (double) range ;
    double dmax = (double) max ;
    double distance = sqrt (ddx * ddx + ddy * ddy) ;

    if (distance > drange)
    return 0 ;
    else
    return (int) (dmax - distance / drange * dmax) ;
    }

    void A_BarrelAttack (objtype *ob)
    {
    long deltax, deltay;
    objtype *extracheck;
    int damage ;

    extracheck = objlist ;
    while (extracheck)
    {
    if (extracheck != ob && (extracheck->flags & FL_SHOOTABLE))
    {
    deltax = LABS(ob->x - extracheck->x);
    deltay = LABS(ob->y - extracheck->y);
    if (deltax < BARRELEXPLSIZE * 2 && deltay < BARRELEXPLSIZE * 2) {
    damage = Damage (deltax, deltay, BARRELEXPLSIZE, 300) ;
    if (damage > 0)
    DamageActor (extracheck, damage);
    }
    }
    extracheck = extracheck->next ;
    }
    deltax = LABS(ob->x - player->x);
    deltay = LABS(ob->y - player->y);
    if (deltax < BARRELEXPLSIZE * 2 && deltay < BARRELEXPLSIZE * 2) {
    damage = Damage (deltax, deltay, BARRELEXPLSIZE, 300) ;
    if (damage > 0)
    TakeDamage (damage, ob);
    }
    }

    Just before the spear actors..




    STORMING THE FRONT WITH A SCHMEISSER IN HAND!
    Raziel A.

    briancough
    Can I Play, Daddy?
    Can I Play, Daddy?

    Number of posts : 25
    Age : 30
    Registration date : 2008-07-09

    Re: [HELP] Exploding Barrels

    Post by briancough on Sun Jul 27, 2008 8:32 am

    This is brilliant destructible objects, this make the game way more realistic .

    Sponsored content

    Re: [HELP] Exploding Barrels

    Post by Sponsored content


      Current date/time is Sat Oct 21, 2017 7:45 pm