The TechnoTree

From AOW HT Wiki

Contents

Definition

The techno tree is a kind of abstract hierarchical visual representation of the possible paths of research a player can take and as indicated in the name, appears visually similar to a tree.

Image:mod-technotree.jpg

Implementation

Inspired from the Techno Tree delivered in the game Jacket (cf: Act Of War Direct Action), we would like to provide our own Techno Tree with icons representing each, units, bases or vehicles and exhaustive informations linked to those different items and organize the whole in a way that every level of available technology can be clearly identified.

How to push a new frame

We would like to have an access to our techno tree through the ingame escape menu. Hence, it will be necessary to create an additionnal button in the escape menu interface that pushes our techno tree frame. In order to perform that, you will have to edit the file zHUD_jeu_ArbreTechno.ndf situated in <Game directory>\AOW\Datalight\Interface2D\Ingame and add our new Template_BoutonSimple (an instance of simple button) in the list "fils" of the package Panel_BoutonMenu (Line 167)

 
            Bouton_TechnoTree is Template_BoutonSimple
            (
                Y = 24 
                W = 300 
                H = 20
                Caption = '|TECHNO TREE'
                AccesseurCaption = Nil 
                AccesseurHint = Nil 
                BoutonApparence = $/LIB/Menu/NAB_AOW_Interface_MenuBoutonBlanc
                HintApparence = $/lib/menu/hintapparencepasdehint 
                AccesseurColor = Nil 
                TextColor = D3DRGBA[0, 0, 0, 255] 
                CalqueLevel = 17 
                EffetClick = ~/Ecran_TechnoTree/EffetClick_Open_TechnoTree //effect launched when a click is performed
                EffetDoubleClick = Nil 
                ToucheRaccourcis = Nil 
                EnableAccesseur = Nil 
                HiddenAccesseur = Nil 
                MustCreateAccesseur = Nil
            ),
 

N.B : The parameter EffetClick of a template Template_BoutonSimple is responsible of the action launched when a click is performed on the button. For our case, we would like to push a new Frame which can be achieved calling the following package (line 2585)

 
 
      package EffetClick_Open_TechnoTree is SEQ with
      [
 
            ~Push_Screen_TechnoTree~ is Template_PushEcran  :
               Ecran       = ~/Ecran_TechnoTree/Frame
               KeepContext = True
 
      ],
 

with Frame an instance of Template_DeclarationEcran

How to add components (buttons...) on the frame panel

Now that it is possible to access our frame, it is now time to add things on our empty frame. The simplest way to achieve this is to set a Panel as a son (Fils) to our instance of Template_DeclarationFrame und use this panel as a container for all the other components.

Basicaly, it should look this way :

 
 
 Frame is Template_DeclarationEcran :
   Fils = package MyMainPanel is Template_NewPanelVideWithFils :
             Fils = [
                       // put here
                       // all the components
                       // that you want to
                       // add to you frame
                    ]
 

Among the components that can be added to our frame we can have for example a Textured panel in order to create our Background, and some textured button for our Techno Tree.

How to customize your buttons

  • Let's create a textured button
 
 
MyTexturedButton is Template_BoutonWithTexture :
  Texture = 'MyDesiredTexture.tga'
  X = // at the desired x position
  Y = // at the desired y position
  BoutonApparence = // my desired button apparence
 
  • Let's specify the aspect of ou bouton

We would like to have an identical over state and down state appearance

 
 
export MyButtonAppearance is Template_BoutonApparenceSimple :
   PanelApparence_Up = $/typewarrior/AOW_InterfaceIngame_Cadre_Bouton_VertClair
   PanelApparence_Down = $/typewarrior/AOW_InterfaceIngame_Cadre_Bouton_VertClair
   PanelApparence_Plat = $/typewarrior/AOW_InterfaceIngame_Cadre_Bouton_Vert
   PanelApparence_Disable = $/typewarrior/AOW_InterfaceIngame_Cadre_Bouton_VertDisabled
   LabelApparence = $/typewarrior/AOW_NewFontIngame_Petite_Bold_LeftAligned 
 

How to create hints linked to the buttons

 
 
MyTexturedButton is Template_BoutonWithTexture :
  Texture = 'MyDesiredTexture.tga'
  X = // at the desired x position
  Y = // at the desired y position
  BoutonApparence = // my desired button apparence
  Hint = 'put here what you want to put as hint'
  HintApparence = MyHintAppearance
 

with MyHintAppearance an instance of Template_NewHintApparenceWithCadreRedimensionable