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
Ravick
Posts: 2046
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

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

Post by Ravick »

I've made some kludges here with dummy boolean variables, but your idea is good too! Thanks! :D
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

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

Post by cocka »

an "actor enter sector" thing to execute its special only once?
Yeah, there are two ways to do that:

1. method:

Code: Select all

bool exec;
script 1 (void)
{
 if(exec == false)
 {
   exec = true;
   // your code
 }
}
2. method:

Code: Select all

script 1 (void)
{
// your code
Thing_Remove(tid);
}
First method has the advantage of not requiring extra thing ids. Moreover you can use one array to manage the run-once events with a bunch of variables.
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm

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

Post by Mikk- »

Is there a way to detect if a projectile has been refelected? For example if a projectile is reflected by a weapon is there any way to "tell" the weapon that?
User avatar
zrrion the insect
Posts: 2432
Joined: Thu Jun 25, 2009 1:58 pm
Location: Time Station 1: Moon of Glendale

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

Post by zrrion the insect »

You might be able to have the projectile detect drastic changes in angle and/or pitch, and then alert the shooter to that.
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm

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

Post by Mikk- »

Well for the moment I've got a work-around. It's pretty hack-ish but it works nonetheless.
User avatar
Darsycho
Posts: 858
Joined: Sat Jul 05, 2008 1:36 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Linux Mint 21.3 Cinnamon, Windows 11
Graphics Processor: nVidia with Vulkan support
Contact:

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

Post by Darsycho »

How exactly do I make a bigfont lump?
I've tried Spidey's ZDoom font generator and this is all i get:
Spoiler:
Running as admin makes the program not start at all.
Spoiler: Heres the picture
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 »

How would you go about changing a mugshot based on player's gender only, independent of class and without using skins?
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

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

Post by The Zombie Killer »

Vaecrius wrote:How would you go about changing a mugshot based on player's gender only, independent of class and without using skins?
It's probably a hacky solution, but I imagine you could use ACS to check the player's gender and give them an appropriate inventory item for each gender. Then in sbarinfo, where you draw the mugshot, add InInventory checks for each mugshot item.

Use a script along the lines of this:

Code: Select all

#define GENDER_MALE 0
#define GENDER_FEMALE 1
#define GENDER_OTHER 2
Script "MugshotHandler" ENTER
{
	int gender;
	While(1)
	{
		gender = GetPlayerInfo(PlayerNumber(), PLAYERINFO_GENDER);
		Switch(gender)
		{
			// You can also use TakeInventory("ITEM", CheckInventory("ITEM")) instead of taking one of each item, I guess this can be more reliable,
			// considering difficulty levels can change the maximum amount of an item you can have, but if you don't want that to happen, just use
			// +INVENTORY.IGNORESKILL
			case GENDER_MALE:
				GiveInventory("GenderItem_Male", 1);
				TakeInventory("GenderItem_Female", 1);
				TakeInventory("GenderItem_Other", 1);
			break;
			
			case GENDER_FEMALE:
				TakeInventory("GenderItem_Male", 1);
				GiveInventory("GenderItem_Female", 1);
				TakeInventory("GenderItem_Other", 1);
			break;
			
			case GENDER_OTHER:
				TakeInventory("GenderItem_Male", 1);
				TakeInventory("GenderItem_Female", 1);
				GiveInventory("GenderItem_Other", 1);
			break;
		}
		Delay(1);
	}
}
And in DECORATE:

Code: Select all

ACTOR GenderItem_Male : Inventory
{
	Inventory.MaxAmount 1
	+INVENTORY.IGNORESKILL
}

ACTOR GenderItem_Female : GenderItem_Male {}
ACTOR GenderItem_Other : GenderItem_Male {}
And in SBARINFO (warning: uses the deprecated "default" parameter for DrawMugshot):
The Wiki wrote:Note: Early versions of this command had an additional default parameter at the beginning which gave the default prefix to use for the mugshot unless overridden by a skin. This parameter has been deprecated in favor of Player.Face.
However, I don't think there's a way to change Player.Face at will, so this is the only way I can think of doing this

Code: Select all

InInventory GenderItem_Male, 1
{
	drawmugshot "STF", 5, 143, 168;
}

InInventory GenderItem_Female, 1
{
	drawmugshot "FEM", 5, 143, 168;
}

InInventory GenderItem_Other, 1
{
	drawmugshot "OTH", 5, 143, 168;
}
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 »

That's pretty much what I ended up doing.

Turns out, though, that I've got to define player.face as "" or it would always default to either what it was specified to (if valid) or STF (if not valid), which is fine except setting it to "" gives an error message in the console.

Definitely not a good solution, but workable for now.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

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

Post by The Zombie Killer »

@Vaecrius
What kind of error was it? What if you make a bunch of empty images with the same names as the status bar graphics? but minus the "STF", so stuff like "KILL0" and "GOD0"
Does that change it at all?
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 »

If I had no player.face definition at all, it would always show STF no matter what I did in the SBARINFO.

The string is considered invalid if I did not have 3 characters, so defining it as "" gives
Script warning, "" line 0:
Invalid face '' for 'HDPlayer'
STF replacement codes must have 3 characters.
Script warning, "" line 0:
Invalid face '' for 'HDPlayer'
STF replacement codes must have 3 characters.
(This should actually be just 1 error for "dcplayer.txt" line 87 - I've always gotten these weird problems with labels for things ever since GZDoom switched from SVN to Git.)

But if I put in literally any other string than SFF (what I've used for the female mugshot), STF will show no matter what I do in SBARINFO, and if I use SFF then only SFF will show.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

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

Post by The Zombie Killer »

That's strange. Could it be considered a bug? Then again, since the "default" parameter is deprecated, I'm not sure this behavior is going to be changed.
I guess a proper way to change the mugshot at will would be a better idea
User avatar
NeoSpearBlade
Posts: 51
Joined: Tue Mar 26, 2013 1:35 pm

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

Post by NeoSpearBlade »

.....And I'm back.
MeatyD wrote:
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.
That's.....kinda what I meant but not the solution I was thinking. Let me explain.

What I want to do is make a sound mod that can be used with almost any mod that replaces monsters (via DeHackEd) and weapons and by modifying just the sound and it's definitions, I would accomplish this. However, what you suggested means modifying a monster's actor code, which gives my sound mod a chance to cause an error, which is what I want to avoid.

What I was thinking is once again using The Mancubus as an example, I want to make it so that when the game reads The Mancubus' attack sound code which is fatso/attack, it instead loads 2 or 3 sounds at the same time.

Is this possible at all?
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 »

sounds like you want some kind of audio equivalent to TEXTURES.

which would be awesome but I don't think it exists (but someone please correct me if I am wrong)
Gez
 
 
Posts: 17939
Joined: Fri Jul 06, 2007 3:22 pm

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

Post by Gez »

No, it is not possible. Youu'd have to layer the sounds yourself in some audio editing software I suppose.

Why do you want three different sounds to be played at once instead of one?
Locked

Return to “Editing (Archive)”