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.
Okgo5555
Posts: 80
Joined: Thu Mar 23, 2017 11:18 am

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

Post by Okgo5555 »

ie... I should not be able to carry both the shotgun and supershotgun. I should have to drop one of them to carry the other.
FlappySack
Posts: 8
Joined: Tue May 23, 2017 8:15 pm

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

Post by FlappySack »

How do I replace a specific weapon with another one for a specific map?

I am trying to replace the BFG9000 with Hitlers Buzzsaw from Brutal Doom and only do this for MAP31 (This was done in Brutal Doom v20b, but I have v21 beta which no longer does this and want to re-enable this feature)
User avatar
Rip and Tear
Posts: 185
Joined: Tue May 02, 2017 3:54 pm

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

Post by Rip and Tear »

I want to make a projectile that spawns other projectiles, but those other projectiles die when the main projectile dies. Would A_KillChildren work for this?

EDIT:

Testing this out, and I can't seem to get it to work. The smaller projectiles just don't die.

Code: Select all

class BigMissile : FastProjectile {
	Default {
		Speed 80;
		Radius 14;
		Height 8;
	}
	States {
	Spawn:
		TNT1 A 0;	// The first state is skipped for some reason
		TNT1 A 0 A_SpawnItemEx("SmallProjectile", 0, 0, 0, 0, 0, 0, 0, SXF_SETMASTER);
		MISL A 1;
		Wait;
	Death:
		TNT1 A 0 A_KillChildren("None", KILS_KILLMISSILES);
		Stop;
	}
}

class SmallMissile : FastProjectile {
	States {
	Spawn:
		PLSS A 1;
		Loop;
	}
}
User avatar
worldendDominator
Posts: 288
Joined: Sun May 17, 2015 9:39 am

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

Post by worldendDominator »

A_KillChildren doesn't work with projectiles. You have to use A_RemoveChildren, although that won't put them into Death state.
No, not quite. I think A_KillChildren only works if children are damageable.
User avatar
Rip and Tear
Posts: 185
Joined: Tue May 02, 2017 3:54 pm

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

Post by Rip and Tear »

worldendDominator wrote:A_KillChildren doesn't work with projectiles. You have to use A_RemoveChildren, although that won't put them into Death state.
No, not quite. I think A_KillChildren only works if children are damageable.
A_RemoveChildren doesn't work either. In fact, A_KillChildren won't even work when I spawn an actor that has health/death states.
User avatar
lwks
Posts: 212
Joined: Thu May 28, 2015 9:19 pm
Location: Fucking Brazil

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

Post by lwks »

Guys, I want to change the skull sprite at the main menu screen, so I put two sprites inside a pk3 file with the correct names (M_SKULL1 and M_SKULL2) but when I start the game the sprite has not changed, any thoughts? Here the file just in case:
https://www.dropbox.com/s/w93qv4uxpgmzk ... e.pk3?dl=0

Edit: Btw, could you guys recommend me a good program to edit sound and music files?
FlappySack
Posts: 8
Joined: Tue May 23, 2017 8:15 pm

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

Post by FlappySack »

lwks wrote:Guys, I want to change the skull sprite at the main menu screen, so I put two sprites inside a pk3 file with the correct names (M_SKULL1 and M_SKULL2) but when I start the game the sprite has not changed, any thoughts? Here the file just in case:
https://www.dropbox.com/s/w93qv4uxpgmzk ... e.pk3?dl=0
Put those two skull files inside a folder named GRAPHICS in the pk3. If you actually want to use the sprite you chose, you may have to edit it in something like SLADE to modify its offset to make the barrel line up with the menu text, I used 21, 9 and it worked.

Also Audacity is good for some basic sound/music editing
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 »

Rip and Tear wrote:A_RemoveChildren doesn't work either. In fact, A_KillChildren won't even work when I spawn an actor that has health/death states.
Are they +shootable, though?

It might be simpler (if you're using ZScript) to just put this in the sub-projectile's see state:

Code: Select all

if(!master) A_Countdown();
EDIT: Or, if no ZScript, a combination of

Code: Select all

A_GiveToChildren("Clip")
and

Code: Select all

if(countinv("Clip")){A_Countdown();}
User avatar
Rip and Tear
Posts: 185
Joined: Tue May 02, 2017 3:54 pm

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

Post by Rip and Tear »

Vaecrius wrote:
Rip and Tear wrote:A_RemoveChildren doesn't work either. In fact, A_KillChildren won't even work when I spawn an actor that has health/death states.
Are they +shootable, though?

It might be simpler (if you're using ZScript) to just put this in the sub-projectile's see state:

Code: Select all

if(!master) A_Countdown();
EDIT: Or, if no ZScript, a combination of

Code: Select all

A_GiveToChildren("Clip")
and

Code: Select all

if(countinv("Clip")){A_Countdown();}
Do the sub-projectiles need to be +SHOOTABLE for A_RemoveChildren to work? It doesn't look like it, according to the wiki.

Is there a way to test if the sub projectiles are even being correctly set as children?
User avatar
lwks
Posts: 212
Joined: Thu May 28, 2015 9:19 pm
Location: Fucking Brazil

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

Post by lwks »

FlappySack wrote: Put those two skull files inside a folder named GRAPHICS in the pk3. If you actually want to use the sprite you chose, you may have to edit it in something like SLADE to modify its offset to make the barrel line up with the menu text, I used 21, 9 and it worked.

Also Audacity is good for some basic sound/music editing
It worked, thanks stranger! How did you know how much to offset? Is there a interface for that in slade or you tried until you got it right?
FlappySack
Posts: 8
Joined: Tue May 23, 2017 8:15 pm

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

Post by FlappySack »

lwks wrote:It worked, thanks stranger! How did you know how much to offset? Is there a interface for that in slade or you tried until you got it right?
There is nothing in slade that helps match the offset of one sprite with another sprite, but I saw that the sprite needed to be moved down (and maybe to the right a little, but I didn't do that) so I dragged the image down a bit in slade, saved it and exported and it worked!
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 »

It shouldn't, though I've never used A_RemoveChildren since other things might (mis-re)use a master pointer for some other purpose and get caught as collateral damage.
Rip and Tear wrote:Is there a way to test if the sub projectiles are even being correctly set as children?

Code: Select all

if(master) A_Log(string.format("%s is master of %s", master.getclassname(), self.getclassname()));
User avatar
Rip and Tear
Posts: 185
Joined: Tue May 02, 2017 3:54 pm

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

Post by Rip and Tear »

Vaecrius wrote:It shouldn't, though I've never used A_RemoveChildren since other things might (mis-re)use a master pointer for some other purpose and get caught as collateral damage.
Rip and Tear wrote:Is there a way to test if the sub projectiles are even being correctly set as children?

Code: Select all

if(master) A_Log(string.format("%s is master of %s", master.getclassname(), self.getclassname()));
Thank you! It turns out that the player is being set as the master for some reason, rather than the parent projectile. Unless anyone has a suggestion as to how to get around that, I'm going to have to write a custom action function to handle it with variables.
D2JK
Posts: 543
Joined: Sat Aug 30, 2014 8:21 am

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

Post by D2JK »

Try adding this flag on the parent missile: SXF_ORIGINATOR.
User avatar
Rip and Tear
Posts: 185
Joined: Tue May 02, 2017 3:54 pm

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

Post by Rip and Tear »

D2JK wrote:Try adding this flag on the parent missile: SXF_ORIGINATOR.
Thanks, this fixed the parent issue, but A_RemoveChildren("true", RMVF_EVERYTHING) still isn't getting rid of the sub projectiles.
Locked

Return to “Editing (Archive)”