Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
the risk of random :)
#18
Well, it shouldn't be possible to get Tinker through the random trigger, since there is a hard coded list, that does not include the Tinker.

You can check the code yourself:

Code:
function GetRandomStartTankType takes player P returns integer
    local integer Gold = GetPlayerState(P, PLAYER_STATE_RESOURCE_GOLD)
    local integer array TankTypes
    local integer TankTypesMax
    local integer Start
    local integer i

    //Start game tanks
    set TankTypes[0] = 'H01L'    //Scout
    set TankTypes[1] = 'H00X'    //Anti-Grav
    set TankTypes[2] = 'H009'    //Light Tank
    set TankTypes[3] = 'H008'    //Helicopter
    set TankTypes[4] = 'H007'    //Demolisher
    set TankTypes[5] = 'H017'    //Medivac

    //Mid game tanks
    set TankTypes[10] = 'H011'    //Goblin Shredder
    set TankTypes[11] = 'H00R'    //Ghost Tank
    set TankTypes[12] = 'H012'    //Guard
    set TankTypes[13] = 'H00C'    //Air Ship
    set TankTypes[14] = 'H00B'    //Thunder Tank
    set TankTypes[15] = 'H00D'    //Heavy Tank
    set TankTypes[16] = 'H00I'    //Goblin Tank

    //End game tanks
    set TankTypes[20] = 'H01R'    //Sky Fortress
    set TankTypes[21] = 'H00K'    //Infernal Robot
    set TankTypes[22] = 'H00F'    //Demon Tank
    set TankTypes[23] = 'H00H'    //Frost Robot
    set TankTypes[24] = 'H00E'    //Sky Tank
    set TankTypes[25] = 'H01S'    //Hunter
        
    if Gold < 10000 then
        set TankTypesMax = 5
        set Start = 0
    elseif Gold < 30000 then
        set TankTypesMax = 6
        set Start = 10
    else
        set TankTypesMax = 5
        set Start = 20
    endif
    
    set i = GetRandomInt(Start,TankTypesMax+Start)
    loop
        exitwhen ((TankMeetsTechRequirements(P, TankTypes[i]) == 0) and ((not udg_TankMonopoly) or (not AnyAllyHasTankOfType(P,TankTypes[i]))))
        set i = i + 1
        if i > (TankTypesMax + Start) then
            if Start > 0 then
                set Start = Start - 10
                
                if Start < 10 then
                    set TankTypesMax = 5
                elseif Start < 20 then
                    set TankTypesMax = 6
                else
                    set TankTypesMax = 5
                endif
                
                set i = GetRandomInt(Start,TankTypesMax+Start)
            else
                set i = 0
            endif
            
        endif
    endloop
    return TankTypes[i]
endfunction

I also just checked if the comments with the tank names are correct, so there is no problem (Tinker is 'H006').
This post has been brought to you by Sand - it's everywhere, get used to it.
Reply


Messages In This Thread
the risk of random :) - by BENNIE.FM - 2009-06-10, 06:51:46
Re: the risk of random :) - by Exodus - 2009-06-10, 08:33:12
Re: the risk of random :) - by Dr.Popitz - 2009-06-10, 09:09:29
Re: the risk of random :) - by Dr.McNinja - 2009-06-10, 10:35:53
Re: the risk of random :) - by BENNIE.FM - 2009-06-10, 11:01:58
Re: the risk of random :) - by ChronicStoned - 2009-06-10, 20:30:13
Re: the risk of random :) - by Dr.Popitz - 2009-06-11, 09:11:27
Re: the risk of random :) - by Dr.McNinja - 2009-06-11, 11:47:26
Re: the risk of random :) - by ChronicStoned - 2009-06-11, 13:37:43
Re: the risk of random :) - by DerSatan - 2009-06-11, 19:30:10
Re: the risk of random :) - by Dr.Popitz - 2009-06-12, 08:56:29
Re: the risk of random :) - by SCorpA1 - 2009-06-12, 13:06:51
Re: the risk of random :) - by Dr.Popitz - 2009-06-12, 13:23:32
Re: the risk of random :) - by Gammagulp - 2009-06-12, 15:16:53
Re: the risk of random :) - by Dr.Popitz - 2009-06-15, 09:50:53
Re: the risk of random :) - by horselance - 2009-06-15, 21:43:45
Re: the risk of random :) - by Dr.Popitz - 2009-06-15, 22:15:22
Re: the risk of random :) - by Exodus - 2009-06-15, 22:47:09
Re: the risk of random :) - by Dr.Popitz - 2009-06-16, 08:49:19
Re: the risk of random :) - by Exodus - 2009-06-16, 10:39:49
Re: the risk of random :) - by Dr.Popitz - 2009-06-16, 11:45:00
Re: the risk of random :) - by SCorpA1 - 2009-06-16, 17:51:32
Re: the risk of random :) - by TKF - 2009-06-16, 18:26:02
Re: the risk of random :) - by horselance - 2009-06-16, 21:29:04
Re: the risk of random :) - by Dr.McNinja - 2009-06-17, 03:28:40

Possibly Related Threads…
Thread Author Replies Views Last Post
  Random reward BENNIE.FM 23 21,845 2014-03-28, 18:56:20
Last Post: Max
  Random stat BENNIE.FM 3 4,237 2013-09-04, 01:37:34
Last Post: BENNIE.FM
  Random tinker Izumi 3 4,084 2012-04-09, 00:53:58
Last Post: LoveComesAgain
  All random? Random Tanks? AeroniumX 2 4,119 2012-03-05, 12:12:42
Last Post: LIoOoOoIL
  RANDOM HOT KEY BENNIE.FM 6 5,939 2010-10-10, 13:53:48
Last Post: olivercamel



Users browsing this thread: 13 Guest(s)