Page 1 of 1

Mapinfo/Gameinfo: CheatArmorType property

Posted: Wed Jun 21, 2017 11:09 pm
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.

Re: Mapinfo/Gameinfo: CheatArmorType property

Posted: Fri Jun 23, 2017 9:50 am
by ZzZombo
Should instead allow rewrite/addition of cheat codes.

Re: Mapinfo/Gameinfo: CheatArmorType property

Posted: Fri Jun 23, 2017 10:06 am
by wildweasel
I suppose that, too, but I imagine that'd be less "safe" in the eyes of the devs.

Re: Mapinfo/Gameinfo: CheatArmorType property

Posted: Fri Jun 23, 2017 11:43 am
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.

Re: Mapinfo/Gameinfo: CheatArmorType property

Posted: Fri Jun 23, 2017 12:53 pm
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).

Re: Mapinfo/Gameinfo: CheatArmorType property

Posted: Fri Jun 23, 2017 1:20 pm
by Graf Zahl
What part of "no" is unclear?

Re: Mapinfo/Gameinfo: CheatArmorType property

Posted: Fri Jun 23, 2017 7:54 pm
by wildweasel
Graf Zahl wrote:What part of "no" is unclear?
Er...in regards to the original suggestion, or the modification of cheat codes?

Re: Mapinfo/Gameinfo: CheatArmorType property

Posted: Fri Jun 23, 2017 7:58 pm
by Rachael
He was referring to modifying the cheat codes.

Re: Mapinfo/Gameinfo: CheatArmorType property

Posted: Sat Jun 24, 2017 3:10 am
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.

Re: Mapinfo/Gameinfo: CheatArmorType property

Posted: Sat Jun 24, 2017 3:27 am
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.