The "How do I..." Thread
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.
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.
- Ral22
- Posts: 531
- Joined: Sun Sep 05, 2010 12:09 pm
- Preferred Pronouns: He/Him
- Location: The Fortress of Dr. Radiaki
- Contact:
Re: The "How do I..." Thread
Is it possible to define kerning on fonts that are defined through FONTDEFS? Or maybe through some goofy workaround? I'm using the (much appreciated addition) of "DONTTRANSLATE" on my font, to make use of the PNG alpha, but if it's possible to apply kerning to it as well, it'd look even better.
- Ghost Prototype
- Posts: 185
- Joined: Sun May 19, 2013 12:22 pm
- Location: Philadelphia
Re: The "How do I..." Thread
Using hudmessage, is there a way to show quotation marks in a sentence?
Re: The "How do I..." Thread
To type in a quote in a string, you can escape it with a backslash:
will print "Hello".
Code: Select all
"\"Hello\""
- Ghost Prototype
- Posts: 185
- Joined: Sun May 19, 2013 12:22 pm
- Location: Philadelphia
Re: The "How do I..." Thread
Thanks, it worked.Gutawer wrote:To type in a quote in a string, you can escape it with a backslash:will print "Hello".Code: Select all
"\"Hello\""




- LanHikariDS
- Posts: 179
- Joined: Tue Aug 04, 2015 11:30 pm
- Location: Playing in the snow
Re: The "How do I..." Thread
How do I make a stackable Backpack? For example, Clip's maximum is 200. Pick up a backpack, it becomes 400. Pick up another, it becomes 600, and so on, and so forth.
-
- Posts: 5046
- Joined: Sun Nov 14, 2010 12:59 am
Re: The "How do I..." Thread
Check the example [wiki=SetAmmoCapacity]here[/wiki].
- PinkyDemon
- Posts: 4
- Joined: Mon Feb 27, 2017 5:55 pm
Re: The "How do I..." Thread
Let's say I wanted to spawn a monster that dies on Spawn but is resurrectable. How would you do that?
Re: The "How do I..." Thread
Disclaimer: as this is not the ZScript howto thread, I'm posting the DECORATE solution.
In ZScript, use PostBeginPlay.
Spawn:
TNT1 A 0 A_Jump("SpawnNotFirst")
TNT1 A 0 A_Die
SpawnNotFirst:
<your generic spawn code goes here>
The logic is that during actor's first Spawn state (when just placed), it will NOT execute A_Jump and die.
However if it later gets to Spawn as the result of being resurrected, (although it normally should go to See? idk), it will execute A_Jump and not die. Something like that.
This abuses the fact that the first frame of the spawn state is not executed when the actor is just spawned, thus providing place for initialization code in DECORATE.
In ZScript, use PostBeginPlay.
Spawn:
TNT1 A 0 A_Jump("SpawnNotFirst")
TNT1 A 0 A_Die
SpawnNotFirst:
<your generic spawn code goes here>
The logic is that during actor's first Spawn state (when just placed), it will NOT execute A_Jump and die.
However if it later gets to Spawn as the result of being resurrected, (although it normally should go to See? idk), it will execute A_Jump and not die. Something like that.
This abuses the fact that the first frame of the spawn state is not executed when the actor is just spawned, thus providing place for initialization code in DECORATE.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: The "How do I..." Thread
ZZYX, that seems to be the opposite of what PinkyDemon wants, which reads to me like they want a thing that starts off as a corpse, then if an archvile comes across it it can be raised like a monster killed ingame rather than just a decoration.
What I'd do (with some redundant stuff thrown in just in case a few things get moved around:EDIT: Just for reference,
(side note: A_Jump("SpawnNotFirst")? Does this actually work without the 256? If so this would be much handier...)
What I'd do (with some redundant stuff thrown in just in case a few things get moved around:
Code: Select all
actor startdeadimp:doomimp{
states{
spawn:
TROO A 0 nodelay{
if(countinv("Clip")<1){
A_GiveInventory("Clip");
A_Die("startdead");
}
}
goto super::spawn
death.startdead:
TROO M -1 canraise A_NoBlocking
stop
}
}
Spoiler:
(side note: A_Jump("SpawnNotFirst")? Does this actually work without the 256? If so this would be much handier...)
- worldendDominator
- Posts: 291
- Joined: Sun May 17, 2015 9:39 am
Re: The "How do I..." Thread
PinkyDemon wrote:Let's say I wanted to spawn a monster that dies on Spawn but is resurrectable. How would you do that?
Code: Select all
Spawn:
TNT1 A 0 NoDelay A_Die
Idle:
//Idle animation and A_Look and stuff
Although this is if you want it to "die immediately after spawning". If you want it to "spawn as a raisable corpse", then I think it's a bit more difficult.
Re: The "How do I..." Thread
My TNT1 A 0 WITHOUT nodelay does the same without inventory. Except you probably want to replace A_Die with A_Die("startdead").Vaecrius wrote:Code: Select all
if(countinv("Clip")<1){ A_GiveInventory("Clip"); A_Die("startdead"); }
Again, the logic is as follows:
Code: Select all
Spawn:
TNT1 A 0 A_Jump(256, "Spawn2") // <---- this will not be executed on first frame, but on any other frame it will skip the below instruction
TNT1 A 0 A_Die("startdead") // <---- this will be executed on first frame because jump is skipped (without NoDelay)
Spawn2:
// everything here will be executed both on first and whatever else Spawn frames without need for Idle or Clip hackery
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: The "How do I..." Thread
Oh, I see what you mean now!
We're basically doing the same thing but you're relying on the non-execution-first-frame logic which I almost never use specifically because it's really hard to mentally keep track of multiple negations like "if this is not the first time then you don't not do this thing that thereby avoids this other thing" which is compounded when "dying" is psychologically negative as well and trying to self-correct that it is a logically positive act in this context..... and that's pretty much how I ended up reading your post backwards.
Seconded re: "After spawning and dying, it will never enter Spawn state again." being clearly patently false - especially now that ZScript lets you make actors that can make other actors go into their Spawn state.
We're basically doing the same thing but you're relying on the non-execution-first-frame logic which I almost never use specifically because it's really hard to mentally keep track of multiple negations like "if this is not the first time then you don't not do this thing that thereby avoids this other thing" which is compounded when "dying" is psychologically negative as well and trying to self-correct that it is a logically positive act in this context..... and that's pretty much how I ended up reading your post backwards.
Seconded re: "After spawning and dying, it will never enter Spawn state again." being clearly patently false - especially now that ZScript lets you make actors that can make other actors go into their Spawn state.
-
- Posts: 62
- Joined: Sun May 15, 2016 2:19 pm
Re: The "How do I..." Thread
How do I make an item that when picked up they also gives another different item?
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: The "How do I..." Thread
What kind of item is it?
-
- Posts: 62
- Joined: Sun May 15, 2016 2:19 pm
Re: The "How do I..." Thread
Weapon is the one that gives the additional item.
I want to make a mod where doomguy has a weapon carry limit like in call of duty and other shit fpses
I want to make a mod where doomguy has a weapon carry limit like in call of duty and other shit fpses