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
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

Post by Ral22 »

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.
User avatar
Ghost Prototype
Posts: 185
Joined: Sun May 19, 2013 12:22 pm
Location: Philadelphia

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

Post by Ghost Prototype »

Using hudmessage, is there a way to show quotation marks in a sentence?
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

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

Post by Gutawer »

To type in a quote in a string, you can escape it with a backslash:

Code: Select all

"\"Hello\""
will print "Hello".
User avatar
Ghost Prototype
Posts: 185
Joined: Sun May 19, 2013 12:22 pm
Location: Philadelphia

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

Post by Ghost Prototype »

Gutawer wrote:To type in a quote in a string, you can escape it with a backslash:

Code: Select all

"\"Hello\""
will print "Hello".
Thanks, it worked. :mrgreen: :mrgreen: :mrgreen: :mrgreen:
User avatar
LanHikariDS
Posts: 179
Joined: Tue Aug 04, 2015 11:30 pm
Location: Playing in the snow

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

Post by LanHikariDS »

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.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Check the example [wiki=SetAmmoCapacity]here[/wiki].
User avatar
PinkyDemon
Posts: 4
Joined: Mon Feb 27, 2017 5:55 pm

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

Post by PinkyDemon »

Let's say I wanted to spawn a monster that dies on Spawn but is resurrectable. How would you do that?
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

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

Post by ZZYZX »

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.
User avatar
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

Post by Matt »

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:

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
	}
}
EDIT: Just for reference,
Spoiler:

(side note: A_Jump("SpawnNotFirst")? Does this actually work without the 256? If so this would be much handier...)
User avatar
worldendDominator
Posts: 291
Joined: Sun May 17, 2015 9:39 am

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

Post by worldendDominator »

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
After spawning and dying, it will never enter Spawn state again.

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.
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

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

Post by ZZYZX »

Vaecrius wrote:

Code: Select all

			if(countinv("Clip")<1){
				A_GiveInventory("Clip");
				A_Die("startdead");
			}
My TNT1 A 0 WITHOUT nodelay does the same without inventory. Except you probably want to replace A_Die with 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
Anyway the assumption that it will never enter the spawn state again is quite bad because anything (e.g. acs) can set it to the spawn state and double initialization would be pretty bad there.
User avatar
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

Post by Matt »

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.
illuknisaa
Posts: 62
Joined: Sun May 15, 2016 2:19 pm

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

Post by illuknisaa »

How do I make an item that when picked up they also gives another different item?
User avatar
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

Post by Matt »

What kind of item is it?
illuknisaa
Posts: 62
Joined: Sun May 15, 2016 2:19 pm

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

Post by illuknisaa »

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
Locked

Return to “Editing (Archive)”