Mapinfo/Gameinfo: CheatArmorType property

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Mapinfo/Gameinfo: CheatArmorType property

Post by wildweasel »

Depending on the situation, a mod author may decide to modify the armor types available in the game, and it may be problematic for the player to still have "access" to the original "Doom" armor. I've messed around with [wiki]GetArmorType[/wiki] in efforts to kludge my way around this, as my current project handles armor very differently from the standard Doom armor (it does not absorb damage, but is instead used as a "counter" with its own special effects). Simply put, if the player types IDFA or GIVE ALL, they get the standard Doom armor instead, which only does the basic damage resistance, and does not have any of the other effects provided by Cola3's Arms Barrier items.

Therefore, my suggestion is this: I'd like to be able to set what specific type of armor is given when the player types the equivalent of a Give All cheat. In my case, I'd be setting CheatArmorType to "ArmsChunk100" so that the necessary checks are working for the game's unusual armor mechanics.
ZzZombo
Posts: 315
Joined: Mon Jul 16, 2012 2:02 am

Re: Mapinfo/Gameinfo: CheatArmorType property

Post by ZzZombo »

Should instead allow rewrite/addition of cheat codes.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Mapinfo/Gameinfo: CheatArmorType property

Post by wildweasel »

I suppose that, too, but I imagine that'd be less "safe" in the eyes of the devs.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49071
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Mapinfo/Gameinfo: CheatArmorType property

Post by Graf Zahl »

ZzZombo wrote:Should instead allow rewrite/addition of cheat codes.

Changing cheat codes was never implemented for Dehacked due to popular request. Nothing about that has changed in all those years. New cheat codes won't happen. Use the console.
Wuerfel_21
Posts: 34
Joined: Mon May 01, 2017 1:33 pm

Re: Mapinfo/Gameinfo: CheatArmorType property

Post by Wuerfel_21 »

The raven games (+Strife) change the cheatcodes already. Thats why allcheats exists. I don't see a reason to not allow big projects like TCs and standalone stuff to have their own (which can be overridden by allcheats, like heretics idkfa).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49071
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Mapinfo/Gameinfo: CheatArmorType property

Post by Graf Zahl »

What part of "no" is unclear?
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Mapinfo/Gameinfo: CheatArmorType property

Post by wildweasel »

Graf Zahl wrote:What part of "no" is unclear?
Er...in regards to the original suggestion, or the modification of cheat codes?
User avatar
Rachael
Posts: 13571
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Mapinfo/Gameinfo: CheatArmorType property

Post by Rachael »

He was referring to modifying the cheat codes.
User avatar
Kinsie
Posts: 7401
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: Mapinfo/Gameinfo: CheatArmorType property

Post by Kinsie »

Changing the cheat commands (IDDQD etc.) is one of those things that just isn't gonna happen, and requesting it here is also kind of hijacking this feature request. Adding new cheat console commands can be done using ACS, KEYCONF aliases and a little ingenuity.

Anyway, back to the point: Weasel, the "give" cheat's method of handling armor can be found in gzdoom.pk3/zscript/shared/player_cheat.txt

Code: Select all

if (giveall || name ~== "armor")
{
	if (gameinfo.gametype != GAME_Hexen)
	{
		let armoritem = BasicArmorPickup(Spawn("BasicArmorPickup"));
		armoritem.SaveAmount = 100*deh.BlueAC;
		armoritem.SavePercent = gameinfo.Armor2Percent > 0 ? gameinfo.Armor2Percent * 100 : 50;
		if (!armoritem.CallTryPickup (self))
		{
			armoritem.Destroy ();
		}
	}
	else
	{
		for (i = 0; i < 4; ++i)
		{
			let armoritem = Inventory(Spawn("HexenArmor"));
			armoritem.health = i;
			armoritem.Amount = 0;
			if (!armoritem.CallTryPickup (self))
			{
				armoritem.Destroy ();
			}
		}
	}

	if (!giveall)
		return;
}
I'm not sure how this would be overridden for your needs without busting something else, though. Could a developer or ZScript guru weigh in on this?

Alternatively, you could use my gross old pre-ZScript hack: Define a new "weapon" (I typically just use a copy of the Pistol) that has a weaponslot so that it's given by the Give cheats, then have a looping ACS script that detects such a weapon and does what you want (in this case, stripping the cheat armor and giving the player the armor you want) before taking the weapon away.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49071
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Mapinfo/Gameinfo: CheatArmorType property

Post by Graf Zahl »

What can be done here depends on the setup. If the mod replaces the original player class it can just override the function and handle the 'armor' case itself.
If not, it would require an engine change.
Post Reply

Return to “Feature Suggestions [GZDoom]”