Alpha changes depending upon speed.

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
Hunter66
Posts: 7
Joined: Mon Aug 03, 2009 12:54 am

Alpha changes depending upon speed.

Post by Hunter66 »

Is it possible? OR am I just failing? I've looked around and I haven't seen anything that works because I've tried some of them ... most of the script 'types' seem to limit my capabilities to constant checking of variables. I was hoping there was a way that when the player stopped moving they would become invisible and when they started to move (aka speed above 0) their alpha would increase to about 0.5. I've tried a few methods and they haven't really worked :( . So, I'm asking if it's possible and is there any way I can do it? I'm not using any other libraries than the normal libraries.

If there IS anyway to do it without ACS that'd be nice but I really doubt it, doesn't matter though - I can do some ACS if I need to :D

EDIT: Already got this working, I doubt really anyone needs this but if anyone does this script is right on this page.
Last edited by Hunter66 on Mon Aug 03, 2009 4:09 pm, edited 1 time in total.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Alpha changes depending upon speed.

Post by XutaWoo »

Well, if you REALLY don't want to use ACS, then you can do it with velocity checks in the player class.

However, using ACS will simplify the checks as you wouldn't have to worry about the states.
User avatar
Ichor
Posts: 1784
Joined: Wed Jul 23, 2003 9:22 pm

Re: Alpha changes depending upon speed.

Post by Ichor »

You might be able to add something to the spawn state of the player, since (if I remember right) the player goes to the spawn state when he's completely stopped.
User avatar
Hunter66
Posts: 7
Joined: Mon Aug 03, 2009 12:54 am

Re: Alpha changes depending upon speed.

Post by Hunter66 »

Huh, alright I could give it a try. I wouldn't mind using ACS it's just that I'm not exactly THAT good at it.

I tried using the whole spawn state thing and i do go completely invisible when he stops but doesn't change back. I TRIED using the following for the spawn of the player.

Code: Select all

Spawn:
    PLAY A -1 A_JumpIf (momx >= 0,1)
  
    PLAY A -1 A_SetTranslucent (0,0)
    Loop
    
    PLAY A -1 A_SetTranslucent (0.5,0)
    Loop
ALSO tried replacing (momx >= 0,1) with (momx == 1,1) and it just makes him STAY visible. So I might be thinking of heading on over >>> to the ACS choice maybe? :lol:
User avatar
Ichor
Posts: 1784
Joined: Wed Jul 23, 2003 9:22 pm

Re: Alpha changes depending upon speed.

Post by Ichor »

How about this:

Code: Select all

    Spawn:
        PLAY -1 A_SetTranslucent (0,0)
        Loop
    See:
        PLAY A 0 A_SetTranslucent (0.5,0)
        PLAY ABCD 4
        Loop
    Missile:
        PLAY E 0 A_SetTranslucent (0.5,0)
        PLAY E 12 
        Goto Spawn
    Melee:
        PLAY F 0 A_SetTranslucent (0.5,0)
        PLAY F 6 BRIGHT
        Goto Missile
    Pain:
        PLAY G 0 A_SetTranslucent (0.5,0)
        PLAY G 4
        PLAY G 4 A_Pain
        Goto Spawn
This way, he should become partly visible when he moves, attacks, and gets hit, but will revert to complete invisibility when he stands still.
User avatar
Hunter66
Posts: 7
Joined: Mon Aug 03, 2009 12:54 am

Re: Alpha changes depending upon speed.

Post by Hunter66 »

Thanks, that works pretty well. But the weird thing is when I went to see how well it worked by using chase cam it refuses to do it just says: Chasecam on ... :? anyways. It's kind of weird not necessarily like anyone plays in chasecam mode so it's not really needed. Now I just gotta work out the rest of the stuff for my map.
Locked

Return to “Editing (Archive)”