Some state jumps, functions and flags - necessary ones
Moderator: GZDoom Developers
- 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
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.
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.
Re: Some state jumps, functions and flags - necessary ones
To handle these in order (well, some of them, at least - I'mma be lazy):
* Jumping if less than X in inventory:
* Jumping if exactly X in inventory:
I think it gets relatively obvious where this goes from here - everything you want can be done from a pair of jumps already.
* Jumping if less than X in inventory:
Code: Select all
Sample:
A_JumpIfInventory("blah", X-1, Continue)
A_Jump(Less)
Continue:
Code: Select all
Sample:
A_JumpIfInventory("blah", X, Continue)
A_JumpIfInventory("blah", X-1, Equal)
Continue:
- Graf Zahl
- 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
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.
What I may add is some additonal features to be used with A_JumpIf - but that's not top priority on my list.
- 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
A_JumpIfInventory.Jekyll Grim Payne wrote:A_JumpIfArmor (int armor, int offset, int match_type) - function checking for armor is extremely necessary!
I'm pretty sure deathheight is used when something enters a death state, not when A_Fall/A_NoBlocking is called.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
Also you can just use A_SpawnItem(Ex) for dropped items.
- 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
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?
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.
- Graf Zahl
- 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
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.
- 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
Dun dun duuuuun!Graf Zahl wrote:I have to finish something else I won't talk about until it's done.
- Graf Zahl
- 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
Not what you are thinking... 

Re: Some state jumps, functions and flags - necessary ones
Sure you can. I'll switch to pseudo-code rather than "fake DECORATE" so that hopefully you're not confused: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.
Currently, we have:
Code: Select all
if (health < x) jump to LABEL Z
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: ...
Code: Select all
if (health < x+1) jump to CONTINUE
jump to LABEL Z
CONTINUE: ...
- Graf Zahl
- 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
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.
Re: Some state jumps, functions and flags - necessary ones
If we never hear about it again, then it's Doomscript!Siggi wrote:Dun dun duuuuun!Graf Zahl wrote:I have to finish something else I won't talk about until it's done.
- Graf Zahl
- 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
That entirely depends on Randy! 
