English hudtxtalphafade - from 0 to 1

18 replies
Goto Page
To the start Previous 1 Next To the start
30.03.20 09:06:21 pm
Up
AtomKuh
User
Offline Off
I am trying to do hudtxtalphafade from alpha 0 to alpha 1.

This is what I am doing:

First, I am setting the alpha value to 0
Code:
1
parse('hudtxtalphafade '..id..' 0 0 0)

0 - terminal ID
0 - duration (because it should be alpha 0 instantly)
0 - alpha value

After that, I want the hudtxt alpha to be 1 in 1000ms
Code:
1
parse('hudtxtalphafade '..id..' 0 1000 1)


Well, it does not work for me... The hudtext alpha appears to be 1 right from the beginning
30.03.20 10:13:09 pm
Up
Mami Tomoe
User
Offline Off
There's a bug where you cant set it to 0 milliseconds, put it at 1 millisecond and it'll work.
30.03.20 10:50:02 pm
Up
AtomKuh
User
Offline Off
I have done that and it still does not work

Code:
1
2
parse('hudtxtalphafade '..id..' 0 1 0)
parse('hudtxtalphafade '..id..' 0 1000 1)
31.03.20 12:18:18 am
Up
BcY
Reviewer
Offline Off
parse('hudtxtalphafade '..id..' 0 1 0')
parse('hudtxtalphafade '..id..' 0 1000 0')

' is important
Kgb2d Community - Since 2012
31.03.20 12:55:33 am
Up
AtomKuh
User
Offline Off
You are right but I just forgot it here^^ It still doesnt work
31.03.20 07:23:25 am
Up
Cure Pikachu
User
Offline Off
What if you set a slight delay on the next cs2d cmd hudtxtalphafade ?
Code:
parse("hudtxtalphafade "..id.." 0 1 0")
timer(1,"parse","hudtxtalphafade "..id.." 0 1000 1")
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
31.03.20 01:26:53 pm
Up
Bowlinghead
User
Offline Off
Valid ID?
Code:
1
msg("My ID: "..tostring(id))
Share time limited free games here
31.03.20 04:23:32 pm
Up
The kennyS
User
Offline Off
So share all your code and let's see what we can do.
31.03.20 04:53:41 pm
Up
Masea
Super User
Offline Off
This happened to me not too long ago, but god knows what exactly my fix was back then. Try playing with the timer time, set it to something like 100ms or maybe a little lower until you see it is working.
Create your UI easy and fast: UI Framework | Go deeper into the darkness and test your bravery: file cs2d Outlast II Modification (27)
31.03.20 04:55:02 pm
Up
BcY
Reviewer
Offline Off
No, the correct way to do it:

this is an example from me:
Code:
1
2
3
parse('hudtxt 4 "'..os.date("Time:©255255255 %I:%M %p %A, %d %b %Y")..'" 300 472 0 0 5')
parse('hudtxtalphafade 0 4 4000 0') --will be done in 4 secs
timer(4000,"parse","hudtxtalphafade 0 4 4000 1")
Kgb2d Community - Since 2012
31.03.20 05:03:32 pm
Up
Masea
Super User
Offline Off
@user BcY: What's the difference between yours and the aforementioned?
Create your UI easy and fast: UI Framework | Go deeper into the darkness and test your bravery: file cs2d Outlast II Modification (27)
31.03.20 05:25:02 pm
Up
BcY
Reviewer
Offline Off
The timer(second alphafade) starts when the first alphafade stops.

The details are important.
parse('hudtxtalphafade 0 4 4000 0') --will last 4 seconds
timer(4000,"parse","hudtxtalphafade 0 4 4000 1") --starts in 4 seconds so it will be executed when the first alpha fade ends.
Kgb2d Community - Since 2012
31.03.20 05:29:56 pm
Up
Masea
Super User
Offline Off
@user BcY: But he doesn't want it to happen in 4 seconds. Those are optional. Read what OP said in the first place.
edited 1×, last 31.03.20 05:31:55 pm
Create your UI easy and fast: UI Framework | Go deeper into the darkness and test your bravery: file cs2d Outlast II Modification (27)
31.03.20 05:31:11 pm
Up
BcY
Reviewer
Offline Off
The values can be changed, i just showed the way to make it work.
Kgb2d Community - Since 2012
31.03.20 05:33:50 pm
Up
Masea
Super User
Offline Off
@user BcY: The only difference between your code and OP's code is optional values which don't affect the code technically.
Create your UI easy and fast: UI Framework | Go deeper into the darkness and test your bravery: file cs2d Outlast II Modification (27)
31.03.20 05:34:59 pm
Up
BcY
Reviewer
Offline Off
My version works.
Kgb2d Community - Since 2012
31.03.20 07:15:03 pm
Up
AtomKuh
User
Offline Off
First of all, thanks for all ur answers

The version with the timer works somehow....

If the timer is set on 200ms it will work:

Code:
1
2
3
parse('hudtxt2 '..id..' 0 "@@@@@@@@@@@@@@@@@@@@" 30 420')
parse("hudtxtalphafade " ..id.. " 0 0 0")
timer(200,"parse","hudtxtalphafade 0 0 500 1")


If the timer is set on 100ms it wont work:

Code:
1
2
3
parse('hudtxt2 '..id..' 0 "@@@@@@@@@@@@@@@@@@@@" 30 420')
parse("hudtxtalphafade " ..id.. " 0 0 0")
timer(100,"parse","hudtxtalphafade 0 0 500 1")
To the start Previous 1 Next To the start