Quick Modding/Hacking Answers Thread

Jan 13, 2011 at 5:48 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
I KNOW how to change them, I just needed the name for face.pbm. As I said, I've already edited some weapons.
 
Jan 13, 2011 at 5:49 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Pronouns: he/him
I don't understand what you don't understand D:

face.pbm is called face.pbm, it's located in the same place as arms.pbm and bullet.pbm and MyChar.pbm...
 
Jan 13, 2011 at 5:52 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
...I only needed the file's name with the facesets in it. I can edit them fine, I've done it tons of times before.
 
Jan 13, 2011 at 5:55 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Pronouns: he/him
Jan 13, 2011 at 6:06 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
I have no idea what you're asking. Let's just drop it, cause I have everything I need, and we've already filled, like, three pages.
 
Jan 13, 2011 at 7:07 PM
graters gonna grate
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jul 2, 2008
Location: &
Posts: 1886
Age: 32
Pronouns: he/him
Noxid said:
Rename it to face.bmp and edit it with MS Paint, then change the extension back to .pbm?

A better way is to just set *.pbm files to automatically open with MS Paint.
 
Jan 13, 2011 at 7:44 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
So, what about making a new item? Do you need a hex editor to do that? I wanna make an infinite-power booster.
 
Jan 13, 2011 at 8:00 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Pronouns: he/him
Well you need hacks if you want your item to do anything that isn't handled by TSC or otherwise already existing. For infinite booster, this has already been handled a jillion times but here:

Change 0x157A7 from: 32 00 00 00
to: 00 00 13 37
for infinite level 1 booster

Change 0x157BD from: 32 00 00 00
to: 00 00 13 37
for infinite level 2 booster
 
Jan 13, 2011 at 8:05 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
Alright, thanks. So I guess those values change the boost time? Could you also tell me the "range" of the total code for booster 2.0?
 
Jan 13, 2011 at 8:23 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Pronouns: he/him
If by range you mean the limits in which it exists, then that would be the following two segements: 0x1578F-0x157CC, (refuelling) and 0x15933-0x15F4A (boosting, among other things)

For fun, this is the function that contains all the booster stuff, sort-of decompiled.

Code:
void __cdecl PlayerAgil(int CanControlPC)
{
  int v1; // ecx@162
  int v2; // eax@166
  int v3; // edx@170
  int v4; // eax@171
  int WaterX2; // ST48_4@201
  int WaterVelY2; // ST10_4@201
  int WaterVelX2; // eax@201
  int WaterX; // ST48_4@207
  int WaterVelY; // ST10_4@207
  int WaterVelX; // eax@207
  signed int WaterDir; // [sp+0h] [bp-2Ch]@195
  unsigned int JumpSpeed; // [sp+4h] [bp-28h]@4
  unsigned int WalkSpeed; // [sp+8h] [bp-24h]@4
  unsigned int Friction; // [sp+Ch] [bp-20h]@4
  unsigned int Grav; // [sp+10h] [bp-1Ch]@4
  unsigned int AirControl; // [sp+14h] [bp-18h]@4
  unsigned int MaxRunSpeed; // [sp+18h] [bp-14h]@4
  unsigned int GravLow; // [sp+1Ch] [bp-10h]@4
  signed int j; // [sp+24h] [bp-8h]@199
  signed int i; // [sp+24h] [bp-8h]@205

  if ( !(PlayerFlags & 2) )
  {
    if ( PlayerTileCollis & 0x100 )
    {
      MaxRunSpeed = 0x196u;
      Grav = 0x28u;
      GravLow = 0x10u;
      JumpSpeed = 0x280u;
      WalkSpeed = 0x2Au;
      AirControl = 0x10u;
      Friction = 0x19u;
    }
    else
    {
      MaxRunSpeed = 0x32Cu;
      Grav = 0x50u;
      GravLow = 0x20u;
      JumpSpeed = 0x500u;
      WalkSpeed = 0x55u;
      AirControl = 0x20u;
      Friction = 0x33u;
    }
    GenerateQmark = 0;
    if ( !CanControlPC )
      BoostState = 0;
    if ( PlayerTileCollis & 8 || PlayerTileCollis & 0x10 || PlayerTileCollis & 0x20 )
    {
      BoostState = 0;
      if ( EquippedItems & 1 )
      {
        JetPackEnergy = 0x32u;
      }
      else
      {
        if ( EquippedItems & 0x20 )
          JetPackEnergy = 0x32u;
        else
          JetPackEnergy = 0;
      }
      if ( CanControlPC )
      {
        if ( Key_Pressed != Key_Down || Key_Held != Key_Down || PlayerFlags & 1 || GameState & 4 )
        {
          if ( Key_Held != Key_Down )
          {
            if ( KeyLeft & Key_Held )
            {
              if ( PlayerXVel > -MaxRunSpeed )
                PlayerXVel -= WalkSpeed;
            }
            if ( KeyRight & Key_Held )
            {
              if ( PlayerXVel < (signed int)MaxRunSpeed )
                PlayerXVel += WalkSpeed;
            }
            if ( KeyLeft & Key_Held )
              DirectionFaced = 0;
            if ( KeyRight & Key_Held )
              DirectionFaced = 2;
          }
        }
        else
        {
          PlayerFlags |= 1u;
          GenerateQmark = 1;
        }
      }
      if ( !(PlayerFlags & 0x20) )
      {
        if ( PlayerXVel < 0 )
        {
          if ( PlayerXVel <= -Friction )
            PlayerXVel += Friction;
          else
            PlayerXVel = 0;
        }
        if ( PlayerXVel > 0 )
        {
          if ( PlayerXVel >= (signed int)Friction )
            PlayerXVel -= Friction;
          else
            PlayerXVel = 0;
        }
      }
    }
    else
    {
      if ( CanControlPC )
      {
        if ( EquippedItems & 0x21 )
        {
          if ( Key_Jump & Key_Pressed )
          {
            if ( JetPackEnergy )
            {
              if ( EquippedItems & 1 )
              {
                BoostState = 1;
                if ( PlayerYVel > 256 )
                  PlayerYVel /= 2;
              }
              if ( EquippedItems & 0x20 )
              {
                if ( Key_Up & Key_Held )
                {
                  BoostState = 2;
                  PlayerXVel = 0;
                  PlayerYVel = -1535;
                }
                else
                {
                  if ( KeyLeft & Key_Held )
                  {
                    BoostState = 1;
                    PlayerYVel = 0;
                    PlayerXVel = -1535;
                  }
                  else
                  {
                    if ( KeyRight & Key_Held )
                    {
                      BoostState = 1;
                      PlayerYVel = 0;
                      PlayerXVel = 1535;
                    }
                    else
                    {
                      if ( Key_Down & Key_Held )
                      {
                        BoostState = 3;
                        PlayerXVel = 0;
                        PlayerYVel = 1535;
                      }
                      else
                      {
                        BoostState = 2;
                        PlayerXVel = 0;
                        PlayerYVel = -1535;
                      }
                    }
                  }
                }
              }
            }
          }
        }
        if ( KeyLeft & Key_Held )
        {
          if ( PlayerXVel > -MaxRunSpeed )
            PlayerXVel -= AirControl;
        }
        if ( KeyRight & Key_Held )
        {
          if ( PlayerXVel < (signed int)MaxRunSpeed )
            PlayerXVel += AirControl;
        }
        if ( KeyLeft & Key_Held )
          DirectionFaced = 0;
        if ( KeyRight & Key_Held )
          DirectionFaced = 2;
      }
      if ( EquippedItems & 0x20 )
      {
        if ( BoostState )
        {
          if ( !(Key_Jump & Key_Held) || !JetPackEnergy )
          {
            if ( BoostState == 1 )
            {
              PlayerXVel /= 2;
            }
            else
            {
              if ( BoostState == 2 )
                PlayerYVel /= 2;
            }
          }
        }
      }
      if ( !JetPackEnergy || !(Key_Jump & Key_Held) )
        BoostState = 0;
    }
    if ( CanControlPC )
    {
      if ( Key_Up & Key_Held )
        IsFacingUp = 1;
      else
        IsFacingUp = 0;
      IsFacingDown = Key_Down & Key_Held && !(PlayerTileCollis & 8);
      if ( Key_Jump & Key_Pressed )
      {
        if ( PlayerTileCollis & 8 || PlayerTileCollis & 0x10 || PlayerTileCollis & 0x20 )
        {
          if ( !(PlayerTileCollis & 0x2000) )
          {
            PlayerYVel = -JumpSpeed;
            PlaySound(15, 1);
          }
        }
      }
    }
    if ( CanControlPC )
    {
      if ( Key_Held & (Key_Shoot | Key_Jump | Key_Up | KeyRight | KeyLeft) )
        PlayerFlags &= 0xFEu;
    }
    if ( BoostState )
    {
      if ( JetPackEnergy )
        --JetPackEnergy;
    }
    if ( PlayerTileCollis & 0x1000 )
      PlayerXVel -= 136;
    if ( PlayerTileCollis & 0x2000 )
      PlayerYVel -= 128;
    if ( PlayerTileCollis & 0x4000 )
      PlayerXVel += 136;
    if ( PlayerTileCollis & 0x8000 )
      PlayerYVel += 85;
    if ( EquippedItems & 0x20 && BoostState )
    {
      switch ( BoostState )
      {
        case 1:
          if ( PlayerTileCollis & 5 )
            PlayerYVel = -256;
          if ( !DirectionFaced )
            PlayerXVel -= 32;
          if ( DirectionFaced == 2 )
            PlayerXVel += 32;
          if ( Key_Jump & Key_Pressed || JetPackEnergy % 3 == 1 )
          {
            if ( !DirectionFaced )
              CreateEffect(PlayerX + 0x400, PlayerY + 0x400, 7, 2);
            if ( DirectionFaced == 2 )
              CreateEffect(PlayerX - 0x400, PlayerY + 0x400, 7, 0);
            PlaySound(113, 1);
          }
          break;
        case 2:
          PlayerYVel -= 32;
          if ( Key_Jump & Key_Pressed || JetPackEnergy % 3 == 1 )
          {
            CreateEffect(PlayerX, PlayerY + 0xC00, 7, 3);
            PlaySound(113, 1);
          }
          break;
        case 3:
          if ( Key_Jump & Key_Pressed || JetPackEnergy % 3 == 1 )
          {
            CreateEffect(PlayerX, PlayerY - 0xC00, 7, 1);
            PlaySound(113, 1);
          }
          break;
      }
    }
    else
    {
      if ( PlayerTileCollis & 0x2000 )
      {
        PlayerYVel += Grav;
      }
      else
      {
        if ( EquippedItems & 1 && BoostState && PlayerYVel > -1024 )
        {
          PlayerYVel -= 32;
          if ( !(JetPackEnergy % 3) )
          {
            CreateEffect(PlayerX, PlayerY + PCHitrectDown / 2, 7, 3);
            PlaySound(113, 1);
          }
          if ( PlayerTileCollis & 2 )
            PlayerYVel = 512;
        }
        else
        {
          if ( PlayerYVel < 0 && CanControlPC && Key_Jump & Key_Held )
            PlayerYVel += GravLow;
          else
            PlayerYVel += Grav;
        }
      }
    }
    if ( !CanControlPC || !(Key_Jump & Key_Pressed) )
    {
      if ( PlayerTileCollis & 0x10 )
      {
        if ( PlayerXVel < 0 )
          PlayerYVel = -PlayerXVel;
      }
      if ( PlayerTileCollis & 0x20 )
      {
        if ( PlayerXVel > 0 )
          PlayerYVel = PlayerXVel;
      }
      if ( PlayerTileCollis & 8 )
      {
        v1 = PlayerTileCollis;
        if ( v1 & 0x80000 )
        {
          if ( PlayerXVel < 0 )
            PlayerYVel = 1024;
        }
      }
      if ( PlayerTileCollis & 8 )
      {
        v2 = PlayerTileCollis;
        if ( v2 & 0x10000 )
        {
          if ( PlayerXVel > 0 )
            PlayerYVel = 1024;
        }
      }
      if ( PlayerTileCollis & 8 )
      {
        v3 = PlayerTileCollis;
        if ( v3 & 0x20000 )
        {
          v4 = PlayerTileCollis;
          if ( v4 & 0x40000 )
            PlayerYVel = 1024;
        }
      }
    }
    if ( !(PlayerTileCollis & 0x100) || PlayerTileCollis & 0xF000 )
    {
      if ( PlayerXVel < -1535 )
        PlayerXVel = -1535;
      if ( PlayerXVel > 1535 )
        PlayerXVel = 1535;
      if ( PlayerYVel < -1535 )
        PlayerYVel = -1535;
      if ( PlayerYVel > 1535 )
        PlayerYVel = 1535;
    }
    else
    {
      if ( PlayerXVel < -767 )
        PlayerXVel = -767;
      if ( PlayerXVel > 767 )
        PlayerXVel = 767;
      if ( PlayerYVel < -767 )
        PlayerYVel = -767;
      if ( PlayerYVel > 767 )
        PlayerYVel = 767;
    }
    if ( !IsInWater )
    {
      if ( PlayerTileCollis & 0x100 )
      {
        if ( PlayerTileCollis & 0x800 )
          WaterDir = 2;
        else
          WaterDir = 0;
        if ( PlayerTileCollis & 8 || PlayerYVel <= 512 )
        {
          if ( PlayerXVel > 512 || PlayerXVel < -512 )
          {
            for ( i = 0; i < 8; ++i )
            {
              WaterX = PlayerX + (Random(-8, 8) << 9);
              WaterVelY = Random(-512, 128);
              WaterVelX = Random(-512, 512);
              CreateNPC(73, WaterX, PlayerY, PlayerXVel + WaterVelX, WaterVelY, WaterDir, 0, 0);
            }
            PlaySound(0x38u, 1);
          }
        }
        else
        {
          for ( j = 0; j < 8; ++j )
          {
            WaterX2 = PlayerX + (Random(-8, 8) << 9);
            WaterVelY2 = Random(-512, 128) - PlayerYVel / 2;
            WaterVelX2 = Random(-512, 512);
            CreateNPC(73, WaterX2, PlayerY, PlayerXVel + WaterVelX2, WaterVelY2, WaterDir, 0, 0);
          }
          PlaySound(0x38u, 1);
        }
        IsInWater = 1;
      }
    }
    if ( !(PlayerTileCollis & 0x100) )
      IsInWater = 0;
    if ( PlayerTileCollis & 0x400 )
      TakeDamage(10);
    if ( DirectionFaced )
    {
      QuoteCameraOffsetX += 512;
      if ( QuoteCameraOffsetX > 32768 )
        QuoteCameraOffsetX = 32768;
    }
    else
    {
      QuoteCameraOffsetX -= 512;
      if ( QuoteCameraOffsetX < -32768 )
        QuoteCameraOffsetX = -32768;
    }
    if ( Key_Up & Key_Held && CanControlPC )
    {
      QuoteCameraOffsetY -= 512;
      if ( QuoteCameraOffsetY < -32768 )
        QuoteCameraOffsetY = -32768;
    }
    else
    {
      if ( Key_Down & Key_Held && CanControlPC )
      {
        QuoteCameraOffsetY += 512;
        if ( QuoteCameraOffsetY > 32768 )
          QuoteCameraOffsetY = 32768;
      }
      else
      {
        if ( QuoteCameraOffsetY > 512 )
          QuoteCameraOffsetY -= 512;
        if ( QuoteCameraOffsetY < -512 )
          QuoteCameraOffsetY += 512;
      }
    }
    QuoteCamPosX = QuoteCameraOffsetX + PlayerX;
    QuoteCamPosY = QuoteCameraOffsetY + PlayerY;
    if ( PlayerXVel > (signed int)Friction || PlayerXVel < -Friction )
      PlayerX += PlayerXVel;
    PlayerY += PlayerYVel;
  }
 
Jan 13, 2011 at 8:53 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
Alright, maybe i'll do some trial and error and see what i can accomplish.
 
Jan 13, 2011 at 9:02 PM
Hey.
"In Soviet Russia, graves keep YOU!"
Join Date: Oct 20, 2010
Location: Within the hearts of all
Posts: 691
Age: 104
Pronouns: he/him
I'm sorry, but I'm still having a slight problem. Either Monster X's coordinates aren't changing, or they're not changing correctly. I keep finding him in a giant wall. Like, I can see the fish being shot out of the wall, but no Monster X. So, I ask of you, could someone please explain this to me as descriptive as you can? I get that you need to edit the numbers and such, but I'm slightly confused. Maybe you switched X and Y on accident? Once again, thanks for the help.
 
Jan 14, 2011 at 12:48 AM
I don't anymore.
"I'm sorry Mario, but your princess is in another castle."
Join Date: Aug 9, 2010
Location: Greener Pastures
Posts: 1188
Age: 30
Here's a fun questipn. I took a break from the water and began editing the bubbler, yet the code for bubbler 2/3 bullet spawning is different. It isn't written in the same way it is in the Compendium, and I want it to spawn the same bullets for them both. I'm trying to make them fire the spurs that the level 3 bubbles turn into.
 
Jan 14, 2011 at 1:08 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
This is kind of a noob question, but I am a noob. So, quiet.
What's with the TSC command <ANP? X is the entity ID, right? So, what is y? Does it relate to the entity? When I tried to make balrog ANP with y = 0001, it made him into a teal square. Also, is there a way to make it move in a direction?
 
Jan 14, 2011 at 1:17 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Pronouns: he/him
I recommend reading a guide with explanations of the basics and various TSC commands. That should give you a general understanding of at least what can be done without the need for "hax". As for your question, <ANP changes the scriptstate of a particular entity which relates to different program flow pathes hardcoded into the executable. There's Anp.txt which can give you the values for the most common and known entities, other than that either experimentation or hacking can tell you. Often ANP will have no use if the entity wasn't coded to use it, or it will break the entity so to speak.

@ Ollie you have to make a call to the Create Bullet function somewhere in the lvl 2 bubble code, preferably in the section that executes when the bullet's time has elapsed and it destroys itself.
 
Jan 14, 2011 at 1:21 AM
Hey.
"In Soviet Russia, graves keep YOU!"
Join Date: Oct 20, 2010
Location: Within the hearts of all
Posts: 691
Age: 104
Pronouns: he/him
Noxid said:
@ Ollie you have to make a call to the Create Bullet function somewhere in the lvl 2 bubble code, preferably in the section that executes when the bullet's time has elapsed and it destroys itself.

I didn't ask that. It was HyMyNameIsMatt.
 
Jan 14, 2011 at 1:26 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Pronouns: he/him
I'm sorry Shadow Major, I seem to have gotten you confused with Malpercio.
 
Jan 14, 2011 at 2:26 AM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3052
Oh phooey.
Unlikely that I switched x's and y's's. First guess is that x value is monsterx's x plus c. coz youknow how it's more tiles than the room? it may just be fifty tiles offset or sumpin. Try adding numbers around the magnitude.
 
Jan 14, 2011 at 5:39 AM
I don't anymore.
"I'm sorry Mario, but your princess is in another castle."
Join Date: Aug 9, 2010
Location: Greener Pastures
Posts: 1188
Age: 30
I'm an idiot. Words can not descride.just how.smooth my brain is. Infigured out how to make the water do damage upon touch.
...
... npctable editor. Apparently entity 191 move along with the water, so I just increased it's size and added damage to it. I SPENT A WEEK IN ASSEMBLY TO FIGURE THAT OUT! I am so pissed and yet so happy.

I'm going to go bang my head into a wall now.
 
Jan 14, 2011 at 5:45 AM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Oct 30, 2010
Location: New Zealand
Posts: 112
Age: 28
WoodenRat said:
Just use the slider on the right, the entity numbers that change are the same as you see in the map editor.

Genius, man. I can't believe I never saw that... :o

Noxid said:
I'm sorry Shadow Major, I seem to have gotten you confused with Malpercio.

:o What are you sorry for? You never caused any harm.

Edit: How do you change the illustrations for the credits?
 
Back
Top