New DECORATE/Zscript Thing Special

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

Moderator: GZDoom Developers

Ultimate Freedoomer
Posts: 217
Joined: Fri Jan 30, 2015 10:32 pm
Location: Pittman Center
Contact:

New DECORATE/Zscript Thing Special

Post by Ultimate Freedoomer »

Hi. I am here to propose a new thing special for DECORATE: "ArmorThing". Basically, this would function like HealThing, but with armor instead of health. A good use of this would be to create custom inventory items that use their own armor values without having to propose a new armor class just to allow such an item to give armor without interfering with armor class DeHacked patches. It would work as follows, in the following order:
  • string "icon": the HUD icon to use for this actor's provided armor. Defaults to "arm1a0"
  • percentage "savepercent": The percentage of dealt damage that the provided armor absorbs is specified as a floating point value between 0.0 and 100.0. Defaults to "33.335"
  • amount "maxsaveamount": Sets the maximum amount of armor you can reach by picking up an item using this thing special. Defaults to "200"
  • amount "saveamount": The amount of armor that an item using this thing special gives. Defaults to "1".
  • amount "maxbonus": The amount of armor you obtain additionally to your save amount value. Defaults to "0"
  • amount "maxbonusmax": The maximum additional save amount you can obtain with the armor. Defaults to "0".
  • amount "MaxFullAbsorb": The amount of damage that the provided armor will fully absorb per tic. Defaults to "0".
  • amount "MaxAbsorb": The maximum amount of damage (after adjustment) that the armor provided by an item using this thing special will absorb per tic. defaults to "0".
As an example, here's the Megasphere itself recreated using this setup to replace the custom blue armor token, as well as using HealThing to replace the special health token:

Code: Select all

Actor MegasphereCustom : CustomInventory replaces Megasphere 83
{
	spawnid 132
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	Inventory.Pickupmessage "$GOTMSPHERE"
	Inventory.PickupSound "misc/p_pkup"
	States
	{
	Spawn:
		MEGA ABCD 6 Bright
		loop
	Pickup:
		TNT1 A 0
		{
		ArmorThing("arm2a0",50,200,200,0,0,0,0);
		HealThing(200,200);
		}
		stop
	}
}
Another example: this item recreates the Doom 3 incarnation of the backpack redone using ArmorThing:

Code: Select all

Actor PowerBackpack : CustomInventory
{
	Inventory.PickupMessage "Picked up a Power backpack."
	inventory.pickupsound "pickups/powerbackpack"
	+INVENTORY.ALWAYSPICKUP
	height 26
	States
	{
	Spawn:
		PBPK A -1
		stop
	Pickup:
		TNT1 A 0
		{
		ArmorThing("arm2a0",33.33333,200,5,0,0,0,0);
		HealThing(5,200);
		A_GiveInventory("backpackitem", 1, AAPTR_DEFAULT);
		}
		stop
	}
}
The Damage factors for custom damage (in the event the modder wishes to use such with ArmorThing) would be determined by the calling actor's "DamageFactor" property.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: New DECORATE/Zscript Thing Special

Post by Graf Zahl »

Ultimate Freedoomer wrote:As an example, here's the Megasphere itself recreated using this setup to replace the custom blue armor token, as well as using HealThing to replace the special health token:
The idea itself is good, but this cannot work. The special tokens are there solely for modification by Dehacked. The first implementation of the Megasphere did not use any tokens at all.
But I'd rather name it 'SetArmor' to be more clear about what it does. HealThing is just how the special was named for ACS.
Ultimate Freedoomer
Posts: 217
Joined: Fri Jan 30, 2015 10:32 pm
Location: Pittman Center
Contact:

Re: New DECORATE/Zscript Thing Special

Post by Ultimate Freedoomer »

Graf Zahl wrote:
Ultimate Freedoomer wrote:As an example, here's the Megasphere itself recreated using this setup to replace the custom blue armor token, as well as using HealThing to replace the special health token:
The idea itself is good, but this cannot work. The special tokens are there solely for modification by Dehacked. The first implementation of the Megasphere did not use any tokens at all. But I'd rather name it 'SetArmor' to be more clear about what it does. HealThing is just how the special was named for ACS.
Just to be clear, what are you saying cannot work: recreating the megasphere using this special or the special as a whole? However, I do like the alternative name suggestion. & like I said, "SetArmor" is for armor-giving custom inventory items in general. In regards to the tokens being there for dehacked purposes: are you saying health-giving items that use HealThing don't work right with dehacked?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: New DECORATE/Zscript Thing Special

Post by Graf Zahl »

Ultimate Freedoomer wrote:Just to be clear, what are you saying cannot work: recreating the megasphere using this special or the special as a whole?
The Megasphere cannot be modified. The Dehacked parser needs the two token items for modification. The feature itself is just modifying the receiving actor's BasicArmor inventory item. This can be done entirely by scripting with no native code.
Ultimate Freedoomer
Posts: 217
Joined: Fri Jan 30, 2015 10:32 pm
Location: Pittman Center
Contact:

Re: New DECORATE/Zscript Thing Special

Post by Ultimate Freedoomer »

Graf Zahl wrote:
Ultimate Freedoomer wrote:Just to be clear, what are you saying cannot work: recreating the megasphere using this special or the special as a whole?
The Megasphere cannot be modified. The Dehacked parser needs the two token items for modification. The feature itself is just modifying the receiving actor's BasicArmor inventory item. This can be done entirely by scripting with no native code.
You mean the Dehacked is modifying the BasicArmor in the megasphere? Fair enough. I’d still like to know what your opinions on the “setarmor” feature are otherwise, what with its potential for armor-giving custom inventory items in general (see my recreation of Doom 3’s backpack in the opening post), as well how easily it can be implemented & if it will be implemented. Like I said, this would be for the general purpose of “item that gives something else in addition to armor when picked up, & you don’t want to define an entirely new armor class just for use with this item”. The reason I’m using the properties of both BasicArmorPickup & BasicArmorBonus are to cover all the bases in regards to what the armor given by a pickup using “setarmor” can do. Adding an icon string was also to cover the 1 base covered by neither set of armor properties, for the sake of completion.
Post Reply

Return to “Feature Suggestions [GZDoom]”