Author |
Message |
KyleRTCW
DieHard Officer

Joined: 30 Jul 2003
Last Visit: 10 Aug 2019
Topics: 45
Posts: 510
Location: Ohio

|
Posted: Mon Dec 06, 2004 3:16 pm
Subject: [Code] Wall Ammo Racks (UPDATE: BUG FIXED)
[ IP : Logged ]
|

 
|
|
Hello, this is a tutorial and making ammo racks for Wolfenstein 3D, this is designed to allow you to make a wall that can be used to get ammo off of then draw the next wall image to make it look like it's empty.
EDIT: Bug found, if you used this prior to 1/5/05 then please look for the red print in the code!!
Examples:
Before
After
This feature was not made made by me, member "Joe" shared this with me on AIM and I thought I'd share it with you!
Note: this tutorial can be changed to give other things too, instead of GiveAmmo, it could be GiveWeapon or HealSelf.
Ok enough chat, let's start
Open WL_AGENT.C and located the following block:
::: 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);
}
2. 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 == 1) // Important! Change 1 to the wall Id that you want to be displayed open floedit and check, for example, 1 is first wall, then when used the second image of the first wall is displayed. You may need to play around with this.
{
buttonheld[bt_use] = true;
if(gamestate.ammo >= 99) // or what ever your ammo limit is
return;
tilemap[checkx][checky]++;
SD_PlaySound(GETAMMOSND);
GiveAmmo (25); // Change to your liking!
StartBonusFlash();
}
else if (!buttonheld[bt_use] && doornum & 0x80)
{
buttonheld[bt_use] = true;
OperateDoor (doornum & ~0x80);
}
else
SD_PlaySound (DONOTHINGSND);
}
Done! Compile and Link up and test it. Please post any errors or mistakes I may have made, I have this feature in my Tc so it works for me, please do tell me of any compiling errors.
This tutorial is now official. |
_________________ Steam: http://steamcommunity.com/id/stormx312
Last edited by KyleRTCW on Wed Jan 05, 2005 3:15 pm; edited 4 times in total
|
|
 |
RichterBelmont12
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 24 Sep 2019
Topics: 98
Posts: 1524
Location: New Jersey

|
|
 |
lucky_foot
Don't Hurt Me


Joined: 05 Nov 2004
Last Visit: 19 Sep 2010
Topics: 13
Posts: 69
Location: Pennsylvania

|
Posted: Tue Dec 07, 2004 4:58 am
Subject: Re: [Tutorial]Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
LOL. I guess I can test it for ya.  |
_________________ JonathanS
Lucky foot Productions
www.luckyfootproductions.jtworld.net
|
|
 |
KyleRTCW
DieHard Officer

Joined: 30 Jul 2003
Last Visit: 10 Aug 2019
Topics: 45
Posts: 510
Location: Ohio

|
Posted: Wed Dec 08, 2004 12:49 pm
Subject: Re: [Tutorial]Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
Has anyone tried it yet? Does it work??
I have the code in my TC so it should work. |
_________________ Steam: http://steamcommunity.com/id/stormx312
|
|
 |
Hair Machine
DieHard SS


Joined: 24 Nov 2003
Last Visit: 29 Oct 2018
Topics: 8
Posts: 427
Location: editing my profile

|
Posted: Wed Dec 08, 2004 1:19 pm
Subject: Re: [Tutorial]Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
Well... it looks exactly the same as my code - so I guess it should work. By a brilliant process of logic. |
_________________ Rar rar fiddle di dee
|
|
 |
lucky_foot
Don't Hurt Me


Joined: 05 Nov 2004
Last Visit: 19 Sep 2010
Topics: 13
Posts: 69
Location: Pennsylvania

|
Posted: Thu Dec 09, 2004 5:04 am
Subject: Re: [Tutorial]Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
Okay, Lucky Foot here. I just tested the code above for my new TC that is in process and the Code DOES work without any changes to it. I can officially say that it works.
Great job.  |
_________________ JonathanS
Lucky foot Productions
www.luckyfootproductions.jtworld.net
|
|
 |
KyleRTCW
DieHard Officer

Joined: 30 Jul 2003
Last Visit: 10 Aug 2019
Topics: 45
Posts: 510
Location: Ohio

|
Posted: Thu Dec 09, 2004 3:34 pm
Subject: Re: [Tutorial]Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
Thanks for testing it lucky, this code is now official  |
_________________ Steam: http://steamcommunity.com/id/stormx312
|
|
 |
Guest

Last Visit:
|
Posted: Wed Jan 05, 2005 11:31 am
Subject: Re: [Code] Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
Is it possible to change a thing to this code?
Because now you can get ammo as much as you wish, but when you have full ammo, and than try to get ammo the wall is empty. But when you never have full ammo you can get every time again ammo on the wall.
Is het possible that you can just ammo for one time? |
|
|
 |
KyleRTCW
DieHard Officer

Joined: 30 Jul 2003
Last Visit: 10 Aug 2019
Topics: 45
Posts: 510
Location: Ohio

|
Posted: Wed Jan 05, 2005 12:54 pm
Subject: Re: [Code] Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
I can't exactly understand what you are saying, your sentences are not clear. I just tested in Todpfad and I tested for what I interepted from your message (taking ammo from the wall twice) and I cannot take it more than once even without full ammo.
Please, if you are having a problem, please tell me specificly whats going on.
~Kyle |
_________________ Steam: http://steamcommunity.com/id/stormx312
|
|
 |
Guest

Last Visit:
|
Posted: Wed Jan 05, 2005 1:16 pm
Subject: Re: [Code] Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
Sorry for my bad english, but you interepted it well! That's exactly what i mean. I can get the ammo from the walls every time again and again.
Don't know what I did wrong. I didn't change anything of the code, just copied it.
If you have a little time: here's my source code: http://members.home.nl/l.euser/Bramaldo_Source2.zip |
|
|
 |
Haasboy
DieHard Officer

Joined: 23 Jul 2003
Last Visit: 09 Dec 2019
Topics: 58
Posts: 581
Location: South Africa, Johannesburg

|
Posted: Wed Jan 05, 2005 1:36 pm
Subject: Re: [Code] Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
I've just had a look at your source, and everything looks norm, there's no way that you'd be able to get the ammo twice even with full ammo. |
_________________ Haasboy Engine - Currently under construction (To be used with future mods - F.A.D.E.D. - Mansion X - Rising Evil Series)
|
|
 |
Guest

Last Visit:
|
Posted: Wed Jan 05, 2005 1:58 pm
Subject: Re: [Code] Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
If I have 99 ammo, and than I push on the spacebar when I am at the ammowall, than it stops. But when I have 1 ammo, I can raise the ammo up to 99. |
|
|
 |
thejosh
I am Death Incarnate


Joined: 26 Apr 2003
Last Visit: 22 Nov 2009
Topics: 4
Posts: 150

|
Posted: Wed Jan 05, 2005 2:16 pm
Subject: Re: [Code] Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
if(gamestate.ammo >= 99) // or what ever your ammo limit is
try commenting out that line. |
_________________ thejosh Official procrastinator
Lair of the Mantis
|
|
 |
Guest

Last Visit:
|
Posted: Wed Jan 05, 2005 2:28 pm
Subject: Re: [Code] Wall Ammo Racks
[ IP : Logged ]
|

  
|
|
Thanks thejosh!
It works perfect now! |
|
|
 |
KyleRTCW
DieHard Officer

Joined: 30 Jul 2003
Last Visit: 10 Aug 2019
Topics: 45
Posts: 510
Location: Ohio

|
|
 |
Thomas
Mapping Master

Joined: 23 Nov 2004
Last Visit: 0:27 ago.
Topics: 165
Posts: 5205

|
Posted: Sun Jan 09, 2005 3:21 am
Subject: Re: [Code] Wall Ammo Racks (UPDATE: BUG FIXED)
[ IP : Logged ]
|

  
|
|
..... |
Last edited by Thomas on Thu May 26, 2011 3:52 am; edited 1 time in total
|
|
 |
Guest

Last Visit:
|
|
 |
|