Some state jumps, functions and flags - necessary ones

Moderator: GZDoom Developers

Post Reply
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Some state jumps, functions and flags - necessary ones

Post by Jekyll Grim Payne »

There were many cases when I couldn't realize a feature I invented because of the lack of important commands. Actually the state jumps checking for inventory items are not enough functional. I think that some of them must be extended:

A_JumpIfInventory (string inventorytype, int amount, int offset, int match_type) - the match_type (or something like this) must be 0 (less), 1 (exactly), 2 (more), because the ability to check if there are more items than the value is not enough!

A_JumpIfHealth (int health, int offset, int match_type) - enhanced variant of poor A_JumpIfHealthLower with similar new argument

A_JumpIfArmor (int armor, int offset, int match_type) - function checking for armor is extremely necessary!

A_JumpIfPlayerInventory (string inventorytype, int amount, int offset, int match_type) - this must always check for an item in the players inventoery regardless of the activator of the function - very often necessary

apart from state jumps I'd like this to be enhanced:

A_Fall (int blocking) - if the new argument is 1, then the actor stays solid after death, but its height gets equivalent to its deathheight property

There are a couple of flags I consider necessary (at least only a couple that I remember at the moment, 'cause I have many ideas)
VANISHONWATER - it should make the projectile be removed when it touches liquid texture. For now it is only possible, when the projectile is bouncing, but it MUST be possible to do it without making it to be a bouncing projectile

DOOMBOUNCEFLOOR
DOOMBOUNCEWALLS
these two flags must make the projectile bounce only off floor or only off walls but losing momentum anyway


I can't say I know everything about decorate, perhaps some of the things I suggested already can be realized in other ways - then explain it to me, because it is necessary.
MDenham
Posts: 161
Joined: Sun Oct 14, 2007 2:23 am

Re: Some state jumps, functions and flags - necessary ones

Post by MDenham »

To handle these in order (well, some of them, at least - I'mma be lazy):

* Jumping if less than X in inventory:

Code: Select all

Sample:
A_JumpIfInventory("blah", X-1, Continue)
A_Jump(Less)
Continue:
* Jumping if exactly X in inventory:

Code: Select all

Sample:
A_JumpIfInventory("blah", X, Continue)
A_JumpIfInventory("blah", X-1, Equal)
Continue:
I think it gets relatively obvious where this goes from here - everything you want can be done from a pair of jumps already.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Some state jumps, functions and flags - necessary ones

Post by Graf Zahl »

I can tell you right now that none of these will happen.
What I may add is some additonal features to be used with A_JumpIf - but that's not top priority on my list.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Some state jumps, functions and flags - necessary ones

Post by XutaWoo »

Jekyll Grim Payne wrote:A_JumpIfArmor (int armor, int offset, int match_type) - function checking for armor is extremely necessary!
A_JumpIfInventory.
Jekyll Grim Payne wrote:A_Fall (int blocking) - if the new argument is 1, then the actor stays solid after death, but its height gets equivalent to its deathheight property
I'm pretty sure deathheight is used when something enters a death state, not when A_Fall/A_NoBlocking is called.

Also you can just use A_SpawnItem(Ex) for dropped items.
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Re: Some state jumps, functions and flags - necessary ones

Post by Jekyll Grim Payne »

GrafZahl, all right, as you wish. ALthough it seems odd to me that these weren't present from the very beginning. But whatever.

MDenham, I suppose you forgot quotation marks for direct state jumps in these examples. I didn't understand them because of that at first... Well, if using X-1 works like this, which I didn't know because it wasn't explained anywhere, then it may be enough, although it's far not handy. But we can't perform this check for health anyway.

XutaWoo, and for what item would you check with A_JumpIfInventory to perform armor check?
Last edited by Jekyll Grim Payne on Sat Nov 22, 2008 3:14 am, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Some state jumps, functions and flags - necessary ones

Post by Graf Zahl »

Jekyll Grim Payne wrote:GrafZahl, all right, as you wish. ALthough it seems odd to me that these weren't present from the very beginning. But, whatever.

At the very beginning the expression evaluator was not present. And until recently it was in a state that didn't make expanding it particularly attractive.

But before I start work there I have to finish something else I won't talk about until it's done.
User avatar
Siggi
Posts: 3288
Joined: Sun Oct 03, 2004 8:57 am
Preferred Pronouns: They/Them
Location: South Africa

Re: Some state jumps, functions and flags - necessary ones

Post by Siggi »

Graf Zahl wrote:I have to finish something else I won't talk about until it's done.
Dun dun duuuuun!
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Some state jumps, functions and flags - necessary ones

Post by Graf Zahl »

Not what you are thinking... :mrgreen:
User avatar
Enjay
 
 
Posts: 26945
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Some state jumps, functions and flags - necessary ones

Post by Enjay »

Intriguing. :ninja:
MDenham
Posts: 161
Joined: Sun Oct 14, 2007 2:23 am

Re: Some state jumps, functions and flags - necessary ones

Post by MDenham »

Jekyll Grim Payne wrote:GrafZahl, all right, as you wish. ALthough it seems odd to me that these weren't present from the very beginning. But whatever.

MDenham, I suppose you forgot quotation marks for direct state jumps in these examples. I didn't understand them because of that at first... Well, if using X-1 works like this, which I didn't know because it wasn't explained anywhere, then it may be enough, although it's far not handy. But we can't perform this check for health anyway.
Sure you can. I'll switch to pseudo-code rather than "fake DECORATE" so that hopefully you're not confused:

Currently, we have:

Code: Select all

if (health < x) jump to LABEL Z
If we want to jump if health is equal, we'd do:

Code: Select all

if (health < x+1) jump to NEXT
jump to CONTINUE
NEXT: if (health < x) jump to CONTINUE
jump to LABEL Z
CONTINUE: ...
And if we just want to jump if health is greater, we'd do:

Code: Select all

if (health < x+1) jump to CONTINUE
jump to LABEL Z
CONTINUE: ...
Features will not be added to supplement shortcomings in intelligence.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Some state jumps, functions and flags - necessary ones

Post by Graf Zahl »

MDenham wrote:Features will not be added to supplement shortcomings in intelligence.

The real reason is 'Features will not be added if they only provide short-term solutions but end up being bloat later when better options become available.'

In other words: There will be no new A_JumpIf... commands at all. Anything new will be additions to the expression evaluator so it can be used with A_JumpIf.
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Some state jumps, functions and flags - necessary ones

Post by Gez »

Siggi wrote:
Graf Zahl wrote:I have to finish something else I won't talk about until it's done.
Dun dun duuuuun!
If we never hear about it again, then it's Doomscript!
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Some state jumps, functions and flags - necessary ones

Post by Graf Zahl »

That entirely depends on Randy! :mrgreen:
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”