Doom Marine
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > [Feature Suggestion] Counter references in state fields
 
Author
All times are GMT. The time now is 13:30. Post New Thread    Post A Reply
esselfortium
A Major Doomworld Concern


Posts: 6613
Registered: 01-02


While thinking about possible ways to simplify the process of coding long animation sequences in EDF, to reduce code bloat and tedious work, I came up with the seemingly simple idea of referencing counter values in place of the sprite-frame field in EDF frames.
Thus, instead of having 30 lines of SMOK|A, SMOK|B, SMOK|C, etc., you could set up a loop using SMOK|Counter(0) or something similar to step through as many frames as needed, using only a few lines of code.

A full example of how this might look:

code:
frame EX_DEATH1 { cmp = "TNT1 | A | * | 0 | SetCounter(0,10,Set) | @next" } frame EX_DEATH2 { cmp = "TROO | Counter(0) | * | 3 | CounterJump(EX_DEATH4,3,30,0) | @next" } frame EX_DEATH3 { cmp = "TNT1 | A | * | 0 | SetCounter(0,1,Add) | @prev" } frame EX_DEATH4 { cmp = "TROO | 31 | * | -1" }


What's happening in each state:

EX_DEATH1: This state makes sure that Counter 0 is set to the value 10 when the death animation begins, and goes on to the next frame.

EX_DEATH2: This state is where the visible animation occurs. It uses the Counter 0 value to determine which sprite frame to draw, then does a CounterJump to check whether it has reached frame 30, in which case it skips to EX_DEATH4. Otherwise, it continues to EX_DEATH3.

EX_DEATH3: This state adds 1 to the Counter 0 value, and returns to EX_DEATH2 so that the newly-specified sprite frame will be displayed.

EX_DEATH4: The final state, which (unless I screwed up the CounterJump syntax, which is very possible) is only reached after the monster has stepped through each sprite frame from 10 to 30 by incrementing Counter 0.



If feasible, this would greatly reduce the amount of copy and paste and tedious manual work involved in defining EDF monster and effect animations.




Further possibilities and related ideas:

If this is possible, might it also be possible to reference counter values in the Bright, State Length, and some other relevant fields? I'm seeing the most immediate and obvious uses for the one I've described, but I'm sure some talented and enterprising individuals could find cool things that could be done with any further possible counter-scripting possibilities. :)

It'd also be pretty amazing if there was some way that counter values could be used in place of one character of a sprite name, but I'm not sure how this would be specified. { cmp = "TRO + Counter(1)" } or something like it (to get a sprite name like "TRO1" or "TRO2" depending on the value) probably would be problematic to check for in every frame, so this would more likely be Heredoc territory I suppose. I don't really know much of anything about those, though!

__________________
essel.spork-chan.net - doom stuff, artwork, and music by esselfortium

Last edited by esselfortium on 02-03-09 at 05:09

Old Post 02-03-09 04:46 #
esselfortium is online now Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 13:30. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > [Feature Suggestion] Counter references in state fields

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.