WTB scroll bar.

Fixious

Test Lead
It seems you can't play the demo back at normal speeds if you alter it at any point. If I speed it up/slow it down, there's no way to go back to the base speed. PausePlayDemo command plays it back noticeably slower, and you can't correct it.
 

Arch

Legions Developer
It seems you can't play the demo back at normal speeds if you alter it at any point. If I speed it up/slow it down, there's no way to go back to the base speed. PausePlayDemo command plays it back noticeably slower, and you can't correct it.
Odd, I have the same code and mine does go back to 1x speed. Does it skip past 1?
 

Fixious

Test Lead
Maybe it's just because I was fast-forwarding throughout the demo that it seemed slower than usual, and it's 6am in the morning. I'm going to bed and will mess with it later.
 

Fixious

Test Lead
I guess it was just my eyes. Legions itself feels slower after watching the demos for some reason. Anyway to play demos at base speed with one press of the button, so there's a smoother transition? Was sorta hoping this worked, but alas it didn't. Currently if you're going fast/slow and press the PlayPause button it pauses first, then plays at base speed. I'd like to skip the Pause part.

Code:
        GlobalActionMap.bind(keyboard, "up", PlayDemo);
        GlobalActionMap.bind(keyboard, "right", SpeedUpDemo);
        GlobalActionMap.bind(keyboard, "left", SlowDownDemo);
        GlobalActionMap.bind(keyboard, "down", PauseDemo);

edit: Huh. Even removing the entire Pause function from democontrols.cs doesn't remove it.
 

Arch

Legions Developer
I guess it was just my eyes. Legions itself feels slower after watching the demos for some reason. Anyway to play demos at base speed with one press of the button, so there's a smoother transition? Was sorta hoping this worked, but alas it didn't. Currently if you're going fast/slow and press the PlayPause button it pauses first, then plays at base speed. I'd like to skip the Pause part.

Code:
        GlobalActionMap.bind(keyboard, "up", PlayDemo);
        GlobalActionMap.bind(keyboard, "right", SpeedUpDemo);
        GlobalActionMap.bind(keyboard, "left", SlowDownDemo);
        GlobalActionMap.bind(keyboard, "down", PauseDemo);

edit: Huh. Even removing the entire Pause function from democontrols.cs doesn't remove it.
Nope that won't do it. The reason is the fact that the up and down keys are trying to link to functions that aren't in the script. Replace the function entitled PausePlayDemo with this one. It will make it so when you press p (or whatever you have it set to) after slowing down or speeding up it will reset the speed back to 1.
Code:
function PausePlayDemo(%val)
{
    if (!%val)
    return;
 
    if ($timeScale == 0)
        demoQuit.onClick();
    else if(demoSpeedText.getText() != 1)
    {
        demoSpeedText.setText(1);
        demoSetSpeed.onClick();
        return;
    }
    else
        demoPause.onClick();
}
 

Fixious

Test Lead
Perfect
images
. If you could incorporate this into the next update, as well as making the speed controls a bit smoother that'd be great. 'course, might be pointless if demos never get fixed. Ah well. Thanks for the effort anyways.
 

Fixious

Test Lead
What would these values have to be if I wanted to press just one button to get really slow playback (ala 300 fight-scenes or whatever)?

Code:
function SlowDownDemo(%val)
{
    if(!%val)
        return;
 
    else if(demoSpeedText.getText() > 1)
    {
        demoSpeedText.setText(demoSpeedText.getText() - 1);
        demoSetSpeed.onClick();
        return;
    }
 
    if(demoSpeedText.getText() <= 1 && (demoSpeedText.getText() >= 0.05))
    {
        demoSpeedText.setText(demoSpeedText.getText() - 0.05);
        demoSetSpeed.onClick();
        return;
    }
}
 

Arch

Legions Developer
What would these values have to be if I wanted to press just one button to get really slow playback (ala 300 fight-scenes or whatever)?

Code:
function SlowDownDemo(%val)
{
    if(!%val)
        return;
 
    else if(demoSpeedText.getText() > 1)
    {
        demoSpeedText.setText(demoSpeedText.getText() - 1);
        demoSetSpeed.onClick();
        return;
    }
 
    if(demoSpeedText.getText() <= 1 && (demoSpeedText.getText() >= 0.05))
    {
        demoSpeedText.setText(demoSpeedText.getText() - 0.05);
        demoSetSpeed.onClick();
        return;
    }
}
Imo, it would just be easier to make a new function. Paste this under the other mapings at the top of the file. Changing the key to what you want of course.
Code:
GlobalActionMap.bind(keyboard, "ctrl j", SuperSlowMotion);
And paste this in the script someplace.
Code:
function SuperSlowMotion(%val)
{
    if(!%val)
        return;
       
    if(demoSetSpeed.getText() != 0.15)
    {
        demoSpeedText.setText(0.15);
        demoSetSpeed.onClick();
        return;
    }
}
Changing the 0.15 to your desired slowness. Just be aware that anything too close to .1 will just make the demo pause instead of slow down. And you can reset it back to the native speed by pressing your keybinding for pausing the demo.
 

Fixious

Test Lead
Ah. Yeah, I created a new function called SuperSlowMo but had the wrong values (had it at 0.005 or something). I just copypasted the current slowmo code to see what the values would be. Thanks.

edit: Actually, looks like I had to delete to dso file to get that to work. I'd recommend doing the same to anyone else who wants to use this.
 

Fixious

Test Lead
Just an update on this for 1.40. You'll pretty much have to do the same steps listed on the previous page. $demoMode = 1; is still missing from the loadDemoButton function in the loadDemo file. Just add it after the commented out Canvas.popDialog(loadDemo); line. One bug I have run into is the new PausePlay feature I requested. Pressing my PausePlay button (for me its up arrow) pauses the game, but pressing it again simply closes the client. PausePlay works in Live. The other binds seems to work just fine in 1.40. This is my demoControls file:

Code:
$demo_lastTimeScale = 1;
 
function LoadDemoKeyBindings()
{
    if($demoMode)
    {
        GlobalActionMap.bind(keyboard, "up", PausePlayDemo);
        GlobalActionMap.bind(keyboard, "right", SpeedUpDemo);
        GlobalActionMap.bind(keyboard, "left", SlowDownDemo);
        GlobalActionMap.bind(keyboard, "down", SuperSlowMo);
    }
}
 
function GameHud::onWake(%this)
{
    parent::onWake(%this);
 
    LoadDemoKeyBindings();
}
 
function PausePlayDemo(%val)
{
    if (!%val)
    return;
 
    if ($timeScale == 0)
        demoQuit.onClick();
    else if(demoSpeedText.getText() != 1)
    {
        demoSpeedText.setText(1);
        demoSetSpeed.onClick();
        return;
    }
    else
        demoPause.onClick();
}
 
function SpeedUpDemo(%val)
{
    if(!%val)
        return;
 
    else if(demoSpeedText.getText() >= 1)
    {
        demoSpeedText.setText(demoSpeedText.getText() + 1);
        demoSetSpeed.onClick();
        return;
    }
 
    if(demoSpeedText.getText() < 1 && (demoSpeedText.getText() >= 0))
    {
        demoSpeedText.setText(demoSpeedText.getText() + 0.05);
        demoSetSpeed.onClick();
        return;
    }
}
 
function SlowDownDemo(%val)
{
    if(!%val)
        return;
 
    else if(demoSpeedText.getText() > 1)
    {
        demoSpeedText.setText(demoSpeedText.getText() - 1);
        demoSetSpeed.onClick();
        return;
    }
 
    if(demoSpeedText.getText() <= 1 && (demoSpeedText.getText() >= 0.05))
    {
        demoSpeedText.setText(demoSpeedText.getText() - 0.05);
        demoSetSpeed.onClick();
        return;
    }
}
 
function SuperSlowMotion(%val)
{
    if(!%val)
        return;
 
    if(demoSetSpeed.getText() != 0.15)
    {
        demoSpeedText.setText(0.15);
        demoSetSpeed.onClick();
        return;
    }
}
 
function demoPlay::onClick(%this)
{
  $timeScale = $demo_lastTimeScale;
}
 
function demoPause::onClick(%this)
{
  $demo_lastTimeScale = $timeScale;
  $timeScale = 0;
}
 
function demoQuit::onClick(%this)
{
  $timeScale = 1;
  $demo_lastTimeScale = 1;
  ServerConnection.stopDemo();
}
 
function demoSetSpeed::onClick(%this)
{
  $timeScale = demoSpeedText.getText();
}

Any ideas?
 

RockeyRex

Legions Developer
Code:
$demo_lastTimeScale = 1;
 
function LoadDemoKeyBindings()
{
    if($demoMode)
    {
        GlobalActionMap.bind(keyboard, "up", PausePlayDemo);
        GlobalActionMap.bind(keyboard, "right", SpeedUpDemo);
        GlobalActionMap.bind(keyboard, "left", SlowDownDemo);
        GlobalActionMap.bind(keyboard, "down", SuperSlowMo);
    }
}
 
function GameHud::onWake(%this)
{
    parent::onWake(%this);
 
    LoadDemoKeyBindings();
}
 
function PausePlayDemo(%val)
{
    if (!%val)
    return;
 
    if ($timeScale == 0)
        demoPlay.onClick();
    else if(demoSpeedText.getText() != 1)
    {
        demoSpeedText.setText(1);
        demoSetSpeed.onClick();
        return;
    }
    else
        demoPause.onClick();
}
 
function SpeedUpDemo(%val)
{
    if(!%val)
        return;
 
    else if(demoSpeedText.getText() >= 1)
    {
        demoSpeedText.setText(demoSpeedText.getText() + 1);
        demoSetSpeed.onClick();
        return;
    }
 
    if(demoSpeedText.getText() < 1 && (demoSpeedText.getText() >= 0))
    {
        demoSpeedText.setText(demoSpeedText.getText() + 0.05);
        demoSetSpeed.onClick();
        return;
    }
}
 
function SlowDownDemo(%val)
{
    if(!%val)
        return;
 
    else if(demoSpeedText.getText() > 1)
    {
        demoSpeedText.setText(demoSpeedText.getText() - 1);
        demoSetSpeed.onClick();
        return;
    }
 
    if(demoSpeedText.getText() <= 1 && (demoSpeedText.getText() >= 0.05))
    {
        demoSpeedText.setText(demoSpeedText.getText() - 0.05);
        demoSetSpeed.onClick();
        return;
    }
}
 
function SuperSlowMotion(%val)
{
    if(!%val)
        return;
 
    if(demoSetSpeed.getText() != 0.15)
    {
        demoSpeedText.setText(0.15);
        demoSetSpeed.onClick();
        return;
    }
}
 
function demoPlay::onClick(%this)
{
  $timeScale = $demo_lastTimeScale;
}
 
function demoPause::onClick(%this)
{
  $demo_lastTimeScale = $timeScale;
  $timeScale = 0;
}
 
function demoQuit::onClick(%this)
{
  $timeScale = 1;
  $demo_lastTimeScale = 1;
  ServerConnection.stopDemo();
}
 
function demoSetSpeed::onClick(%this)
{
  $timeScale = demoSpeedText.getText();
}
 

Fixious

Test Lead
A small annoyance with this in 1.40. Every time you join a game the mini health/energy bars but your reticle are displayed, even if you have them turned off by default. The Settings say they're off, but they still show. Ticking On and Off will remove them.

I've attached the scripts I'm using below.
 

Attachments

  • scripts.zip
    1.3 KB · Views: 8
Top