| 06-10-2004, 05:45 PM | #1 |
OK I am getting quite frustrated with trying to figure out the whole Tavern Hero selection system. I open up some maps (the unprotected ones anyway) and take a look at the triggers and the one that initializes the maps (or seems to anyway) is always something along the lines of this code: function Trig_Init_Variables_Actions takes nothing returns nothing set udg_colors[1] = "|c00ff0303" set udg_colors[2] = "|c000042ff" set udg_colors[3] = "|c001ce6b9" set udg_colors[4] = "|c00540081" set udg_colors[5] = "|c00fffc01" set udg_colors[6] = "|c00feba0e" set udg_colors[7] = "|c0020c000" set udg_colors[8] = "|c00e55bb0" set udg_colors[9] = "|c00959697" set udg_colors[10] = "|c007ebff1" set udg_colors[11] = "|c00106246" set udg_colors[12] = "|c004e2a04" set udg_const_start_gp = 500 set udg_const_start_hero_lv = 1 set udg_const_respawn_factor = 3.0 set udg_game_types[0] = "Long" set udg_game_type_level[0] = 1 set udg_game_type_gold[0] = 500 set udg_game_types[1] = "Medium" set udg_game_type_level[1] = 5 set udg_game_type_gold[1] = 1500 set udg_game_types[2] = "Short" set udg_game_type_level[2] = 10 set udg_game_type_gold[2] = 5000 set udg_game_types[3] = "Ridiculous" set udg_game_type_level[3] = 1 set udg_game_type_gold[3] = 15000 set udg_players_ne = ( CountPlayersInForceBJ(GetPlayersAllies(Player(0))) - 1 ) set udg_players_ud = ( CountPlayersInForceBJ(GetPlayersAllies(Player(6))) - 1 ) call SetPlayerHandicapXPBJ( Player(1), 100.00 ) call SetPlayerHandicapXPBJ( Player(2), 100.00 ) call SetPlayerHandicapXPBJ( Player(3), 100.00 ) call SetPlayerHandicapXPBJ( Player(4), 100.00 ) call SetPlayerHandicapXPBJ( Player(5), 100.00 ) call SetPlayerHandicapXPBJ( Player(7), 100.00 ) call SetPlayerHandicapXPBJ( Player(8), 100.00 ) call SetPlayerHandicapXPBJ( Player(9), 100.00 ) call SetPlayerHandicapXPBJ( Player(10), 100.00 ) call SetPlayerHandicapXPBJ( Player(11), 100.00 ) call SetPlayerFlagBJ( PLAYER_STATE_GIVES_BOUNTY, true, Player(0) ) call SetPlayerFlagBJ( PLAYER_STATE_GIVES_BOUNTY, true, Player(6) ) set udg_creep_n_melee = 2 set udg_creep_n_ranged = 4 set udg_const_start_gp = 500 set udg_const_start_hero_lv = 1 set udg_top_hero_level = 1 endfunction //=========================================================================== function InitTrig_Init_Variables takes nothing returns nothing set gg_trg_Init_Variables = CreateTrigger( ) call TriggerRegisterTimerEventSingle( gg_trg_Init_Variables, 1.00 ) call TriggerAddAction( gg_trg_Init_Variables, function Trig_Init_Variables_Actions ) endfunction I cannot, for the life of me make any of this out and I have been trying to find a "GUI" version of it but have had no success. If any one could help me out with this I would so greatly appreciate it. |
| 06-10-2004, 10:06 PM | #2 | |
As far as my humble understaning goes for JASS this is what i make of it: The first lines just sets a bunch of colors to differnent color codes, nothing important. Well, most of the lines begin with set, which sets different variables to something. Quote:
Theese lines set differnent game types or difficulities, like easy medium short and so on. Then they set gold and some kind of level, dunno what it does. The call functions sets to players to reecieve 100% XP from future kills. Anyways, to wrap it up... As far as i see it all theese things could have been done via GUI without any problem. If you just look at them it makes sense. the "set udg_somenamearray[] =" is just a simple set variable actions to something. The reason for the udg_ is because it's a global variable. Hope i helped out, i might not have - Milkman |
