Jump to content

Photo

Bulk force arrival coordinates away from 0,0


  • Please log in to reply
1 reply to this topic

#1 ShadowTiger

ShadowTiger

    The Doctor Is In

  • Members

Posted 09 August 2019 - 11:39 AM

Aside from the fact that 0,0 looks a bit like a snowman's face,  for years and years we've all had this recurring issue where when we make a new screen, we forget to move the player warp arrival coordinates (The four blue squares, and sometimes the green square) away from the upper left corner of the screen at coordinates 0,0 to somewhere else.

 

That means if someone warps to that screen, they instantly get stuck in the corner of that screen and can only move left into another corner on the next screen.  Heaven help you if they also have the "Continue Here" flag checked on that Dmap.

 

Given how easy it is to neglect that on new screens that don't implicitly have a warp on that screen or are warped to on purpose, I think it just might be worth having some kind of solution.

 

While it's true that we have an integrity check (Thank you for that, by the way.) which does indeed detect whether warps, I don't know what it can do in terms of continue errors.  I just had someone end up in the corner in a room that I could've sworn there were no warps in, and now his entire game is worthless until I release a new version that has those warp coordinates moved.

 

It's just really bad practice to have the warp arrival coordinates in such a dangerous place by default. I suppose that's why I'm making this thread.  What does everyone think?

 



#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 09 August 2019 - 12:27 PM

Aside from the fact that 0,0 looks a bit like a snowman's face,  for years and years we've all had this recurring issue where when we make a new screen, we forget to move the player warp arrival coordinates (The four blue squares, and sometimes the green square) away from the upper left corner of the screen at coordinates 0,0 to somewhere else.

 

That means if someone warps to that screen, they instantly get stuck in the corner of that screen and can only move left into another corner on the next screen.  Heaven help you if they also have the "Continue Here" flag checked on that Dmap.

 

Given how easy it is to neglect that on new screens that don't implicitly have a warp on that screen or are warped to on purpose, I think it just might be worth having some kind of solution.

 

While it's true that we have an integrity check (Thank you for that, by the way.) which does indeed detect whether warps, I don't know what it can do in terms of continue errors.  I just had someone end up in the corner in a room that I could've sworn there were no warps in, and now his entire game is worthless until I release a new version that has those warp coordinates moved.

 

It's just really bad practice to have the warp arrival coordinates in such a dangerous place by default. I suppose that's why I'm making this thread.  What does everyone think?

 

namespace shadowtiger
{
    const int DEFAULT_WARPARRIVAL_X = 40; //Set your default values here
    const int DEFAULT_WARPARRIVAL_Y = 60;
    bool hasplayed;
    bool init_arrivalsquares(int x, int y)
    {
        mapdata theMap;
        for ( int m = MapCount(); m > 0; --m )
        {
            for ( int s = 0; s < 128; ++s )
            {
                theMap = Game->LoadMapData(m,s);
                for ( int w = 0; w < 4; ++w )
                {
                    if ( !(theMap->WarpArrivalX[w]) && !(theMap->WarpArrivalY[w]) )
                    {
                        theMap->WarpArrivalX[w] = x;
                        theMap->WarpArrivalY[w] = y;
                    }
                }
            }
        }
    }
}


global script ST_Launch //onLaunch slot
{
    void run()
    {
        if (!shadowtiger::hasplayed)
        {
            shadowtiger::init_arrivalsquares(shadowtiger::DEFAULT_WARPARRIVAL_X,shadowtiger::DEFAULT_WARPARRIVAL_Y);
            SaveSRAM("ShadowTigerQuestName_Maps.sram", 0x20);
            shadowtiger::hasplayed = true;
        }
        else
        {
            LoadSRAM("ShadowTigerQuestName_Maps.sram", 0x20)
        }
    }
}

  • ShadowTiger likes this


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users