Hi everyone.
So I have been making MUI quests using the simple methods which are used in The_big_S's guide in combination with a UI created via the Reforged UI creator. In total a player can have 14 quests. I want to somehow bind each quest to a button in the UI. This is because I want to remove the correct quest from each players quest log whenever they finish a quest, or when they chose to abandon a quest. I then want to be able to fill in that empty gap, or move all quest below up once so there is no gap. I have tried making it work with Hashtables but I am having a hard time figuring that out correctly.
I am able to make it so that the correct text is shown for each button, I have done this is in a stupid temp way by just saving the amount of quests the player has and then binding the last button to the last quest. This is done in a pretty stupid way but I couldn't think of another way of doing it MUI. I have no clue how to add GUI triggers to threads correctly, so I've added a print.
I also tried doing it like this
I hope I've been clear enough. If not feel free to ask for more information.
Thank you in advance.
So I have been making MUI quests using the simple methods which are used in The_big_S's guide in combination with a UI created via the Reforged UI creator. In total a player can have 14 quests. I want to somehow bind each quest to a button in the UI. This is because I want to remove the correct quest from each players quest log whenever they finish a quest, or when they chose to abandon a quest. I then want to be able to fill in that empty gap, or move all quest below up once so there is no gap. I have tried making it work with Hashtables but I am having a hard time figuring that out correctly.
I am able to make it so that the correct text is shown for each button, I have done this is in a stupid temp way by just saving the amount of quests the player has and then binding the last button to the last quest. This is done in a pretty stupid way but I couldn't think of another way of doing it MUI. I have no clue how to add GUI triggers to threads correctly, so I've added a print.
JASS:
function Trig_QuestPlace_Actions takes nothing returns nothing
if (udg_QuestAmount[GetConvertedPlayerId(GetTriggerPlayer())] == 1) then
call BlzFrameSetText(QuestbuttonT[00],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[00],true)
set Quest1Title[R2I(QuestAdd)] = Thisquesttitle
set Quest1String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[GetConvertedPlayerId(GetTriggerPlayer())] == 2) then
call BlzFrameSetText(QuestbuttonT[01],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[01],true)
set Quest2Title[R2I(QuestAdd)] = Thisquesttitle
set Quest2String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 3) then
call BlzFrameSetText(QuestbuttonT[02],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[02],true)
set Quest3Title[R2I(QuestAdd)] = Thisquesttitle
set Quest3String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 4) then
call BlzFrameSetText(QuestbuttonT[03],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[03],true)
set Quest4Title[R2I(QuestAdd)] = Thisquesttitle
set Quest4String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 5) then
call BlzFrameSetText(QuestbuttonT[04],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[04],true)
set Quest5Title[R2I(QuestAdd)] = Thisquesttitle
set Quest5String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 6) then
call BlzFrameSetText(QuestbuttonT[05],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[05],true)
set Quest6Title[R2I(QuestAdd)] = Thisquesttitle
set Quest6String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 7) then
call BlzFrameSetText(QuestbuttonT[06],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[06],true)
set Quest7Title[R2I(QuestAdd)] = Thisquesttitle
set Quest7String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 8) then
call BlzFrameSetText(QuestbuttonT[07],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[07],true)
set Quest8Title[R2I(QuestAdd)] = Thisquesttitle
set Quest8String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 9) then
call BlzFrameSetText(QuestbuttonT[8],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[8],true)
set Quest9Title[R2I(QuestAdd)] = Thisquesttitle
set Quest9String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 10) then
call BlzFrameSetText(QuestbuttonT[9],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[9],true)
set Quest10Title[R2I(QuestAdd)] = Thisquesttitle
set Quest10String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 11) then
call BlzFrameSetText(QuestbuttonT[10],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[10],true)
set Quest11Title[R2I(QuestAdd)] = Thisquesttitle
set Quest11String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 12) then
call BlzFrameSetText(QuestbuttonT[11],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[11],true)
set Quest12Title[R2I(QuestAdd)] = Thisquesttitle
set Quest12String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 13) then
call BlzFrameSetText(QuestbuttonT[12],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[12],true)
set Quest13Title[R2I(QuestAdd)] = Thisquesttitle
set Quest13String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 14) then
call BlzFrameSetText(QuestbuttonT[13],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[13],true)
set Quest14Title[R2I(QuestAdd)] = Thisquesttitle
set Quest14String[R2I(QuestAdd)] = Thisquesttext
elseif (udg_QuestAmount[R2I(QuestAdd)] == 15) then
call BlzFrameSetText(QuestbuttonT[14],Thisquesttitle)
call BlzFrameSetVisible(QuestbuttonT[14],true)
set Quest15Title[R2I(QuestAdd)] = Thisquesttitle
set Quest15String[R2I(QuestAdd)] = Thisquesttext
endif
set QuestAdd = 0
endfunction
//===========================================================================
function InitTrig_QuestPlace takes nothing returns nothing
set gg_trg_QuestPlace = CreateTrigger( )
call TriggerRegisterVariableEvent( gg_trg_QuestPlace, "QuestAdd", NOT_EQUAL, 0 )
call TriggerAddAction( gg_trg_QuestPlace, function Trig_QuestPlace_Actions )
endfunction
I also tried doing it like this
-
Events
-
Map initialization
-
Conditions
-
Actions
-
Hashtable - create a hashtable
-
set Variable QuestHash = (last created hashtable)
-
-
Events
-
Unit - A unit comes withing 256.00 of Verna Furlbrow <gen>
-
Conditions
-
Actions
-
For each (Integer A) from 1 to 14,do (Actions)
-
Loop - Actions
-
Custom script: set udg_CurrQuest= LoadInteger(udg_QuestHash,GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit())),GetForLoopIndexA())
-
if (All conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
CurrQuest Equal to 0
-
-
Then - Actions
-
Custom script: call SaveInteger(udg_CastHash, GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit())),GetForLoopIndexA(), 100)
-
-
-
-
-
I hope I've been clear enough. If not feel free to ask for more information.
Thank you in advance.
Last edited: