News:

Currently available MegaGlest gameservers are listed on Play.MG.

Main Menu

upgrade sub-menu thing

Started by Zoythrus, 17 February 2012, 07:20:39

Zoythrus

hey, i was looking at the new thing that allows us to put upgrades in a sub-menu like buildings, but it didnt fully make sense to me. can i get an example showing multiple upgrades? also, can someone explain how it fully works?

-Zoy

Omega

#1
Quote from: Zoythrus on 17 February 2012, 07:20:39
hey, i was looking at the new thing that allows us to put upgrades in a sub-menu like buildings, but it didnt fully make sense to me. can i get an example showing multiple upgrades? also, can someone explain how it fully works?

-Zoy

Code (https://docs.megaglest.org/XML/Commands#Upgrade) Select
<command>
<type value="upgrade" />
<name value="upgrade" tip="tip_name" />
<image path="images/image.bmp" />
<unit-requirements>
<unit name="my_unit" />
</unit-requirements>
<upgrade-requirements>
<upgrade name="my_upgrade" />
</upgrade-requirements>
<upgrade-skill value="upgrade_skill" />
<produced-upgrades>
<upgrade name="my_upgrade1" tip="tip_name1" />
<upgrade name="my_upgrade2" tip="tip_name2" />
</produced-upgrades>
</command>


Pretty straight forward, move the <produced-upgrade> element one level down so it's a child of the new <produced-upgrades> element. There can be multiple <produced-upgrade> elements, which are each a single upgrade (work the same way as the tag did in vanilla Glest). The rendered output will be a menu just like how the build command normally is.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert