NintendoDS1993
10.08.2011 11:03
974 mal angesehen

Frage zu Buttons

Vor einiger Zeit hab ich mal wieder eine Kampagnenmap gespielt.
Da kommen ja die seltsamsten Buttons drin vor.
Frage nun: kommmt man an die noch irgendwie heran?


Auf das Bild klicken, um es in Originalgröße zu sehen (971,66 KB)


Kommentare

» Kommentar schreiben

andre111
10.08.2011 21:40

@andre:
Ein Link hätte wohl gereicht

@warrior1024
Ich hab blos keine Ahnung mehr gehabt, wo des zu fincden ist

totalwarANGEL
10.08.2011 13:16

Diese Dinger waren wohl das Vorbild für die Quests in AeK.

NintendoDS1993
10.08.2011 13:11

Hab schon die Lösung gefunden:
XGUIEng.TransferMaterials("QuestInformationIcon", "OnlineHelpButton"
Dadurch lässt sich z.B. die Textur auf den Fragezeicehnbutton projezieren.

Edit: hier sollte mal ein Ändern-Button eingefügt werden - musste ein 4fach Post-machen

NintendoDS1993
10.08.2011 12:49

Hmmm, das ganze sind also keine gewöhnlichen Buttons, sondern spezielle Texturen. Als Button kann man die also nicht verwenden?

NintendoDS1993
10.08.2011 12:39

Ok - jetzt hat alles geklappt. Ich musste erst noch eine Updatefunction schreiben.

Gruß NDSfan

NintendoDS1993
10.08.2011 12:26

Ähm, danke für die Hilfe. Aber irgendwie passiert bei mir nichts? Was brauch ich noch?
hab das Beispiel von andre verwendet.

warrior1024
10.08.2011 12:14

Hier gibt es einen Wikiartikel dazu:
http://www.siedler-games.de/si.../tutorials:quest-informationen
Wenn du die Funktion verstanden hast, kannst du auch andere Buttons als nur die, die angegeben sind, benutzen.

@andre:
Ein Link hätte wohl gereicht

andre111
10.08.2011 11:16

Aufrauf(z.b.):
SetupQuestInformation({texture = "Well",counter = "0/3",update = updateb,tooltip = ""})

//updatefunktion, darin kann man den counter verändern
function updateb()
UpdateQuestInformation({counter = 1/3"})
end

verdammt passt nicht:
hier des ende:
function UpdateQuestInformation(_quest)
if type(_quest) ~= "table" then
return _quest;
end

if _quest.tooltip then --needs keys
GUIQuestTools.QuestTable.tooltip = _quest.tooltip;
GUIQuestTools.QuestTooltip = _quest.tooltip;
GUIQuestTools.UpdateQuestInformationTooltip();
end

if _quest.counter then
GUIQuestTools.QuestTable.counter = _quest.counter;
GUIQuestTools.UpdateQuestInformationString( _quest.counter );
GUIQuestTools.UpdateQuestInformationCounter();
end

if _quest.texture then
GUIQuestTools.QuestInformationTexture = _quest.texture;
GUIQuestTools.QuestTable.texture = _quest.texture;
GUIQuestTools.InitQuestInformation();

if GUIQuestTools.QuestTable.path ~= nil then
assert(type(GUIQuestTools.QuestTable.path) == "string";
local texturePath = GUIQuestTools.QuestTable.path .. "\\" .. _quest.texture .. ".png";
for i = 0, 4, 1 do
XGUIEng.SetMaterialTexture( "QuestInformationIcon", i, texturePath );
end
end
end
end

andre111
10.08.2011 11:13

Das hier ist die benötigte Comfortfunction(von wem sie ist weis ich jetzt nichtm mehr):

function SetupQuestInformation(_quest)
assert(not GUIQuestTools.QuestTable); --no running quest information before
assert(type(_quest) == "table"; --_quest needs to be a table
assert(type(_quest.texture) == "string";
--assert(type(_quest.tooltip) == "string"; --not necessary, because quest information tooltips need keys.
--two key examples: CM_GenericText/Mentor ( "Mentor" ), CM_GenericText/Hermit ( "Einsiedler" / "Hermit" ).
--these keys can be created by calling String.GenericKey(), example: String.GenericKey( "Mentor" )
assert(type(_quest.counter) == "string"; --counter must be a string
assert(type(_quest.update) == "function"; --update will be called every second to update the quest information by return

GUIQuestTools.QuestTable = _quest;

GUIQuestTools.StartQuestInformation( _quest.texture, _quest.tooltip or "", 1, 1 );
GUIQuestTools.UpdateQuestInformationTooltip();
GUIQuestTools.UpdateQuestInformationString( _quest.counter );
GUIQuestTools.UpdateQuestInformationCounter();

--another path???
if _quest.path ~= nil then
assert(type(_quest.path) == "string";
local texturePath = _quest.path .. "\\" .. _quest.texture .. ".png";
for i = 0, 4, 1 do
XGUIEng.SetMaterialTexture( "QuestInformationIcon", i, texturePath );
end
end

--start update job
if _quest.event then
_quest.job = Trigger.RequestTrigger( _quest.event, nil, "GUIQuestTools_UpdateQuestInformation", 1 );
else
_quest.job = StartSimpleJob( "GUIQuestTools_UpdateQuestInformation" );
end
end

function DisableQuestInformation()
if GUIQuestTools.QuestTable then
-- end update job
EndJob( GUIQuestTools.QuestTable.job );
end

GUIQuestTools.DisableQuestInformation();
GUIQuestTools.QuestCounterString = nil;
GUIQuestTools.QuestTooltip = nil;
GUIQuestTools.QuestInformationTexture = nil;

GUIQuestTools.QuestTable = nil;
end

function GUIQuestTools_UpdateQuestInformation()
if UpdateQuestInformation(GUIQuestTools.QuestTable.update()) == true then
DisableQuestInformation();
end
end

function UpdateQuestInformation(_quest)
if type(_quest) ~= "table" then
return _quest;
end

if _quest.tooltip then --needs keys
GUIQuestTools.QuestTable.tooltip = _quest.tooltip;
GUIQuestTools.QuestTooltip = _quest.tooltip;
GUIQuestTools.UpdateQuestInformationTooltip();
end

if _quest.counter then
GUIQuestTools.QuestTable.counter = _quest.counter;
GUIQuestTools.UpdateQuestInformationString( _quest.counter );
GUIQuestTools.UpdateQuestInformationCounter();
end

if _quest.texture then
GUIQuestTo

SiteEngine v1.5.0 by nevermind, ©2005-2007
Design by SpiderFive (www.siedler-games.de) - English translation by juja

Impressum