DoomTools icon indicating copy to clipboard operation
DoomTools copied to clipboard

[DECOHack] Global Labels for Filled State Sets

Open MTrop opened this issue 4 years ago • 1 comments

The state fill <INTEGER> blocks can fill arbitrary states, but if you have a large range of freed states, it makes little sense to care about the index, especially if it may be filled by the time this clause is reached in code.

Proposal:

auto state fill <IDENTIFIER>
{
  // state code...
}

The first index of the filled block will be assigned <IDENTIFIER>, which is checked for non-use. If not used yet, it is assigned and available to the rest of DECOHack from that point forward. Label references can now have a scope outside Things and Weapons.

But how to refer to these later? Maybe take a page from Issue https://github.com/MTrop/DoomTools/issues/31:

auto state <IDENTIFIER>

For example:

A_RandomJump(auto state runcycle2, 128)
goto auto state resurrect

This will make the reference clear in Things and Weapons, to ensure label references do not get shadowed.

MTrop avatar Jul 03 '21 16:07 MTrop

This may be obsoleted by some other plans, but I'll tag this with "low priority" as it is not a current concern.

MTrop avatar Mar 07 '22 03:03 MTrop