Jump to content
Karybdis

DISCOVERY: File Formats, The Scripting Formats (UI, and LUA)

33 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online: A long, long time ago... 
 

here is a completed list of GZ widgets including some supported but never used ones:



GZWinCtrlMgr

GZWinIMEServer

GZWinIMEProxy

GZWinIMEComposition

GZWinIMECandidateList

GZWinGenTitleBar

GZWinGen

GZWinGrid

GZWinTextEdit

GZWinListBox

GZWinLineInput

GZWinSpinner

GZWinScrollbar

GZWinSlider

GZWinOptGrp

GZWinText

GZWinBtn

GZWinFlatRect

GZWinFileBrowser

GZWinCombo

GZWinBMP

GZWinGenDlg

GZWinFolderRow

GZWinFolders

GZWinTextTicker

GZWinOutline

GZWinPieMenu

GZWinTreeView

GZWinMsgBox

GZWinToolTip

GZWinDlg

GZWinCustom

GZWinHTML

GZWinMgrBase

GZWinLuaScriptConsole

GZWinLuaScriptView

GZWinLuaScriptViewGeneral

GZWinSpyMessageFilter

GZWinSpyMessageFilterBreak

GZWinProcSpyMessages

GZWinProcShowProperties

GZWinProcSpy

GZWinSpyHotKeyFilter

GZWinScrollbar2

GZWinKnob

GZWinDragAndDropManager

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Reposting the 2nd post by Karybdis, which was heavily truncated in the crash May 2008:


Originally posted by: Karybdis LUA's as mentioned before are divided into 4 subcategories so far. Each category covers a different non-system type of the script language. System types (IE files utilizing much of the LUA language) are simply covered by the LUA reference book in the mod area. (File #'s 15261,4150,17212,29202,29752 that I know of) and Misc LUAs include only simple lua commands like Dofile.

Advisor LUA's describe all advisor messages that appear in the game. Maxis was helpful enough to describe the specification for these types of files in detail. Presumably for other Maxis workers making files of their own. The Spec follows.

----

-----------------------------------------------------------------------------------------------

Conventions and other information on advisor scrips.

------------------------------------------------------------------------------------------------

-----------------------------------

-- Files ---------------------------

adv_.lua

Files holding advice messages for particular advisor or advice category.

adv_const.lua

File holding various game constants.

adv_game_data.lua

Files holding simulation variables and functions exposed to LUA.

-----------------------------------------------------

-- Naming conventions ---------------------------

1. All names but constants have to be lower case : 'game_events'.

2. Names of constants are upper case : 'game_events.NEW_CITY'

---------------------------------------------

-- Text tokens ---------------------------

Format for all text tokens is #token name#. Tokens are replaced by the game with appropriate strings. All predefined tokens have to be in lower case. Here is a list of predefined tokens you can use:

#city# -- City name.

#mayor# -- Mayor's name.

#population# -- The population count.

#year# -- Current year.

Aside from predefined tokens you can use tokens made of LUA code

#game.g_population# -- will be replaced with population count.

#game . g_police_funding_p# -- will be replaced police funding percentage.

For LUA tokens you might need to use one of the token type tags

m@ -- for money amounts.

d@ -- for dates.

t@ -- for time.

n@ -- for numbers (optional). This is also the default type tag.

s@ -- for strings (optional).

For instance # m@ game . g_budget# will be replaced with the value of total city budget variable. Type tags are needed for lacalization purposes.

Here is the list of predefined advice specific tokens

#advisor# -- The name of the advisor the message belongs to.

#link_id# -- Every advice link has to beging with token as its prefix (read more on Links).

The list of predefined neighbor deal specific tokens

#nd_city# -- The name of neighbor city.

#nd_cost# -- Deal cost (monthly)

#nd_amount# -- Deal amount (monthly)

The list of predefined reward building specific tokens

#building_initial_cost# -- The plop cost that the reward building.

#building_monthly_cost# -- Monthly cost that that reward building important for buisness deal buildings.

This list will be updated as new tokens being added.

---------------------------------------------

-- HTML links ---------------------------

The links are used by the advisor system for performing game specific actions. Usually the link will be edited in the HTML editor. After that, however you will have to go and update it to accomodate for appliation needs. Your final version of a link has to look something like this


Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Reposting DarkMatter's post from the first page, which was truncated in the crash May 2008:


Originally posted by: DarkMatter
Here is an updated spec with more detailed information and info on enumeration values.
 
SimCity 4 UI Definition Files

=============================

SimCity 4 defines all of its user interface elements, or UI elements, through a text-based file

similar to XML. SimCity 4 UI's are composed of legacy tags, which contain attributes defining

the type of element, its look and behavior, etc. Legacies can have children, which contain more

legacy tags defining child elements. SC4 UI files are not valid XML, but are very similar. The

differentes between UI files and XML are as follows:

1) In a UI file, a comment is denoted by a # at the beginning of a line. 

In XML, a comment is denoted by a tag, contstruted as so:

2) In a UI file, legacy tags are not properly terminated. They have no closing tag or

terminating bracket. UI LEGACY tags are simply closed by a >.

In XML, a tag must be terminated in one of the two following ways:

or

3) In a UI file, there is no root tag. There may be more than one LEGACY tag at the root level:

In XML, you can only have one root element. The above code is invalid in XML, but this code 

would work:

 

   

     

   

   

 

4) Attributes in a UI file are never bounded by quotes:

In XML, attributes must be bounded by quotes:

The differences between XML and UI files poses a bit of a challenge, as a custom parser must be 

written to handle UI code, or a preparation parser must be written to convert UI code into

valid XML. Once an UI file is valid XML, any normal XML parser should be able to generate a DOM

in memory out of the UI code.

UI Classes

-------------

SC4 UI files define user interface elements. This is done through attributes contained in 

LEGACY tags. The possible number of attributes is quite large, but not all attributes will

always be used. First and foremost are the clsid, iid, and id attributes. These all define what

kind of element a LEGACY tag is defining. Below is a list of known class id values for UI

elements (this is the class id enumeration):

Class ID Description

--------------- -----------------------------------------------

GZWinGen  Defines a UI window. This is a container control.

GZWinText  Defines a simple text label.

GZWinTextEdit  Defines a text edit box.

GZWinBtn  Defines a push button.

GZWinBmp  Defines a bitmap image.

GZWinCustom  Defines a custom control.

GZWinGrid  Defines a grid control.

GZWinFlatRect  Defines a rectangle.

GZWinSlider  Defines a slider control. (Like school capacity)

GZWinCombo  Defines a combo selection control.

GZWinListBox  Defines a listbox selection control.

GZWinTreeView  Defines a treeview control.

GZWinSpinner  Defines a spinner control. (Like tax adjusters)

GZWinOutline  Defines an outline.

GZWinScrollbar  Defines a scrollbar.

UI Attributes

-------------

Attribute 	Type  		Description

-------

Share this post


Link to post
Share on other sites

Sign In or register to comment...

To comment in reply, you must be a community member

Sign In  

Already have an account? Sign in here.

Sign In Now

Create an Account  

Sign up to join our friendly community. It's easy!  

Register a New Account


  • Recently Browsing   0 members

    No registered users viewing this page.

×

Thank You for the Continued Support!

Simtropolis depends on donations to fund site maintenance costs.
Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

Make a Donation, Get a Gift!

Expand your city with the best from the Simtropolis Exchange.
Make a Donation and get one or all three discs today!

STEX Collections

By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

Each donation helps keep Simtropolis online, open and free!

Thank you for reading and enjoy the site!

More About STEX Collections