Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Mike800

I need help replacing weapons

Recommended Posts

Replacing starting weapons is a bit complicated, you basically need to replace the player class. (Or use dehacked to transform the starting weapon, but that's even more complicated and a lot more limited.)

Replacing the choice of player class is done with a GameInfo block in the ZMAPINFO lump: http://zdoom.org/wiki/MAPINFO/GameInfo_definition

Defining the new player class isn't too hard if you derive from DoomPlayer and only change its startitems:
http://zdoom.org/wiki/Creating_new_player_classes
http://zdoom.org/wiki/Classes:DoomPlayer

ACTOR ReaperDoomPlayer : DoomPlayer
{
  Player.StartItem "Reaper"
  Player.StartItem "Fist"
  Player.StartItem "Clip", 50
  Player.WeaponSlot 2, Reaper
}
If needed, replace "Reaper" with the actual class name of the reaper gun, which I haven't checked. Also replace Clip with whatever ammo type the reaper gun uses, if it isn't clip, and 50 with however many starting munitions would make sense for it.

Share this post


Link to post

Since they aren't starting weapons, it's simpler. Since you're already replacing the player class, you can add this to it:

Player.WeaponSlot 3, HeavyRifle
Then in ZMAPINFO, you'll want to add an editor number definition block. The shotgun normally has ednum 2001, and the supershotgun normally has ednum 82, so it'll be like this:
DoomEdNums
{
  82 = HeavyRifle
  2001 = HeavyRifle
}
That'll take care of all shotguns placed in the map editor.

Now, enemies such as sergeants will still drop their shotguns. So take the code of the heavy rifle, and add "replaces Shotgun" to it. This example is about monsters, but it shows you how the replaces keyword is used.

Share this post


Link to post
Gez said:

DoomEdNums
{
  82 = HeavyRifle
  2001 = HeavyRifle
}

I can't load the game with this code using GZDoom 1.8.6 and PSX Doom 2.134. (This TC doesn't work well with the latest version of GZDoom.) What is the solution?

Share this post


Link to post

That feature is new since a very recently released ZDoom 2.8.1, so you need a version of GZDoom that was released after ZDoom 2.8.1 + actually containing its features according to changelog. Alternatively, use ZDoom 2.8.1 itself - it's an identical engine to GZDoom except for using software renderer instead of OpenGL.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×