Some state jumps, functions and flags - necessary ones

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Some state jumps, functions and flags - necessary ones

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

by Graf Zahl » Sun Nov 23, 2008 8:35 am

That entirely depends on Randy! :mrgreen:

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

by Gez » Sun Nov 23, 2008 7:37 am

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!

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

by Graf Zahl » Sun Nov 23, 2008 2:11 am

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

by MDenham » Sat Nov 22, 2008 10:00 pm

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.

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

by Enjay » Sat Nov 22, 2008 7:56 pm

Intriguing. :ninja:

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

by Graf Zahl » Sat Nov 22, 2008 8:57 am

Not what you are thinking... :mrgreen:

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

by Siggi » Sat Nov 22, 2008 7:54 am

Graf Zahl wrote:I have to finish something else I won't talk about until it's done.
Dun dun duuuuun!

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

by Graf Zahl » Sat Nov 22, 2008 3:13 am

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.

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

by Jekyll Grim Payne » Sat Nov 22, 2008 3:06 am

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?

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

by XutaWoo » Fri Nov 21, 2008 5:01 pm

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.

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

by Graf Zahl » Fri Nov 21, 2008 4:14 pm

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.

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

by MDenham » Fri Nov 21, 2008 3:44 pm

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.

Some state jumps, functions and flags - necessary ones

by Jekyll Grim Payne » Fri Nov 21, 2008 1:26 pm

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.

Top