| 02-21-2007, 12:20 PM | #1 |
EDIT: I realised, row/colum are swapped in non Bj's once I did that it works. Ok I had the following trigger working before, but since I removed all the BJ's it has suddenly stopped working. Basically this is to set Hero Icons per player, depending on which hero they have. When they pick a hero at the start, i set their hero = to a global and run this trigger. JASS:function Trig_SetBoardIcon_Actions takes nothing returns nothing local unit c = udg_Unit_Selection local integer t = GetUnitTypeId(c) local player p = GetOwningPlayer(c) local integer o = GetConvertedPlayerId(p) local integer n = 1 // udg_Player_Board[o] local string s local multiboarditem it = null // Dragon Knight if t == 'H001' then set s = "ReplaceableTextures\\CommandButtons\\BTNTheCaptain.blp" // Rogue Knight elseif t == 'H00O' then set s = "ReplaceableTextures\\CommandButtons\\BTNFelGuardBlue.blp" // Bounty Hunter elseif t == 'H00T' then set s = "ReplaceableTextures\\CommandButtons\\BTNDranaiMage.blp" // Royal Marksman elseif t == 'H002' then set s = "ReplaceableTextures\\CommandButtons\\BTNRifleman.blp" // Silencer elseif t == 'H00U' then set s = "ReplaceableTextures\\CommandButtons\\BTNSpellBreaker.blp" // Crystal Maiden elseif t == 'H00S' then set s = "ReplaceableTextures\\CommandButtons\\BTNJaina.blp" // Priest elseif t == 'H00Q' then set s = "ReplaceableTextures\\CommandButtons\\BTNPriest.blp" // Mystic elseif t == 'H003' then set s = "ReplaceableTextures\\CommandButtons\\BTNBanditMage.blp" // Lord of Olympia elseif t == 'H00M' then set s = "ReplaceableTextures\\CommandButtons\\BTNHeroMountainKing.blp" // Bloodseeker elseif t == 'H00V' then set s = "ReplaceableTextures\\CommandButtons\\BTNShaman.blp" // Treant Protector elseif t == 'H006' then set s = "ReplaceableTextures\\CommandButtons\\BTNTreant.blp" // Tidehunter elseif t == 'H00X' then set s = "ReplaceableTextures\\CommandButtons\\BTNSeaGiantGreen.blp" // Wendigo elseif t == 'H004' then set s = "ReplaceableTextures\\CommandButtons\\BTNWendigo.blp" // Anti Mage elseif t == 'O009' then set s = "ReplaceableTextures\\CommandButtons\\BTNHeroDemonHunter.blp" // Juggernaught elseif t == 'O001' then set s = "ReplaceableTextures\\CommandButtons\\BTNChaosBlademaster.blp" // Druid elseif t == 'H008' then set s = "ReplaceableTextures\\CommandButtons\\BTNFurion.blp" // Will O' the Wisp elseif t == 'H007' then set s = "ReplaceableTextures\\CommandButtons\\BTNWisp.blp" // Axe elseif t == 'H005' then set s = "ReplaceableTextures\\CommandButtons\\BTNChaosGrom.blp" // Life Stealer elseif t == 'H011' then set s = "ReplaceableTextures\\CommandButtons\\BTNGhoul.blp" // Lord of Avernus elseif t == 'H00I' then set s = "ReplaceableTextures\\CommandButtons\\BTNHeroDeathKnight.blp" // Night Stalker elseif t == 'H00E' then set s = "ReplaceableTextures\\CommandButtons\\BTNHeroDreadlord.blp" // Skeleton King elseif t == 'H00G' then set s = "ReplaceableTextures\\CommandButtons\\BTNSkeletonArcher.blp" // Phantom elseif t == 'O000' then set s = "ReplaceableTextures\\CommandButtons\\BTNSpiritOfVengeance.blp" // Bane Elemental elseif t == 'H00J' then set s = "ReplaceableTextures\\CommandButtons\\BTNVoidWalker.blp" // Lich elseif t == 'H00K' then set s = "ReplaceableTextures\\CommandButtons\\BTNLichVersion2.blp" // Necromancer elseif t == 'H00R' then set s = "ReplaceableTextures\\CommandButtons\\BTNNecromancer.blp" // Firegourger elseif t == 'N006' then set s = "ReplaceableTextures\\CommandButtons\\BTNHeroAvatarOfFlame.blp" // Drow Ranger elseif t == 'N005' then set s = "ReplaceableTextures\\CommandButtons\\BTNBansheeRanger.blp" // Succubus elseif t == 'H00F' then set s = "ReplaceableTextures\\CommandButtons\\BTNAssasin.blp" // Priestess of the Moon elseif t == 'E005' then set s = "ReplaceableTextures\\CommandButtons\\BTNPriestessOfTheMoon.blp" // Ninja elseif t == 'O002' then set s = "ReplaceableTextures\\CommandButtons\\BTNNinja.blp" // Grand Marshall elseif t == 'H00N' then set s = "ReplaceableTextures\\CommandButtons\\BTNGrandMarshall.blp" endif set it = MultiboardGetItem(udg_Multiboard, 0, n) call MultiboardSetItemIcon(it, s) set it = null set p = null set c = null endfunction //=========================================================================== function InitTrig_Multiboard_Hero_Icons takes nothing returns nothing set gg_trg_Multiboard_Hero_Icons = CreateTrigger() call TriggerAddAction( gg_trg_Multiboard_Hero_Icons, function Trig_SetBoardIcon_Actions) endfunction Player 1, is always on the 2nd row (row - 1 in jass), but the icon doesnt change??? |
