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...


4 posters

    [HELP] Exploding Barrels

    Raziel
    Raziel
    Seasoned Wolfer
    Seasoned Wolfer


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

    [HELP] Exploding Barrels Empty [HELP] Exploding Barrels

    Post by Raziel 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



    [HELP] Exploding Barrels Banner10
    STORMING THE FRONT WITH A SCHMEISSER IN HAND!
    Raziel A.
    avatar
    WLHack
    Senior Member
    Senior Member


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

    [HELP] Exploding Barrels Empty Re: [HELP] Exploding Barrels

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

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


    Female
    Number of posts : 5120
    Age : 30
    Location : California, USA
    Job : Investor
    Hobbie : Computers, chess, computer chess, fashion, and philosophy
    Message : I made this forum when I was 13 High on Drugs
    Registration date : 2007-03-24

    [HELP] Exploding Barrels Empty Re: [HELP] Exploding Barrels

    Post by Dark_wizzie 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?



    Wolf3d Haven
    Minute Logic Blog
    Raziel
    Raziel
    Seasoned Wolfer
    Seasoned Wolfer


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

    [HELP] Exploding Barrels Empty Re: [HELP] Exploding Barrels

    Post by Raziel 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...



    [HELP] Exploding Barrels Banner10
    STORMING THE FRONT WITH A SCHMEISSER IN HAND!
    Raziel A.
    avatar
    WLHack
    Senior Member
    Senior Member


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

    [HELP] Exploding Barrels Empty Re: [HELP] Exploding Barrels

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

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


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

    [HELP] Exploding Barrels Empty Re: [HELP] Exploding Barrels

    Post by Raziel 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..



    [HELP] Exploding Barrels Banner10
    STORMING THE FRONT WITH A SCHMEISSER IN HAND!
    Raziel A.
    avatar
    briancough
    Can I Play, Daddy?
    Can I Play, Daddy?


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

    [HELP] Exploding Barrels Empty Re: [HELP] Exploding Barrels

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

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

    Sponsored content


    [HELP] Exploding Barrels Empty Re: [HELP] Exploding Barrels

    Post by Sponsored content

      Similar topics

      -

      Current date/time is Fri Nov 08, 2024 12:49 am