The "How do I..." Thread

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
MeatyD
Posts: 61
Joined: Mon Mar 11, 2013 12:01 pm
Location: United States

Re: The "How do I..." Thread

Post by MeatyD »

You can use a HudMessage with a nonzero id argument. Printing a blank space with the same id will clear the message from the player's screen.
User avatar
lolwut?
Posts: 143
Joined: Sun Mar 14, 2010 3:41 am

Re: The "How do I..." Thread

Post by lolwut? »

How do I make spawners for enemies and weapons that wont spawn them with flying cubes like BossEye?
User avatar
MeatyD
Posts: 61
Joined: Mon Mar 11, 2013 12:01 pm
Location: United States

Re: The "How do I..." Thread

Post by MeatyD »

New actors deriving their properties from SpawnShot can spawn new monsters depending on their DropItem property. If you want to make random spawners on a map start that replace existing monsters, you can either give the monsters all the same DoomEdNum or make a new class that randomly jumps to an action that spawns a different monster.
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: The "How do I..." Thread

Post by Blue Shadow »

MeatyD wrote:If you want to make random spawners on a map start that replace existing monsters, you can either give the monsters all the same DoomEdNum or make a new class that randomly jumps to an action that spawns a different monster.
For random spawning, there is [wiki=Classes:RandomSpawner]RandomSpawner[/wiki] class.
User avatar
karmakazi
Posts: 126
Joined: Fri Mar 22, 2013 1:48 pm
Location: NYC

Re: The "How do I..." Thread

Post by karmakazi »

I made a custom sound for the pickup of a powerup, and was hoping to have the sound play for the duration of the powerup's effect (10 seconds) how do I accomplish this? Bonus question, is it possible to use a custom powerup.color tag? what color names/ arguments does gzdoom recognize in this field? Is it possible to have a spectre fuzz effect drawn in this way?
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: The "How do I..." Thread

Post by Blue Shadow »

karmakazi wrote:I made a custom sound for the pickup of a powerup, and was hoping to have the sound play for the duration of the powerup's effect (10 seconds) how do I accomplish this?
Does the sound last for the whole 10-second duration? If so, then what you want to do is use a [wiki=Classes:CustomInventory]custom inventory item[/wiki] that gives the powerup, and along with it, [wiki=A_PlaySound]plays the sound[/wiki].
is it possible to use a custom powerup.color tag? what color names/ arguments does gzdoom recognize in this field?
Not sure what you want to achieve here, but you can [wiki=Powerup_properties#Powerup.Color]check on the property[/wiki] itself and see how it's used.
User avatar
karmakazi
Posts: 126
Joined: Fri Mar 22, 2013 1:48 pm
Location: NYC

Re: The "How do I..." Thread

Post by karmakazi »

Does the sound last for the whole 10-second duration? If so, then what you want to do is use a [wiki=Classes:CustomInventory]custom inventory item[/wiki] that gives the powerup, and along with it, [wiki=A_PlaySound]plays the sound[/wiki].

What is happening now is that there is already a custom powerup in a mod made by someone else, and my sound (which lasts 9.590 seconds, close enough) begins play as usual, but is interrupted and stopped by picking up another item during playback.
is it possible to use a custom powerup.color tag? what color names/ arguments does gzdoom recognize in this field?
Not sure what you want to achieve here, but you can [wiki=Powerup_properties#Powerup.Color]check on the property[/wiki] itself and see how it's used.[/quote]

What I am attempting to achieve here is a custom "filter" for when the powerup is active. None of the five pre-existing ColorMap setting are not really what I had in mind. What I am trying to do as have a filter a bit more understated than traditional colormaps, (which are too saturated in my opinion) more specifically a whitish red, that will allow then game world colors to show through, and not be Pink-O-Vision. The reference links should be helpful. Thank you.
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: The "How do I..." Thread

Post by Blue Shadow »

karmakazi wrote:What is happening now is that there is already a custom powerup in a mod made by someone else, and my sound (which lasts 9.590 seconds, close enough) begins play as usual, but is interrupted and stopped by picking up another item during playback.

The interruption is normal. That's why I suggested what I suggested above. With [wiki]A_PlaySound[/wiki] you can choose the sound channel to play the sound on. Try and study the wiki article for the function and do some experimenting. As for the item being in a mod made by someone else, you either modify it directly or make an actor (again, that inherits from CustomInventory class), and use the replaces keyword to replace it with your "version" of the item. Like this:

Code: Select all

ACTOR YourItem : CustomInventory replaces ThePowerup
{
  // The item's code goes here...
}
What I am attempting to achieve here is a custom "filter" for when the powerup is active. None of the five pre-existing ColorMap setting are not really what I had in mind. What I am trying to do as have a filter a bit more understated than traditional colormaps, (which are too saturated in my opinion) more specifically a whitish red, that will allow then game world colors to show through, and not be Pink-O-Vision.
So you want something like the colormap effect but pink-ish, or something like the green screen tint resulting from picking up the radiation suit in Doom? If you want the former, then use [wiki=Powerup_properties#Powerup.Colormap]Powerup.Colormap[/wiki] property. If you want the latter, then use the already mentioned Powerup.Color property. Here is a couple of examples:

Code: Select all

Powerup.Color 128, 0, 192, 0.15

Code: Select all

Powerup.Colormap 0.5, 0, 0.75
The first line will give you this effect: http://i.imgur.com/57fW26z.png
The second line will give this effect: http://i.imgur.com/P0nX77F.png
User avatar
NeoSpearBlade
Posts: 51
Joined: Tue Mar 26, 2013 1:35 pm

Re: The "How do I..." Thread

Post by NeoSpearBlade »

Due to the title of this thread, I can ask this here instead of making a new thread. Convenient!

How do I correctly use Inheritance on weapons?

The reason why I'm asking is that to start with simple editing mods before I go into making more complex mods, I did slight editing on all of Doom's weapon animations and flashes and added the Press Release BFG fire mode by making it as an altfire.

After making sure to have a backup, these edits were done on the zdoom.PK3 file but since editing that can cause errors (like refusing to load a .DEH or .BEX file no matter what), I've since moved these edits as a separate .PK3 file but now I get an error message saying "Tried To Register Class '[weapon]' More Than Once" for every repeated actor. Since I don't know what errors this can cause and because the message was colored red when loading ZDOOM and in the console window (making me think it's an error but I'm not exactly sure how severe), I decided to use inheritance.

It worked.....just not the way I was expecting it to.

First, My edited weapons are in the game but I have to get them via console commands. In other words, the game still spawns me with the default 'Fist' and 'Pistol', not my edited 'NSBFist' and 'NSBPistol'.

Next, the weapon pickups are to the weapons I edited but once I'm holding one of the weapons, I cannot change weapons at all.

Finally, I also edited the 'Doom weapon base class' actor and I set it up so that every weapon has my custom bobbing movement without having to copy-and-paste them individually to each actor.....which is also not working. I'm still spawning in with the default 'Doom weapon base class'. Not only that, but even if I'm holding my edited weapons, they didn't receive my custom bobbing movement.

I know I'm doing something wrong and/or might be missing something. Can anyone help?
User avatar
ChronoSeth
Posts: 1631
Joined: Mon Jul 05, 2010 2:04 pm
Location: British Columbia

Re: The "How do I..." Thread

Post by ChronoSeth »

First, you need to set the slot the weapons are bound to. You can do this with Weapon.Slotnumber # in the weapon definition, or by creating a new player class and using [wiki=Actor_properties#Player.WeaponSlot]Player.WeaponSlot[/wiki].

Second, you need to replace the weapons with your edited counterparts. Inheritance does not immediately imply replacing an actor. To do this for actors spawned in maps, use the Replaces keyword.

Code: Select all

Actor MyNewWeapon : Shotgun Replaces Shotgun
{
stuff
}
This won't work for the player's starting items, since the replaces keyword only affects actors which are spawned in a map or by another actor; it does not affect inventory items which are directly placed in the player's inventory. Therefore, you need to modify the player class to change the list of starting items (with [wiki=Actor_properties#Player.StartItem]Player.StartItem[/wiki]).
User avatar
NeoSpearBlade
Posts: 51
Joined: Tue Mar 26, 2013 1:35 pm

Re: The "How do I..." Thread

Post by NeoSpearBlade »

.....Ahh, now it's working.

Thanks, ChronoSeth......

Image

.....Why am I spawning with 0 bullets? *sigh*

Now, what am I overlooking?

If it helps, here's the relevant code for DECORATE:

Code: Select all

// --------------------------------------------------------------------------
// Player base
// --------------------------------------------------------------------------

ACTOR NeoSpearBlade : DoomPlayer
{
	Player.StartItem "NSBFist"
	Player.StartItem "NSBPistol" 50
}

// --------------------------------------------------------------------------
// Pistol
// --------------------------------------------------------------------------

ACTOR NSBPistol : NSBDoomWeapon replaces Pistol
{
	Game Doom
	Weapon.SelectionOrder 1900
	Weapon.Kickback 100
	Weapon.AmmoUse 1
	Weapon.AmmoGive 20
	Weapon.AmmoType "Clip"
	Weapon.SlotNumber 2
	Obituary "$OB_MPPISTOL"
	+WEAPON.WIMPY_WEAPON
	+WEAPON.NOAUTOFIRE
	Inventory.Pickupmessage "$PICKUP_PISTOL_DROPPED"
	Tag "$TAG_PISTOL"
	States
	{
	Ready:
		PISG A 1 A_WeaponReady
		Loop
	Deselect:
		PISG A 1 A_Lower
		Loop
	Select:
		PISG A 1 A_Raise
		Loop
	Fire:
		PISG B 0
		PISG B 2 A_FirePistol
		PISG C 2
		PISG E 5
		PISG D 2
		Goto Ready
	Flash:
		PISF A 1 Bright A_Light1
		Goto LightDone
		PISF A 1 Bright A_Light1
		Goto LightDone
 	Spawn:
		PIST A -1
		Stop
	}
}
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: The "How do I..." Thread

Post by edward850 »

You are trying to spawn the player with 50 "NSBPistol"'s.

Code: Select all

ACTOR NeoSpearBlade : DoomPlayer
{
   Player.StartItem "NSBPistol" //First weapon added is the one selected on spawn
   Player.StartItem "NSBFist"
   Player.StartItem "Clip", 50
}
User avatar
NeoSpearBlade
Posts: 51
Joined: Tue Mar 26, 2013 1:35 pm

Re: The "How do I..." Thread

Post by NeoSpearBlade »

There we go.

Thanks, again.

Now, another question.

Is it possible for when an enemy attacks with a projectile, let's say The Mancubus, to play 2 sounds at once?
User avatar
MeatyD
Posts: 61
Joined: Mon Mar 11, 2013 12:01 pm
Location: United States

Re: The "How do I..." Thread

Post by MeatyD »

NeoSpearBlade wrote: Is it possible for when an enemy attacks with a projectile, let's say The Mancubus, to play 2 sounds at once?
Yes. Check out A_PlaySound and use 2 different channels.
User avatar
SPLCHRLCRNG
Posts: 23
Joined: Sun Mar 03, 2013 3:14 am
Location: the cave in my mind.
Contact:

Re: The "How do I..." Thread

Post by SPLCHRLCRNG »

Hello. I'm trying to make a working inventory for Doom 2. After following directions to make a berserkpack into an inventory item: http://doomnexus.drdteam.org/Tutorial/decorate.html The inventory icon is out of line.
Spoiler:
How do I make it align properly like Heretic & Hexen's inventory bars? I'm still learning so every detail is appreciated.
Locked

Return to “Editing (Archive)”