A Christmas present for ZDoom

Moderator: GZDoom Developers

User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Yes, you are. For armor you can't use Inventory.Amount. You have to use Armor.SaveAmount, Armor.MaxSaveAmount and Armor.SavePercent to define its properties.
User avatar
Daniel
Posts: 811
Joined: Sun Jul 04, 2004 3:21 pm
Contact:

Post by Daniel »

And how can we know when a Healing object uses the normal 100% health or is capable to go up to 200%? What command do we should use?
User avatar
Anakin S.
Posts: 1067
Joined: Fri Nov 28, 2003 9:39 pm
Location: A long time ago in a galaxy far, far away...

Post by Anakin S. »

Graf Zahl wrote:Yes, you are. For armor you can't use Inventory.Amount. You have to use Armor.SaveAmount, Armor.MaxSaveAmount and Armor.SavePercent to define its properties.
What do each of these properties do? Is one of these the equivalent of Inventory.Amount? Is there a way to make them work so that you can pick up both the old armor bonuses and new armor bonuses up to a maximum of 200? What are the original values the doom armor has?

Daniel:
Inventory.MaxAmount 200
User avatar
DoomRater
Posts: 8265
Joined: Wed Jul 28, 2004 8:21 am
Preferred Pronouns: He/Him
Location: WATR HQ
Contact:

Post by DoomRater »

Real quick- are there bounce states in DECORATE? This would be useful for making a flak cannon, where the shards are supposed to be affected by gravity after they hit something.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Anakin S. wrote:
Graf Zahl wrote:Yes, you are. For armor you can't use Inventory.Amount. You have to use Armor.SaveAmount, Armor.MaxSaveAmount and Armor.SavePercent to define its properties.
What do each of these properties do? Is one of these the equivalent of Inventory.Amount? Is there a way to make them work so that you can pick up both the old armor bonuses and new armor bonuses up to a maximum of 200? What are the original values the doom armor has?

Daniel:
Inventory.MaxAmount 200

What they do?

Armor.SaveAmount - amount of armor the item gives
Armor.MaxSaveAmount - the maximum amount of armor you can reach with this item
Armor.SavePercent - the effectiveness of the armor. For armor bonuses this has only an effect if you are out of armor when picking them up.
User avatar
Daniel
Posts: 811
Joined: Sun Jul 04, 2004 3:21 pm
Contact:

Post by Daniel »

Thanks!

I had some ideas here. I needed that when making some ZDoom mods.

1) Is possible to add an action that changes the RenderStyle and its Alpha? This would be very useful to make projectiles like Rockets (solid in the Spawn state and Translucent in the Death state - the normal rocket is also like that, but the ones I created can't be like that). Something like A_ChangeRender (x,y) where:

x = number of the render (0=none, 1=normal, 2=fuzzy etc..)
y = Alpha number

2) Some special effects for weapon, such as A_WeaponVibrateStart and A_WeaponVibrateEnd, that makes the weapon graphic vibrate. It can be useful for making weapon charging frames.

3) And also that codepointer I mentioned before A_ChangeThingFlags, so you can make a monster that suddenly starts to fly.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

1) No. I want to add it but keep forgetting it. :(
2) No.
3) some selected flags should be settable.
User avatar
Daniel
Posts: 811
Joined: Sun Jul 04, 2004 3:21 pm
Contact:

Post by Daniel »

Hey Graf! I want your help into this:


I made a mine that detects a monster passing by it and explode, but I had several problems due to the coding I've used. These are the problems:

1) When you are facing a wall and drop the mine (I used A_SpawnItem), the mine is spawned out ot the map limits;

2) If I use A_ThrowGrenade, the mine "walks" because the throwing speed in A_ThrowGrenade also affects the "Speed" of the actor spawned;

3) Sometimes the mine seems to explode only for one monster; when another pass into it, it don't explode; I used QUICKTORELATIATE to prevent this, but it didn't work a lot;

4) The worst problem: when you spawn the mine and no monster is in its sight, the mine becomes to hate Player, even with the FRIENDLY flag.
Last edited by Daniel on Mon Jun 06, 2005 11:07 pm, edited 1 time in total.
User avatar
DoomRater
Posts: 8265
Joined: Wed Jul 28, 2004 8:21 am
Preferred Pronouns: He/Him
Location: WATR HQ
Contact:

Post by DoomRater »

Question about Armor.SavePercent- what value would simulate a shield that doesn't allow any damage to go through? (also, it would REALLY be nice to know the class of armor that I'm currently wearing... is that indicated by the graphic on the side, like green is class 1 and blue is class 2?)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

100% of course!

You can give each armor an icon which is displayed to show what you have. For example, if you add the graphics and pick up one of Heretic's shields in Doom you will see the shield.
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Post by The Ultimate DooMer »

Graf Zahl wrote:Yes, that would be a simple solution but there is one problem with it. The GiveInventory call will fail when the user has the maximum amount of items of this kind. I think I need to add a mechanism to notify failure. The simplest thing would be a 'Fail' instead of 'Stop' at the end of the state sequence.


EDIT: done

I needed some handling for states which jump to themselves anyway so I just used that to signal failure. And to make it more intuitive I added 'FAIL' as a synonym for 'WAIT'.


Now you can do:

Code: Select all

ACTOR MagicThingy : Inventory
{
+INVBAR
Inventory.MaxAmount 1
states
	{
	Spawn:
		RKEY A 4
		BKEY A 4
		YKEY A 4
		loop
	Use:
		RKEY A 1 A_JumpIfInventory("Mana1", 10, 2)
		RKEY A 1 A_PlaySound("*usefail")
		Fail
		RKEY A 1 A_TakeInventory("Mana1", 10)
		RKEY A 1 HealThing(5)
		Fail
	}
}
and the item will stay.
A couple of related questions:

1. Can the GiveInventory check be made to fail if the item being checked is below a certain amount?

2. If A_CustomMissile/FireCustomMissile (whichever) is in the use state, does it fire from the player?
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

Yes to both.
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Post by The Ultimate DooMer »

So how is no.1 achieved? (presumably involving the 3rd arg in the JumpIfInventory call?)
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

Code: Select all

   Use:
      RKEY A 1 A_JumpIfInventory("Mana1", 10, 2)
      RKEY A 1 A_PlaySound("*usefail")
      Fail
      RKEY A 1 A_TakeInventory("Mana1", 10)
      RKEY A 1 A_GiveInventory("Crap",10)
      Stop
User avatar
Daniel
Posts: 811
Joined: Sun Jul 04, 2004 3:21 pm
Contact:

Post by Daniel »

Seems that my post was ignored... :(


So, any way to fix the problems I mentioned before? Maybe using Thing_Hate or stuff like that?
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”