(Old code tutorial) Wall Ammo Racks - KyleRTCW from Wolf Planet forum

View previous topic View next topic Go down

(Old code tutorial) Wall Ammo Racks - KyleRTCW from Wolf Planet forum

Post by Officer-M. John (Admin) on Thu Dec 01, 2016 11:59 am

Hello, welcome to my second tutorial here at WolfPlanet Forums
In this tutorial, I will be showing you how to make a wall into an Ammo Rack. Credit for this feature goes to Joe who is at DHW Forum but is inactive. Which is why I decided to release this.

You may need to adjust this tutorial based on your Game.

Read on.

Step 1: Open up WL_AGENT.C and do a search for: // use elevator

You should see this:

Code:

if (!buttonheld[bt_use] && doornum == ELEVATORTILE && elevatorok)
   {
   //
   // use elevator
   //
      buttonheld[bt_use] = true;

      tilemap[checkx][checky]++;      // flip switch
      if (*(mapsegs[0]+farmapylookup[player->tiley]+player->tilex) == ALTELEVATORTILE)
         playstate = ex_secretlevel;
      else
         playstate = ex_completed;
      SD_PlaySound (LEVELDONESND);
      SD_WaitSoundDone();
   }
   else if (!buttonheld[bt_use] && doornum & 0x80)
   {
      buttonheld[bt_use] = true;
      OperateDoor (doornum & ~0x80);
   }
   else
      SD_PlaySound (DONOTHINGSND);

}

Modify to look like this:

Code:

if (!buttonheld[bt_use] && doornum == ELEVATORTILE && elevatorok)
   {
   //
   // use elevator
   //
      buttonheld[bt_use] = true;

      tilemap[checkx][checky]++;      // flip switch
      if (*(mapsegs[0]+farmapylookup[player->tiley]+player->tilex) == ALTELEVATORTILE)
         playstate = ex_secretlevel;
      else
       playstate = ex_completed;
      SD_PlaySound (ERLAUBENSND);
      SD_WaitSoundDone();

   }
   // Ammo Rack
   if(!buttonheld[bt_use] && doornum == 25)  //WALL-ID in FloEdit, IMPORTANT
   {
   buttonheld[bt_use] = true;
   if(gamestate.ammo == 99)
   return; // Player has 99 ammo
   tilemap[checkx][checky]++; // Goes from WALL 25 to 26
   SD_PlaySound(GETAMMOSND);
   GiveAmmo (50); // or to your likings
   StartBonusFlash();
   }
   else if (!buttonheld[bt_use] && doornum & 0x80)
   {
      buttonheld[bt_use] = true;
      OperateDoor (doornum & ~0x80);
   }
     else
          SD_PlaySound (DONOTHINGSND);

}

if(!buttonheld[bt_use] && doornum == 25)
That 25 indicates what wall id the ammo rack is. You can get this wall id in FloEdit and I think in WDC (not sure) Wall ID 25 must be the ammo rack texture on both sides and wall-id 26 must be the empty wall rack after the player took the ammo on both sides

But remember, you can use any wall number that you wish.

Compile and Link up, you should now have Ammo Racks Smile

Writte by KyleRTCW (Kyle Albert) on Mon Jan 17, 2005 1:08 pm
avatar
Officer-M. John (Admin)
Admin

Posts : 323
Join date : 2015-10-02
Age : 19

View user profile http://wolf3dfanboys.usersboard.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum