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

infrared goggles?

Recommended Posts

I'd like to make a set of goggles for doom that use red instead of green so it looks like infra red. also i need it to be switchable on and off not just a power up like the doom infra red. can anyon help>? thanks in advance!

Share this post


Link to post

I'm going to add them via class to my character at the start of the game, i just want them to be switchable and hopefully red, if not the regular green is fine, need help with a decorate file thanks!

Share this post


Link to post

Red is no problem. Create a new powerup type derived from/replacing Light Goggles, and use Powerup.Color to define your own palette change.

The switchable thing, though, won't be easy at all. You might need to use global ACS scripts and bind them to a specific key. I've done this before, I've learned how to do it via looking into contents of KDiZD and Brutal Doom.

Or if you wanted to stick with DECORATE only, you'll need to create 2 kinds of custom inventory: "InfraredOn" and "InfraredOff". Let the player start with "InfraredOn" in his inventory. When the player activates it ("Activate Item" key), it'll give him your Infrared Goggles powerup and also give him "InfraredOff", while he'll lose "InfraredOn". Then (whenever he wants) he can activate "InfraredOff", which will take Infrared Goggles from him and give him "InfraredOn", and remove itself. That way you can switch the goggles on and off.

Or there is a much simpler solution which I don't know. I can never be sure, I'm not that much experienced in modding efficiently.

Share this post


Link to post

wow ok thanks for the help!
anyway i could get you to help me with a sample for the "InfraredOff", "InfraredOn" decorate? or good places to look for info on the subject?? thanks again!

Share this post


Link to post

http://zdoom.org/wiki/ - This is your place to go when learning everything about ZDoom features, ACS functions, DECORATE functions and native classes, even examples and brief tutorials, and more!

The solution I've suggested might be coded in a way like this: (I haven't tested it, if there are errors, ZDoomwiki should help you solving them)

ACTOR PowerMyRedVisor : PowerLightAmp                    // This will create a new type of fullbright powerup
{
  Powerup.Duration 0x7FFFFFFF                            // Practically infinite duration
  Powerup.Color "ff 00 00", 0.5                          // Feel free to change these values, look up "Powerup.Color" on ZDoomwiki
}
ACTOR PowerVisorOn : CustomInventory
{
  Inventory.MaxAmount 1
  +INVENTORY.INVBAR
  States {
    Spawn:
      TNT1 A -1
      stop
    Use:
      TNT1 A 0 A_GiveInventory("PowerMyRedVisor")
      TNT1 A 0 A_GiveInventory("PowerVisorOff")
      stop
  }
}
ACTOR PowerVisorOff : CustomInventory
{
  Inventory.MaxAmount 1
  +INVENTORY.INVBAR
  States {
    Spawn:
      TNT1 A -1
      stop
    Use:
      TNT1 A 0 A_TakeInventory("PowerMyRedVisor")
      TNT1 A 0 A_GiveInventory("PowerVisorOn")
      stop
  }
}
ACTOR MyDoomPlayer : DoomPlayer {                        // New player class, player starts with "PowerVisorOn" in his inventory
  Player.StartItem "Pistol"
  Player.StartItem "Fist"
  Player.StartItem "Clip", 50
  Player.StartItem "PowerVisorOn"
}
You need to enable the new player class via KEYCONF. Basically, you need to create a text lump "KEYCONF" in your wad and put this code there:
clearplayerclasses
addplayerclass "MyDoomPlayer"
Hope this helps.

Share this post


Link to post
scifista42 said:

You need to enable the new player class via KEYCONF.

This method of adding new player classes is deprecated and should be avoided completely in new projects, as it's a compatibility headache for modders.

Use of the MAPINFO method is advised and recommended. See here on how to use it.

Share this post


Link to post

awesome thanks! Ill test it out now! i already have an extra wad just for classes so ill add this to it! thanks again man!

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
×