HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Variable game speed - fast doesn't work.

12-28-2007, 03:06 AM#1
crazedcougar
I have some triggers set up to change the game speed on user input. It works correctly when changing to the normal, slow, and slowest gamespeeds. It simply fails to do anything with the fast or faster game speeds.

Has anyone worked with gamespeeds before? Encountered this problem? How can I learn more about why this is happening?

Here the trigger (please forgive the poor condition):
Collapse JASS:
function Trig_activate_game_speed_Conditions takes nothing returns boolean
    if ( udg_inBattle == false ) then
        return false
    endif
    if (udg_desiredGameSpeed == GetGameSpeed() ) then
        return false
    endif
    return true
endfunction

function Trig_activate_game_speed_Actions takes nothing returns nothing
    call DisplayTextToForce(GetPlayersAll(), "old speed: " + gameSpeedToStr(GetGameSpeed()) + " new speed: " + gameSpeedToStr(udg_desiredGameSpeed))
    call DisplayTextToForce(GetPlayersAll(), "Changing game speed to: " + gameSpeedToStr(udg_desiredGameSpeed))
    call SetGameSpeed(udg_desiredGameSpeed)
    call DisplayTextToForce(GetPlayersAll(), "old speed: " + gameSpeedToStr(GetGameSpeed()) + " new speed: " + gameSpeedToStr(udg_desiredGameSpeed))
endfunction

//===========================================================================
function InitTrig_activate_game_speed takes nothing returns nothing
    set gg_trg_activate_game_speed = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_activate_game_speed, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( gg_trg_activate_game_speed, Condition( function Trig_activate_game_speed_Conditions ) )
    call TriggerAddAction( gg_trg_activate_game_speed, function Trig_activate_game_speed_Actions )
endfunction
12-28-2007, 11:42 AM#2
Silvenon
Quote:
(please forgive the poor condition)

I'll try, it won't be easy :)

gameSpeedToStr?
12-28-2007, 01:42 PM#3
crazedcougar
Well, let me know how it should be if you want :P

Heres the func:
Collapse JASS:
function gameSpeedToStr takes gamespeed inputSpeed returns string
    if (inputSpeed == MAP_SPEED_SLOWEST) then
        return "slowest"
    elseif (inputSpeed == MAP_SPEED_SLOW) then
        return "slow"
    elseif (inputSpeed == MAP_SPEED_NORMAL) then
        return "normal"
    elseif (inputSpeed == MAP_SPEED_FAST) then
        return "fast"
    elseif (inputSpeed == MAP_SPEED_FASTEST) then
        return "fastest"
    else 
        return "invalid gamespeed"
    endif
endfunction
12-28-2007, 09:51 PM#4
Silvenon
Collapse JASS:
function Trig_activate_game_speed_Conditions takes nothing returns boolean
    return not udg_inBattle and udg_desiredGameSpeed == GetGameSpeed()
endfunction

udg_desiredGameSpeed? Where are you initializing it? (Sorry, I forgot that one)
12-28-2007, 10:14 PM#5
crazedcougar
set udg_origionalGameSpeed = GetGameSpeed() runs at time = 0.00, I believe it did not work on map init. (I may be mistaken though)

Strange thigns have been cropping up with this, once with the slowest speed selected players god disconnected when the speed change, and it creates a strange issue with dialogs which I'm just beginning to look in to.

Has anyone actually used gamespeed successfully?

Ever?
12-28-2007, 10:16 PM#6
Captain Griffen
Look, anything below normal is never expected to be used by Blizzard - it can only be accessed by triggers, which Blizzard never really programmed for.