Random frame duration without using A_Jump

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: Random frame duration without using A_Jump

by Siggi » Tue Jul 31, 2007 11:07 am

Never post large amount of text in caps either, it gives other people a headache. :?

by KeksDose » Sun Jul 29, 2007 10:29 am

OH!! :laff: NEVER MAKE POINTLESS POSTS WHEN YOU HAVE A HEADACHE :P Would be cool if that would be in.

by Snarboo » Sun Jul 29, 2007 10:28 am

I don't believe this feature has been implemented yet, Keks. ;) Graf was just showing how such a feature might work.

by KeksDose » Sun Jul 29, 2007 9:49 am

Indeed, that makes my particle spawn codes way shorter than normal ;) Never heard of this action :P I should check the Wiki more often :P

[EDIT] O_o The Wiki doesn't cover this? Oh my god :shock:

by Snarboo » Sun Jul 29, 2007 9:37 am

Ooh, that looks nifty. Something like that could be very useful. :)

by Graf Zahl » Sun Jul 29, 2007 9:32 am

It would set the duration that is stored inside the actor to any value you'd specify. You could do it like

Code: Select all

  TNT1 A 1 A_SetDuration(random(2,20)*2)
  TNT1 A 0 A_CustomMissile("something")

by Snarboo » Sun Jul 29, 2007 8:21 am

Ah, I see. What would such a code pointer do, exactly?

by Graf Zahl » Sun Jul 29, 2007 8:17 am

Sorry, but the state definitions don't allow it. The best you might get is a code pointer that sets a state's duration.

Random frame duration without using A_Jump

by Snarboo » Sun Jul 29, 2007 6:56 am

This sounds confusing, but what I'm asking for here is the ability to make an animation frame last a random amount of tics rather than using a series of A_Jump's to do the same thing. Basically, I want to be able to use the RANDOM(Small#,Large#) variable for frame durations.

Kind of like this:

Code: Select all

Psuedocode:
ACTOR BagOfPopcorn
{
  states
  {
  Spawn:
  TNT1 A RANDOM(2,20) A_CustomMissile("Popcorn1")
  TNT1 A RANDOM(2,20) A_CustomMissile("Popcorn2")
  TNT1 A RANDOM(2,20) A_CustomMissile("Popcorn3")
  Stop
  }
}
This sort of thing can already be done with bullet attacks to randomize their damage. This could be valuable for objects with unpredictable behavior such as a bag of popcorn without having to use a bunch of A_Jump's. If this can already be done like the above example, I apologize.

Top