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

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

Post by Blue Shadow »

insightguy wrote:Any Idea how to add what button is used in what control in the HUD?

Example, if R or T is my reload key, How can I display that on the HUD even when they switch it to something else?
See the last example [wiki=Print]here[/wiki].
User avatar
insightguy
Posts: 1730
Joined: Tue Mar 22, 2011 11:54 pm

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

Post by insightguy »

Blue Shadow wrote:
insightguy wrote:Any Idea how to add what button is used in what control in the HUD?

Example, if R or T is my reload key, How can I display that on the HUD even when they switch it to something else?
See the last example [wiki=Print]here[/wiki].
So ACS huh, well I really hoped for a SBARINFO solution. oh well

Any Idea how to keep your own projectiles from harming yourself?
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

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

Post by Apeirogon »

When I add FOILINVUL flag to projectile with damage (random(1,2)+random(1,2)) it start kill everything that it hit regardless of health.
Is this normal?
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

insightguy wrote:Any Idea how to keep your own projectiles from harming yourself?
Normally they shouldn't harm you. How are you spawning them?
Apeirogon wrote:When I add FOILINVUL flag to projectile with damage (random(1,2)+random(1,2)) it start kill everything that it hit regardless of health.
Is that normal?
I just did a test. I didn't experience what you described. Something else at play here. Could you post the code of the projectile?
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

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

Post by Apeirogon »

Looks like this my system jokes with me joking. I downloaded new version of gzdoom and after that i start catch errors as from a cornucopia.
I check projectile one more time and now it works as expected, but now break code of gun that must shoot this projectile.

It still under "constructing"...
Spoiler:
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'm having a problem trying to make a Custom Weapon. I don't know what's wrong, I've been following this tutorial https://www.youtube.com/watch?v=B7Fn9RIQmNo. Problem is that whenever I get into the game the Chainsaw is displayed as a Exclamation Point which I cannot pick up and when I IDFA I don't get the new weapon. These are the codes:

DECORATE

Code: Select all

ACTOR NewPlayer : DoomPlayer {
	Player.WeaponSlot 1, Fist, NewWeapon
	Player.WeaponSlot 2, Pistol
	Player.WeaponSlot 3, Shotgun, SuperShotgun
	Player.WeaponSlot 4, Chaingun
	Player.WeaponSlot 5, RocketLauncher
	Player.WeaponSlot 6, PlasmaRifle
	Player.WeaponSlot 7, BFG9000
}

ACTOR NewWeapon : Weapon Replaces Chainsaw 26666{
	Weapon.SelectionOrder 50
	
	+WEAPON.MELEEWEAPON
	
	States{
		Spawn:
		FDSP C -1
		Stop
		
		Select:
		FDSP A 1 A_Raise
		Loop
		
		Deselect:
		FDSP A 1 A_Lower
		Loop
		
		Ready:
		FDSP A 1 A_WeaponReady
		Loop
		
		Fire:
		FDSP B 1 A_Saw
		FDSP B 0 A_ReFire
		Goto Ready
	}
}
MAPINFO

Code: Select all

gameinfo {
	playerclasses = "NewPlayer"
}
Nevermind the sprites, they're just placeholder for now.
User avatar
ZoDX32
Posts: 20
Joined: Sat Oct 14, 2017 5:49 pm

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

Post by ZoDX32 »

lwks wrote:Guys I'm having a problem trying to make a Custom Weapon. I don't know what's wrong, I've been following this tutorial https://www.youtube.com/watch?v=B7Fn9RIQmNo. Problem is that whenever I get into the game the Chainsaw is displayed as a Exclamation Point which I cannot pick up and when I IDFA I don't get the new weapon. These are the codes:

DECORATE

Code: Select all

ACTOR NewPlayer : DoomPlayer {
	Player.WeaponSlot 1, Fist, NewWeapon
	Player.WeaponSlot 2, Pistol
	Player.WeaponSlot 3, Shotgun, SuperShotgun
	Player.WeaponSlot 4, Chaingun
	Player.WeaponSlot 5, RocketLauncher
	Player.WeaponSlot 6, PlasmaRifle
	Player.WeaponSlot 7, BFG9000
}

ACTOR NewWeapon : Weapon Replaces Chainsaw 26666{
	Weapon.SelectionOrder 50
	
	+WEAPON.MELEEWEAPON
	
	States{
		Spawn:
		FDSP C -1
		Stop
		
		Select:
		FDSP A 1 A_Raise
		Loop
		
		Deselect:
		FDSP A 1 A_Lower
		Loop
		
		Ready:
		FDSP A 1 A_WeaponReady
		Loop
		
		Fire:
		FDSP B 1 A_Saw
		FDSP B 0 A_ReFire
		Goto Ready
	}
}
MAPINFO

Code: Select all

gameinfo {
	playerclasses = "NewPlayer"
}
Nevermind the sprites, they're just placeholder for now.
Spoiler:
User avatar
Cherno
Posts: 1309
Joined: Tue Dec 06, 2016 11:25 am

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

Post by Cherno »

Try inheriting from Chainsaw directly instead of Weapon. For a straight weapon replacement, that's usually the way to go.
Assign the actual new Weapon class "NewWeapon" to one of the player class' weapon slots.
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 »

Spoiler:
Changed the ID number and took it off, still not working
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 »

Cherno wrote:Assign the actual new Weapon class "NewWeapon" to one of the player class' weapon slots.
Didn't I do that?

Code: Select all

ACTOR NewPlayer : DoomPlayer {
	Player.WeaponSlot 1, Fist, NewWeapon
	Player.WeaponSlot 2, Pistol
	Player.WeaponSlot 3, Shotgun, SuperShotgun
	Player.WeaponSlot 4, Chaingun
	Player.WeaponSlot 5, RocketLauncher
	Player.WeaponSlot 6, PlasmaRifle
	Player.WeaponSlot 7, BFG9000
}
Edit: I put it to work, instead of using S_START and S_END on the Slade's entries I used just "SPRITES"
But if I take some of the Weapon Slots but the Slot 1 on the DECORATE file when defining the Player Actor when I IDFA I still get all weapons. Shouldn't I get only the Fist instead?
Ultimate Freedoomer
Posts: 217
Joined: Fri Jan 30, 2015 10:32 pm
Location: Pittman Center
Contact:

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

Post by Ultimate Freedoomer »

Code: Select all

script 2 (void)
{
int mtotal = GetLevelInfo (LEVELINFO_TOTAL_MONSTERS),
mkilled = GetLevelInfo (LEVELINFO_KILLED_MONSTERS)
itotal = GetLevelInfo (LEVELINFO_TOTAL_ITEMS),
ifound = GetLevelInfo (LEVELINFO_FOUND_ITEMS),
ursecretz = GetLevelInfo(LEVELINFO_FOUND_SECRETS),
moresecretz = GetLevelInfo(LEVELINFO_TOTAL_SECRETS);
int nextmap = getlevelinfo(LEVELINFO_KILLED_MONSTERS|LEVELINFO_TOTAL_MONSTERS|LEVELINFO_FOUND_ITEMS|LEVELINFO_TOTAL_ITEMS|LEVELINFO_FOUND_SECRETS|LEVELINFO_TOTAL_SECRETS);

If (mtotal == 0)  //This is to make sure the script doesn't auto activate if there are no monsters
{
	Delay(1);
	terminate;  //Better luck next level~
	}
		if (mkilled == mtotal)
	{
		PrintBold (s:"You have killed all the monsters!");
	}
	Else
	{
		PrintBold (s:"You have killed ", d:mkilled, s:" monsters!\n", d:mtotal-mkilled, s:" left to go!");
	}
	Else  //Keep checking!
	{
		Delay(1);
		restart;
	}
}

If (itotal == 0)  //This is to make sure the script doesn't auto activate if there are no items
{
	Delay(1);
	terminate;  //Better luck next level~
	}
		if (ifound == itotal)
	{
		PrintBold (s:"You have found all the items!");
	}
	Else
	{
		PrintBold (s:"You have found ", d:ifound, s:" items!\n", d:itotal-ifound, s:" left to go!");
	}
	Else  //Keep checking!
	{
		Delay(1);
		restart;
	}
}
	
If (moresecretz == 0)  //This is to make sure the script doesn't auto activate if there are no secrets
{
	Delay(1);
	terminate;  //Better luck next level~
	}
		if (ursecretz == moresecretz)
	{
		PrintBold (s:"You  have revealed all the secrets!");
	}
	else
	{
		PrintBold (s:"You have revealed ", d:ursecrets, s:" secrets!\n", d:moresecretz-ursecretz, s:" left to go!");
	}
	Else  //Keep checking!
	{
		Delay(1);
		restart;
	}
}
Here’s the beta of the “auto level-end script” I said I was working on. Before I compile, I would just like to know if there’s anything I need to change or remove.
User avatar
Leon_Portier
Posts: 62
Joined: Sun Feb 12, 2017 3:30 pm
Location: Dark side of Bavaria

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

Post by Leon_Portier »

Leon_Portier wrote:Hello!
When using a portal on a polyobject, the space above only renders the sky instead of the sectors behind it.
Putting a 3d sector above the portal covers it up on certain angles.
How can I combat the hole in the rendering?
-snip-
FYI, the solution is to make the portal doublesided!
User avatar
insightguy
Posts: 1730
Joined: Tue Mar 22, 2011 11:54 pm

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

Post by insightguy »

Blue Shadow wrote:
insightguy wrote:Any Idea how to keep your own projectiles from harming yourself?
Normally they shouldn't harm you. How are you spawning them?
To clarify: the splash damage is harming me. How do I prevent the thing from splashing me.
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

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

Post by DoomKrakken »

insightguy wrote:
Blue Shadow wrote:
insightguy wrote:Any Idea how to keep your own projectiles from harming yourself?
Normally they shouldn't harm you. How are you spawning them?
To clarify: the splash damage is harming me. How do I prevent the thing from splashing me.
There are various ways that can happen. The most common of which is that the XF_HURTSOURCE flag in the A_Explode function (which is set by default) isn't cleared. To clear that, you'd put a 0 in the "flags" parameter.

But I don't know if that's the case. Could you post some code? That'd really help us diagnose the problem sooner...
User avatar
Cherno
Posts: 1309
Joined: Tue Dec 06, 2016 11:25 am

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

Post by Cherno »

I have two Cyberdemon sprites, CYBR and CYB2. A CVAR's value should be used to let DECORATE decide which one to use, like this:

Code: Select all

Spawn:
		TNT1 AA 0 A_JumpIf(GetCVar("myCVAR") == true,"Spawn2")
		CYBR A 10 A_Look
		Loop
		
		Spawn2:
		CYB2 A 10 A_Look
		Loop

My CVARINFO:

Code: Select all

user bool myCVAR = true;
no matter if it's true or false, the code doesnt seem to work. What am I doing wrong? (Yes, I know it's only for the spawn state). I also tried making a server CVAR instead of a user CVAR, to no avail.
Locked

Return to “Editing (Archive)”