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


    [Solved] Problem with Adding teleporters in SDL

    Share

    kkk911
    Don't Hurt Me!
    Don't Hurt Me!

    Male
    Number of posts : 61
    Age : 19
    Location : Hungary
    Hobbie : Modding, Photography, Gaming, collecting scale modells
    Registration date : 2012-03-25

    [Solved] Problem with Adding teleporters in SDL

    Post by kkk911 on Mon Jul 07, 2014 11:47 am

    Hello everyone! I have a problem with Adding teleporters to Wolf4SDL. I'll get straight to the point!

    So i've wanted to use MCS's Teleport code in my SDL Modl, but several errors has been occured while compiling.
    Let's just say, i followed the tutorial completly, from A to Z. (Nothing was missed, i've checked it several times!)
    But one thing i've changed in the code was the PlaySound section in void WarpPlayer (wl_agent.cpp)
    I've changed this in the original code:

    Code:
    SD_PlaySound (BOSSACTIVESND);
     if (DigiMode != sds_Off)
      {
      long lasttimecount = TimeCount;
      while(TimeCount < lasttimecount+35) //adjust warp duration here
       SD_Poll();
      }
     else
      VW_WaitVBL(1*50);


    Into this:,

    Code:
     SD_PlaySound (BOSSACTIVESND);
      VW_WaitVBL(100);



    because we all know that Wolf4SDL doesn't use DMA, TimeCount and such anymore.
    So this is how my WarpPlayer section looks like.

    Code:
    void WarpPlayer (int facedir)
    {
    objtype  *check;
    int  x,y;

    buttonstate[bt_attack] = false;
    buttonheld[bt_attack] = false;
    gamestate.attackframe = 0;
    gamestate.weaponframe = 0;
    DrawPlayerWeapon();
    ThreeDRefresh();
    switch (facedir)
      {
      case EAST:
       check = actorat[warpex][warpey];
       if (check > objlist && (check->flags & FL_SHOOTABLE))
        KillActor(check);
       SpawnPlayer(warpex,warpey,facedir);
       break;
      case WEST:
       check = actorat[warpwx][warpwy];
       if (check > objlist && (check->flags & FL_SHOOTABLE))
        KillActor(check);
       SpawnPlayer(warpwx,warpwy,facedir);
       break;
      }

     SD_PlaySound (BOSSACTIVESND);
      VW_WaitVBL(100);

    buttonstate[bt_attack] = false;
    buttonheld[bt_attack] = false;
    gamestate.attackframe = 0;
    gamestate.weaponframe = 0;
    DrawPlayerWeapon();
    ThreeDRefresh();
    }


    Now, here is the problem: When i trying to compile it, error messages pops up, while pointing at DrawPlayerWeapon(); :




    Not understanding any of these, i've decided to comment out the two DrawPlayerWeapon(); line in the code. When i tried to compile it again, "Linker" errors appeared:



    And so on, i was stuck with this. Sorry for explaining my problem that long, but i've wanted to give a full description of it.
    Sadly, i'm not a code expert. I would thank any help! Smile


    Last edited by kkk911 on Mon Jul 14, 2014 7:08 am; edited 1 time in total

    AlumiuN
    Don't Hurt Me!
    Don't Hurt Me!

    Number of posts : 52
    Age : 24
    Location : Christchurch, New Zealand
    Registration date : 2013-08-31

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by AlumiuN on Mon Jul 07, 2014 7:35 pm

    Can you link to the tutorial? I know what would cause these errors - warpex and warpey not being declared somewhere and DrawPlayerWeapon not being extern'd in a header - but if you've followed the tutorial completely and it's a decent tutorial (and it's MCS, so it should be) this shouldn't happen.

    EDIT: OK, I assume you're using the tutorial from AReyeP and MCS's website. To fix it, above the line "void WarpPlayer (int facedir);", put "void DrawPlayerWeapon(void);". Then go back and follow step 5 in the tutorial again, where it says to put the line "int warpwx," etc.

    kkk911
    Don't Hurt Me!
    Don't Hurt Me!

    Male
    Number of posts : 61
    Age : 19
    Location : Hungary
    Hobbie : Modding, Photography, Gaming, collecting scale modells
    Registration date : 2012-03-25

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by kkk911 on Mon Jul 07, 2014 11:40 pm

    Yes, i've used MCS's tutorial from areyep.com.
    Thanks for the help! Gotta try it now!

    EDIT: Finally i've managed to compile the .exe without linker errors and such. I have placed the teleporters in the first map (With Mapedit 8.4), but when i enters both of them, the game crashes with no error message or whatsoever.
    This is what i've changed in the code: At the begining of wl_agent.cpp

    Code:
    void    T_Player (objtype *ob);
    void    T_Attack (objtype *ob);
    void    WarpPlayer (int facedir);
    void    DrawPlayerWeapon(void);
    int     warpwx,warpwy,warpex,warpey;

    statetype   s_player = {false,0,0,(statefunc) T_Player,NULL,NULL};
    statetype   s_attack = {false,0,0,(statefunc) T_Attack,NULL,NULL};

    i've inserted void DrawPlayerWeapon(void); and int warpwx,warpwy,warpey,warpey;. This was stopped the linker errors.
    I didn't edited anything else.

    kkk911
    Don't Hurt Me!
    Don't Hurt Me!

    Male
    Number of posts : 61
    Age : 19
    Location : Hungary
    Hobbie : Modding, Photography, Gaming, collecting scale modells
    Registration date : 2012-03-25

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by kkk911 on Tue Jul 08, 2014 1:50 pm

    Well.....i'm about to give up. I've tried various methods (rewritings, to be exact) of fixing this, but the game still crashes when i enter the teleporter (both 2 of them).

    AlumiuN
    Don't Hurt Me!
    Don't Hurt Me!

    Number of posts : 52
    Age : 24
    Location : Christchurch, New Zealand
    Registration date : 2013-08-31

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by AlumiuN on Tue Jul 08, 2014 4:44 pm

    Did you make sure to add the exit points to the map?

    kkk911
    Don't Hurt Me!
    Don't Hurt Me!

    Male
    Number of posts : 61
    Age : 19
    Location : Hungary
    Hobbie : Modding, Photography, Gaming, collecting scale modells
    Registration date : 2012-03-25

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by kkk911 on Tue Jul 08, 2014 11:38 pm

    Yes, i did.

    AlumiuN
    Don't Hurt Me!
    Don't Hurt Me!

    Number of posts : 52
    Age : 24
    Location : Christchurch, New Zealand
    Registration date : 2013-08-31

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by AlumiuN on Tue Jul 08, 2014 11:58 pm

    Hmm, I'm afraid I don't know what would be causing that. Have you tried using the debugger? (I can't remember how to use it in Dev, but you'll have to enable debugging symbols in the project and rebuild all to use it).

    kkk911
    Don't Hurt Me!
    Don't Hurt Me!

    Male
    Number of posts : 61
    Age : 19
    Location : Hungary
    Hobbie : Modding, Photography, Gaming, collecting scale modells
    Registration date : 2012-03-25

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by kkk911 on Wed Jul 09, 2014 12:26 am

    I didn't tried debugger, yet.
    But, maybe i should.

    EDIT: Sadly, that didn't work either.
    Hmmm...can somebody do it for me? Or write a tutorial about it?

    AlumiuN
    Don't Hurt Me!
    Don't Hurt Me!

    Number of posts : 52
    Age : 24
    Location : Christchurch, New Zealand
    Registration date : 2013-08-31

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by AlumiuN on Wed Jul 09, 2014 4:12 am

    Did you get the debugger working? That should have at least told you where it was crashing, which would have given me something to go on. Do you want to email me your code and game data? My email is ctalyst666@gmail.com if you want to Smile

    kkk911
    Don't Hurt Me!
    Don't Hurt Me!

    Male
    Number of posts : 61
    Age : 19
    Location : Hungary
    Hobbie : Modding, Photography, Gaming, collecting scale modells
    Registration date : 2012-03-25

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by kkk911 on Wed Jul 09, 2014 5:27 am

    Well, if you can fix it to me, i would be glad! Smile
    I will send it to you!

    AlumiuN
    Don't Hurt Me!
    Don't Hurt Me!

    Number of posts : 52
    Age : 24
    Location : Christchurch, New Zealand
    Registration date : 2013-08-31

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by AlumiuN on Thu Jul 10, 2014 11:55 pm

    OK, I've taken a look, and removing the calls to DrawPlayerWeapon in WarpPlayer seemed to fix the problem. Smile

    kkk911
    Don't Hurt Me!
    Don't Hurt Me!

    Male
    Number of posts : 61
    Age : 19
    Location : Hungary
    Hobbie : Modding, Photography, Gaming, collecting scale modells
    Registration date : 2012-03-25

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by kkk911 on Mon Jul 14, 2014 2:50 am

    Just tested it out, and works like a charm! Very Happy
    Thanks for the help!

    Sponsored content

    Re: [Solved] Problem with Adding teleporters in SDL

    Post by Sponsored content Today at 7:52 pm


      Current date/time is Sat Dec 03, 2016 7:52 pm