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


    (help) Blake Stone type enemy respawn

    Officer-Michael John
    Officer-Michael John
    Seasoned Wolfer
    Seasoned Wolfer


    Male
    Number of posts : 332
    Age : 26
    Hobbie : Video and Wolf 3D mode making
    Registration date : 2014-08-04

    (help) Blake Stone type enemy respawn Empty (help) Blake Stone type enemy respawn

    Post by Officer-Michael John Sat Oct 01, 2016 7:19 am

    I try adding Blake Stone type enemy respawn in my Wolf 3D mod. But I found problem. Not respawn enemy as in The Lost Relic,that respawn enemy. 

    WL_DEF.H:

    Code:
    FL_SOLID            = 0x00000200,


    WL_ACT2.CPP:

    Code:
    void    T_GuardWound(objtype *ob);

    statetype s_grddie4            = {false,SPR_GRD_DEAD,0,(statefunc)T_GuardWound,NULL,&s_grddie4};

    //---------------------------------------------------------------------------
    // T_GuardWound()
    //---------------------------------------------------------------------------
    void T_GuardWound(objtype *ob)
    {
       int32_t dx,dy;

       if (ob->state == &s_grddie4)
       {
          ob->flags |= FL_SOLID |FL_SHOOTABLE;
       }
       else
       {
          if (ob->temp2)
             if (tics < ob->temp2)
             {
                ob->temp2 -= tics;
                return;
             }

          ob->temp2 = 0;

          dx = player->x - ob->x;
          dx = LABS(dx);
          dy = player->y - ob->y;
          dy = LABS(dy);

          if (dy > TILEGLOBAL || dx > TILEGLOBAL)
          {
             ob->flags |= FL_SOLID | FL_SHOOTABLE;
             NewState (ob,&s_grddie1);
          }


    //      if ((ob->tilex != player->tilex) && (ob->tiley != player->tiley))
    //         NewState(ob,&s_grddie1);
       }
    }

      Current date/time is Sat Jul 20, 2024 2:26 am