How to change UI artwork depending on game type.
- DinkyDyeAussie
- Posts: 260
- Joined: Fri Feb 10, 2012 10:39 am
- Location: Australia
How to change UI artwork depending on game type.
Was playing Wargus using WIP mod. I wanted to know if it's possible to change the artwork based on the campaign/skirmish map you're playing. I have interface artwork for Warcraft 1 and Warcraft 2, and at the moment I change which artwork the game uses, by editing the script files for orc and human.
What I'd like is for the game to change the artwork for both races, based on whether you play the war1 remake or the war2 campaign. Can this be done using scripts?
What I'd like is for the game to change the artwork for both races, based on whether you play the war1 remake or the war2 campaign. Can this be done using scripts?
Re: How to change UI artwork depending on game type.
Yes, it can be done. Modify this part of scripts.lua to use the UI you want:DinkyDyeAussie wrote:Was playing Wargus using WIP mod. I wanted to know if it's possible to change the artwork based on the campaign/skirmish map you're playing. I have interface artwork for Warcraft 1 and Warcraft 2, and at the moment I change which artwork the game uses, by editing the script files for orc and human.
What I'd like is for the game to change the artwork for both races, based on whether you play the war1 remake or the war2 campaign. Can this be done using scripts?
Code: Select all
if (GetPlayerData(GetThisPlayer(), "RaceName") == "human") then
Load("scripts/human/ui.lua")
elseif (GetPlayerData(GetThisPlayer(), "RaceName") == "orc") then
Load("scripts/orc/ui.lua")
end
- DinkyDyeAussie
- Posts: 260
- Joined: Fri Feb 10, 2012 10:39 am
- Location: Australia
Re: How to change UI artwork depending on game type.
How would I add this condition?
Re: How to change UI artwork depending on game type.
This seems to work for me:DinkyDyeAussie wrote:How would I add this condition?
Code: Select all
if (currentExp == "wc1") then
if (GetPlayerData(GetThisPlayer(), "RaceName") == "human") then
Load("wip/scripts/human/wc1_ui.lua")
elseif (GetPlayerData(GetThisPlayer(), "RaceName") == "orc") then
Load("wip/scripts/orc/wc1_ui.lua")
end
else
if (GetPlayerData(GetThisPlayer(), "RaceName") == "human") then
Load("scripts/human/ui.lua")
Load("wip/scripts/human/ui.lua")
elseif (GetPlayerData(GetThisPlayer(), "RaceName") == "orc") then
Load("scripts/orc/ui.lua")
Load("wip/scripts/orc/ui.lua")
end
end
Code: Select all
if (GetPlayerData(GetThisPlayer(), "RaceName") == "human") then
Load("wip/scripts/human/ui.lua")
elseif (GetPlayerData(GetThisPlayer(), "RaceName") == "orc") then
Load("wip/scripts/orc/ui.lua")
end
- DinkyDyeAussie
- Posts: 260
- Joined: Fri Feb 10, 2012 10:39 am
- Location: Australia
Re: How to change UI artwork depending on game type.
Thanks man! I'll give that a go later.
**EDIT**
Just tried it and it works. You're officially a legend now, if you weren't already before, which I imagine you were
**EDIT**
Just tried it and it works. You're officially a legend now, if you weren't already before, which I imagine you were
- DinkyDyeAussie
- Posts: 260
- Joined: Fri Feb 10, 2012 10:39 am
- Location: Australia
Re: How to change UI artwork depending on game type.
So now I have the main in-game interface working...How do I make it so the menus also have the same textures? I have seen the:
in the guichan file. How would I make this work with the game when I switch to Warcraft 1 and want to have those panels in the game instead of the war2 ones?
Code: Select all
local hpanels = {
"ui/human/panel_1.png",
"ui/human/panel_2.png",
"ui/human/panel_3.png",
"ui/human/panel_4.png",
"ui/human/panel_5.png"
}
local opanels = {
"ui/orc/panel_1.png",
"ui/orc/panel_2.png",
"ui/orc/panel_3.png",
"ui/orc/panel_4.png",
"ui/orc/panel_5.png"
}
Re: How to change UI artwork depending on game type.
I'm glad I was able to helpDinkyDyeAussie wrote:Thanks man! I'll give that a go later.
**EDIT**
Just tried it and it works. You're officially a legend now, if you weren't already before, which I imagine you were
You need to define similar things for your wc1 panels (preferentially just below the definitions you cited):DinkyDyeAussie wrote:So now I have the main in-game interface working...How do I make it so the menus also have the same textures? I have seen the:
in the guichan file. How would I make this work with the game when I switch to Warcraft 1 and want to have those panels in the game instead of the war2 ones?Code: Select all
local hpanels = { "ui/human/panel_1.png", "ui/human/panel_2.png", "ui/human/panel_3.png", "ui/human/panel_4.png", "ui/human/panel_5.png" } local opanels = { "ui/orc/panel_1.png", "ui/orc/panel_2.png", "ui/orc/panel_3.png", "ui/orc/panel_4.png", "ui/orc/panel_5.png" }
Code: Select all
local wc1_hpanels = {
"ui/human/wc1_panel_1.png",
"ui/human/wc1_panel_2.png",
"ui/human/wc1_panel_3.png",
"ui/human/wc1_panel_4.png",
"ui/human/wc1_panel_5.png"
}
local wc1_opanels = {
"ui/orc/wc1_panel_1.png",
"ui/orc/wc1_panel_2.png",
"ui/orc/wc1_panel_3.png",
"ui/orc/wc1_panel_4.png",
"ui/orc/wc1_panel_5.png"
}
Then you need to replace this:
Code: Select all
function panel(n)
if (GetPlayerData(GetThisPlayer(), "RaceName") == "human") then
return hpanels[n]
else
return opanels[n]
end
end
Code: Select all
function panel(n)
if (currentExp == "wc1") then
if (GetPlayerData(GetThisPlayer(), "RaceName") == "human") then
return wc1_hpanels[n]
else
return wc1_opanels[n]
end
else
if (GetPlayerData(GetThisPlayer(), "RaceName") == "human") then
return hpanels[n]
else
return opanels[n]
end
end
end
- DinkyDyeAussie
- Posts: 260
- Joined: Fri Feb 10, 2012 10:39 am
- Location: Australia
Re: How to change UI artwork depending on game type.
Thanks man that worked too. Got the WC1 panels working in the WC1 and the WC2 panels workin as normal too.
Now I just gotta keep making the panels for the WC1 human interface.
Now I just gotta keep making the panels for the WC1 human interface.