Jump to content

GZDoom :: Pulse Light Phase De-syncing


Lutz

Recommended Posts

Forgive the ridiculous thread title -- here's what I want to know:

 

Is there an easy way (i.e. without creating my own thing type) to adjust a Dynamic Phase Light so that its min/max pulse is not in sync with every other Phase Light?  In other words: currently every Phase Light I add to the level reaches min/max brightness at the same time; I would like to be able to offset that peak for each light.

 

Thoughts?

 

BONUS QUESTION: I assume I could do this if I did create my own thing type -- is that correct?

Share this post


Link to post

If you place a pulse light in your map and you have its default set to start 64 and end 32, then make one next to it that has its start at 32 and end at 64.

They shouldn't be in sync, they should pulse at just the opposite glow times. 

Share this post


Link to post

i think that's part of the issue though - that there's a global, unchanging timer across the board. afaik it's hard-coded, as the thing just calls the "pulse" type with no available variables, flags, etc. which is a shame. i guess you could do some ACS loops to increase/decrease light sources, but that's so many loops doing so many things all the time...

Share this post


Link to post

Yeah I guess that is the main issue with them, the speed.

I wonder if it's possible to take the image that the dyno light uses and apply an animation to it?

Share this post


Link to post

I'm no ZScript expert, but this seems to work well enough:


 

class MyLight : PointLight
{
    int min, max;
    int dir;

    Default
    {
        //$Arg3 Start Intensity
        //$Arg3Default 32
        //$Arg4 End Intensity
        //$Arg4Default 128
    }

    override void PostBeginPlay()
    {
        Super.PostBeginPlay();

        min = args[3];
        max = args[4];
        dir = random(0, 1) ? 1 : -1;
        args[3] = Random(min, max);
    }

    override void Tick()
    {
        args[3] += dir;
        if(args[3] >= max || args[3] <= min)
            dir *= -1;
    }
}

 

Edited by boris

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...