- Joined
- Feb 12, 2007
- Messages
- 99
Hello, back on mapmaking I am struck against a very odd bug, here I want to create three sets of units who each have texttag (floating text), it works for the first set (difficulty) but after that the units are correctly created but the texttag don't want to appear no matter what.
From many tests it doesn't seem like the recursive function is at fault nor the limit of texttag (managed to create another using another trigger).
I tried splitting the first set of units and the rest in two triggers too but the second and third set don't work...
I ran out of idea after three hours trying to find the problem and humbly ask if you've any idea to solve this problem ?
From many tests it doesn't seem like the recursive function is at fault nor the limit of texttag (managed to create another using another trigger).
I tried splitting the first set of units and the rest in two triggers too but the second and third set don't work...
I ran out of idea after three hours trying to find the problem and humbly ask if you've any idea to solve this problem ?
JASS:
function CreateDifficultyUnit takes integer i returns nothing
local location l = PolarProjectionBJ(Location(14261, -1452), 400, i*360/7 + 30)
local unit u = CreateUnit(Player(15), udg_ListTypeU[i], GetLocationX(l), GetLocationY(l), 270)
local texttag t = CreateTextTagUnitBJ(udg_ListSTR[i], u, 0, 10, 100, 90-i*10, 90-i*10, 0)
call SetTextTagPermanent(t, false)
call SetTextTagLifespan(t, 30)
if i < 7 then
call CreateDifficultyUnit(i+1)
endif
endfunction
function CreateHeroChoosingUnit takes integer i returns nothing
local location l = PolarProjectionBJ(Location(15200, -6900), 400, i*45 + 30)
local unit u = CreateUnit(Player(15), udg_ListTypeU[i], GetLocationX(l), GetLocationY(l), 270)
local texttag t = CreateTextTagUnitBJ(udg_ListSTR[i], u, 0, 10, 100, 90-i*10, 90-i*10, 0)
call SetTextTagPermanent(t, false)
call SetTextTagLifespan(t, 30)
call PauseUnit(u, true)
if i < 8 then
call CreateHeroChoosingUnit(i+1)
endif
set t = null
set u = null
endfunction
function Trig_CreateSelection_Actions takes nothing returns nothing
local unit u = CreateUnit(Player(15), 'n01P', 14261, -1452, 270)
local texttag t
//A-Create Difficulty units & TextTag
//ListTypeU[1->7] and ListSTR[0->7] are used here
set udg_ListSTR[0] = "God Play - The ultimate Challenge."
set udg_ListTypeU[1] = 'n008'
set udg_ListSTR[1] = "None - No attack, no event (good or bad)"
set udg_ListTypeU[2] = 'n00C'
set udg_ListSTR[2] = "Weak - Dying here is an impossibility"
set udg_ListTypeU[3] = 'n00D'
set udg_ListSTR[3] = "Average - Good difficulty to learn the game"
set udg_ListTypeU[4] = 'n010'
set udg_ListSTR[4] = "Strong - Getting serious."
set udg_ListTypeU[5] = 'n00J'
set udg_ListSTR[5] = "Very Strong - Prepare for full scale assault from early on."
set udg_ListTypeU[6] = 'n00S'
set udg_ListSTR[6] = "Insane - Prepare for constant attacks, Black clan incoming"
set udg_ListTypeU[7] = 'n00O'
set udg_ListSTR[7] = "Undefeatable - Varied, powerful, fast and monstruous assaults."
//ListSTR[8->?] used here
set udg_ListSTR[8] = "Empire : Management, lot of research and large armies."
set udg_ListSTR[9] = "Hero : Sometime, one lone being can change the face of the World."
set t = CreateTextTagUnitBJ(udg_ListSTR[0], u, 0, 10, 100, 10, 10, 0)
call SetTextTagPermanent(t, false)
call SetTextTagLifespan(t, 30)
call CreateDifficultyUnit(1)
//B-Create Units to choice empire or hero
set u = CreateUnit(Player(15), 'o000', 9090, -5640, 270)
call CreateTextTagUnitBJ( udg_ListSTR[8], u, 0, 1000, 100, 100, 100, 0)
call SetTextTagPermanent(t, false)
call SetTextTagLifespan(t, 30)
set u = CreateUnit(Player(15), 'h00X', 9350, -5640, 270)
set t = CreateTextTagLocBJ(udg_ListSTR[9], Location(9350, -5640), 0, 10, 50, 50, 80, 0)
call SetTextTagPermanent(t, false)
call SetTextTagLifespan(t, 30)
// Set ListTypeU[1->7] to ID of heroes units
set udg_ListTypeU[1] = 'H000'
set udg_ListSTR[1] = "Berserk :Melee offensive class whole sole objective is to damage the opponent"
set udg_ListTypeU[2] = 'H02U'
set udg_ListSTR[2] = "Monk :Melee defensive(?) class who adore the goddess Pandobeer(Fun garanted)."
set udg_ListTypeU[3] = 'H00T'
set udg_ListSTR[3] = "Hunter :Ranged class adept of hit-and-run as well as traps."
set udg_ListTypeU[4] = 'H00T'
set udg_ListSTR[4] = "Dark Ranger :Ranged powerful hybrid class able to summon as well as damage and drain life,has however long cooldown and high mana cost."
set udg_ListTypeU[5] = 'H02G'
set udg_ListSTR[5] = "Necromancer :Int short-ranged hero able to summon powerful creatures to do his bidding,able to use very high damage spell... for a price..."
set udg_ListTypeU[6] = 'H02U'
set udg_ListSTR[6] = "Knight :->Semi-Tank with lot of buffs and heal, very hard to kill but still have some deadly ability.->Hybrid class needing a good repartition of stats, afraid of dispel.->Good at everything, bad in nothing, excel in nothing. "
set udg_ListTypeU[7] = 'H01Q'
set udg_ListSTR[7] = "Assassin :good for movement and instantkill, highest physical dps,start with a HIGH malus armor."
set udg_ListTypeU[8] = 'H02H'
set udg_ListSTR[8] = "Magician :Has large array of spells with varied effects, high damage.Bad with withstanding attacks once his mana is down."
call CreateHeroChoosingUnit(1)
set u = null
set t = null
endfunction
//===========================================================================
function InitTrig_CreateSelection takes nothing returns nothing
set gg_trg_CreateSelection = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_CreateSelection, 1.00 )
call TriggerAddAction( gg_trg_CreateSelection, function Trig_CreateSelection_Actions )
endfunction