How to randomize a float value in the DECORATE parser?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

How to randomize a float value in the DECORATE parser?

Post by Nash »

Code: Select all

TNT1 A 0 A_FadeTo(random(0.25, 1.0), 1.0, false)
What I'm trying to do here is to give the actor a random opacity at spawn. However, this doesn't work - what happens is the actor is either invisible, or visible at spawn. I'm guessing that it's not randomizing the value in the way I think it should have.

Is this even possible?
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: How to randomize a float value in the DECORATE parser?

Post by Blue Shadow »

For float points use frandom.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: How to randomize a float value in the DECORATE parser?

Post by Nash »

Thanks! :D
Locked

Return to “Editing (Archive)”