Custom Pause Lengths

macros macros macros

Moderators: Phineas, noivad

Post Reply
User avatar
Guinness
Exile
Posts: 331
Joined: Sun Sep 11, 2005 11:21 pm
Profession: Pied Piper
Race: Fen'neko
Player Status: Spambot

Custom Pause Lengths

Post by Guinness » Sat Sep 25, 2010 2:52 pm

Alright, the purpose for making this macro was to time lyrics / movements which are set to clanlords FPS to bard music which is set in real time.

Code: Select all

// this sets the current frames per second so the pause times get
// changed accordingly. Input must be the current FPS * 100. This is
// because CL doesn't deal withh with decimals. So 4.32 actual FPS 
// would be 432. The input command would be /fps 432



"/fps"
    {
        setglobal fps @text.word[0]         
    }


// this takes the FPS input and lengthens it to the amount you want
// paused, then divides by the amount we had to muliply the input numbers 
// by to get it back down to the number of frames we want to pause


custompause
    {
        setglobal customtime fps
        setglobal customtime * pauselength
        setglobal customtime / 10000
    }



// Here is a test of the macro. Currently I have to set the pauselength
// and call custompause before each pause. The length you want to pause
// must be multiplied by 100. So 1 second is 100. 2 seconds 200. Half a
// second is 50. One minute and 37 and a quarter seconds is 9725. Here
// I have this command set to pause for 5, 10 then 15 seconds.

"/testpause"
    {
        set pauselength 500
        call custompause
        message 0
        pause customtime
        message 5
        set pauselength 1000
        call custompause
        pause customtime
        message 15
        set pauselength 1500
        call custompause
        pause customtime
        message 30
    } 
This works, but any input to make it more efficient would be nice. One thing that is currently missing is that you lose a bit of time from it. What is mean is when you pause for 1 second at 4.3 fps, you pause for 4 frames and the pause length is actually 0.93 seconds instead of 1 second. So if you had to pause for 1 second 14 times in a row, you'd end up being a second off. What I could put in perhaps is some system where it remembers the milliseconds it didn't use and adds them to the next pause.

Another thing I was wondering about was making the macro for setting the custom time simpler, so that it doesn't have to call custompause everytime you want to change the pauselength.


Thanks for looking at this!
Grank exclaims, "Oh my, a ferocious Scavenger Bird!"

User avatar
Guinness
Exile
Posts: 331
Joined: Sun Sep 11, 2005 11:21 pm
Profession: Pied Piper
Race: Fen'neko
Player Status: Spambot

Re: Custom Pause Lengths

Post by Guinness » Sat Sep 25, 2010 8:26 pm

Ok, I figured out what to do with the time that wasn't used. It was pretty simple actually:

Code: Select all

setglobal timesaver 0

// this sets the current frames per second so the pause times get
// changed accordingly. Input must be the current FPS * 100. This is
// because CL doesn't deal withh with decimals. So 4.32 actual FPS 
// would be 432. The input command would be /fps 432



"/fps"
    {
        setglobal fps @text.word[0]         
    }


// this takes the FPS input and lengthens it to the amount you want
// paused, then divides by the amount we had to muliply the input numbers 
// by to get it back down to the number of frames we want to pause


custompause
    {
        setglobal customtime fps
        setglobal customtime * pauselength
        setglobal customtime + timesaver
        setglobal timesaver customtime
        setglobal customtime / 10000
        setglobal custom customtime
        setglobal customtime * 10000
        setglobal timesaver - customtime           
    }
And I tested the modification with this macro:

Code: Select all

"/testtimesaver"
	{
		set pauselength 500
		call custompause
		message 0
		pause custom
		call custompause
		message 1
		pause custom
		call custompause
		message 2
		pause custom
		call custompause
		message 3
		pause custom
		call custompause
		message 4
		pause custom
		call custompause
		message 5
		pause custom
		call custompause
		message 6
		pause custom
		call custompause
		message 7
		pause custom
		call custompause
		message 8
		pause custom
		call custompause
		message 9
		pause custom
		call custompause
		message 10
		pause custom
		call custompause
		message 11
		pause custom
		call custompause
		message 12
		pause custom
		call custompause
		message 13
		pause custom
		call custompause
		message 14
		pause custom
		call custompause
		message 15
		pause custom
		call custompause
		message 16
		pause custom
		call custompause
		message 17
		pause custom
		call custompause
		message 18
		pause custom
		call custompause
		message 19
		pause custom
		call custompause
		message 20
		pause custom
		call custompause
		message 21
		pause custom
		call custompause
		message 22
		pause custom
		call custompause
		message 22
		pause custom
		call custompause
		message 23
		pause custom
		call custompause
		message 24
		pause custom
		call custompause
		message 25
		pause custom
		call custompause
		message 26
		pause custom
		call custompause
		message 27
		pause custom
		call custompause
		message 28
		pause custom
		call custompause
		message 29
		pause custom
		call custompause
		message 30
		pause custom
		call custompause
		message 31
		pause custom
		call custompause
		message 32
		pause custom
		call custompause
		message 33
		pause custom
		call custompause
		message 34
		pause custom
		call custompause
		message 35
		pause custom
		call custompause
		message 36
		pause custom
		call custompause
		message 37
		pause custom
		call custompause
		message 38
		pause custom
		call custompause
		message 39
		pause custom
		call custompause
		message 40
		pause custom
		call custompause
		message 41
		pause custom
		call custompause
		message 42
		pause custom
		call custompause
		message 43
		pause custom
		call custompause
		message 44
		pause custom
		call custompause
		message 45
		pause custom
		call custompause
		message 46
		pause custom
		call custompause
		message 47
		pause custom
		call custompause
		message 48
		pause custom
		call custompause
		message 49
		pause custom
		call custompause
		message 50
		pause custom
		call custompause
		message 51
		pause custom
		call custompause
		message 52
		pause custom
		call custompause
		message 53
		pause custom
		call custompause
		message 54
		pause custom
		call custompause
		message 55
		pause custom
		call custompause
		message 56
		pause custom
		call custompause
		message 57
		pause custom
		call custompause
		message 58
		pause custom
		call custompause
		message 59
		pause custom
		call custompause
		message 60
		pause custom
	}
Set the time to whatever you like. In the end it's never more than 1 second off, and that may be due to me starting at zero!
Grank exclaims, "Oh my, a ferocious Scavenger Bird!"

Post Reply