Wolf Planet Forum Index Wolf Planet
We want you here!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Code] Wall Ammo Racks - KyleRTCW

 
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance
View previous topic :: View next topic  
Author Message
KyleRTCW
Moderator


Joined: 17 Jan 2005
Posts: 36
Location: United States

PostPosted: Mon Jan 17, 2005 1:08 pm    Post subject: [Code] Wall Ammo Racks - KyleRTCW Reply with quote

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
_________________
~Kyle Albert
Check out my TC: Click Here and Forum: Click Here
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance All times are GMT
Page 1 of 1

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001 phpBB Group

Chronicles phpBB2 theme by Jakob Persson (http://www.eddingschronicles.com). Stone textures by Patty Herford.