• Welcome to SC4 Devotion Forum Archives.

DAMN Development Thread (formerly known as "Custom Submenus")

Started by daeley, November 12, 2007, 02:28:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jackal22

this will be sooo good you cant imagine how badly my scroll finger is looking forward to this.

and it seems your finally getting those advisers to do something worth while, pitty you couldn't have used the environmental kill all factories woman.

powerpill-pacman

 &apls I'm so looking forward to this (allthough it won't change the loading time ;)). Thanks very much for your efforts.

GoaSkin

I am studying actually the assembler code of the game to find out how to add new standard IDs - meaning to find out if there are unused submenukeys and/or occupant groups that are handled by menu classes (button IDs in the UIs) that are also unknown.

Well... there isn't any hidden occupant group or submenukey but two empty CLSIDs for new tertiary menus in the traffic menus.

I found also out what changes on the binary are necessary to implement new menus. But I don't know how to make use of it.

Does any body know how to strip out symbols of an EXE and link them to a DLL? That makes enhancing the assembler code quite easier.
download SC4Config public BETA (RC1)

powerpill-pacman

Not that i understand very much of whar you're saying, but it sounds promising. I hope somebody can help you.

daeley

1. Install SC4+RH
2. Install LEX (CD&DVD helps) and latest NAM + updates
3. Play the game
4. ? ? ? ?
5. Profit!

figui

#45
%BUd% %BUd%
lovely!
&bis&

mauricio.

(1/4 thousand posts!)
first forums inhabitant from Uruguay..   first forums citizen from Uruguay..  first forums councilman from Uruguay..   first forums mayor from Uruguay..  first forums governor from Uruguay..
...i'm still the only one from Uruguay!

________

Filasimo

thats pretty sick daeley keep pumpin em teasers out  :thumbsup:
Plaza Mall Project
http://sc4devotion.com/forums/index.php?topic=2171.0
Coming Soon to the LEX!

NAM Team
What can NAM do for you?
//

bwatterud

Look what you've done daeley.  You just put diggis out of a job.   :D

Just wondering, how does the program (or whatever it is) know what lots are part of what set (I know its not important as long as it works, but I'm curious?  And if someone released a new set of canals/seawalls/anything that would be considered a set, would this have to be updated?

GoaSkin

#48
I will explain a little bit about the submenu mechanisms in the game. At first, there are three menu levels:

primary menus: first menu instance (f.e. godmode, mayor and mysim)
secondary menus: submenus right beside the primaries (buildings, terrain tools)
tertiary menus: everything that contains tools or buildings as scrollable lists of icons

Implemented in the game is one additional secondary menu called fences menu. I have not figured out yet if it is possible to make use of it. But to get more space for buildings, the tertiary menu algotitm is more interesting.

Bound to the button click event of any UI button ID, the following function is called:


cSC4View3DWin::HandleButtonActivated(cIGZWin*, cGZMessage&)


The first parameter contains the address of the parent game window and the second a structure of delivered parameters (here there only may interest us the CLSID set in the UI the button links to). Because UI button IDs have very different functions from submenus over game speed to sound settings, the function checks the function this button belongs to. It forces different function calls referenced by the button ID. If a tertiary menu should be opened that only can contain buildings (identified by an occupant group), the function


cSC4View3DWin::CreateBuildingMenu(unsigned long, std::set<unsigned long, \
std::less<unsigned long>,std::allocator<unsigned long> > \
const&, std::set<unsigned long, std::less<unsigned long>, \
std::allocator<unsigned long> > const&, unsigned long, long)


is called and anyhow, the necessary parameters are either transmitted staticly or as result of a function call. For example the valid occupant groups for that menu are delivered here. This function identifies additional information from the building exemplars and finally calls


cSC4View3DWin::InvokeTertiaryMenu(unsigned long, cIGZWin*, \
unsigned long, cISC4WinCatalogView*, unsigned long, cSC4View3DWin::CatalogState*)


The final function illustrates (paints) the menu widget. For special menus where tools are allowed (networks, zones or other functions), the button handling function calls a META function first. For example, there are:


cSC4View3DWin::DoTransportMenu(cIGZWin*, cGZMessage&)
cSC4View3DWin::DoZoningMenu(cIGZWin*, cGZMessage&)


These functions assign SubMenuKeys for tool exemplars (used in non-building item exemplars to identify the menu to be placed in...) to the button-IDs and link buttons in the secondary menus that directly call a game function instead of a item list to their destination functions.
These functions do some extra steps for these special menus and call at last CreateBuildingMenu too.

Well... theoretically it is easy to understand what extra assembler instructions in the EXE make as many submenus as we want possible. The bad side is that I have no idea how to replace existing objects with enhanced versions (or how to knock out a single symbol into a working DLL).






download SC4Config public BETA (RC1)

SimRabbit123

How will this work? Will you have to query a lot to open up the subemenus?

Thanks  ;)

vester

GoaSkin: I know the title of the thread is Custom Submenus, but still....

this is Daeleys thread, showcasing his work. Please open up a new thread for your project.

GoaSkin

Vester: I do not have any concrete project. This is actually just knowledge.
download SC4Config public BETA (RC1)

vester

Still not sure this is the right place to post it.

Meastro444

maybe it is Vester....

it might be helpful knowledge to dealey.

anyway, i like this project very much, but i do have a few questions.

has it the same 'bug' as the MML's, that you have to plop the building and then reselect it or not?
if i plop one lot, will the menu go away so i have to reselect it, or wil the menu stay?
Friend of the Certified Drama Queen :)

Serkanner

I agree with Vester that, although very interesting, the info provided by GoaSkin should be posted in a separate topic and as such doesn't take away any of the attention to Daeley's current work on the menu mod.

jeronij

I would suggest Goaskin to open a separate thread because this information would be easilier availble in such a thread, and more useful. I dont think this information will disturb Daeley's engineer mind in any way  $%Grinno$% ;)

I am currently not active - Please, contact Tarkus for any site related matter. Thanks for enjoying SC4D :D


Autism Awareness;  A Father Shares
Mallorca My Mayor Diary


FromTheAshes

#56
What about colecting thousands of signatures and write an open letter to Maxis which says, that we -the SC4 comunity- would appreciate a patch or something that allows you to build your own menus in a small editor? Maybe they got the time to do this... :D

EDIT: Cross out those lines beyond. I didn't see the menu browser. Ingenious &apls
Visit Vorsfelde.

GoaSkin

...because thousands of signatures go to someone at Maxis but the change that it is forwarded to the right person is very small. There are better changes if you meet a developer on any computer fair.

With this code-hacking I am currently asking in coders forums for help. I think no one can help here so details may not be discussed at SC4Devotion. I asked for help in all known SC4 forums but nobody can help. I am looking for help in developer forums now.

download SC4Config public BETA (RC1)

jeronij

#58
Our community has not that many professional programmers atm  ::) , but I hope that in due time some more will arrive to us. In the meantime I wish you the best luck in your search and I hope you can get fruitful results soon  ;)

Now back to topic. Daeley, please, keep us updated  :thumbsup:
I am currently not active - Please, contact Tarkus for any site related matter. Thanks for enjoying SC4D :D


Autism Awareness;  A Father Shares
Mallorca My Mayor Diary


daeley

#59
Quote from: Meastro444 on November 29, 2007, 09:32:23 AM
has it the same 'bug' as the MML's, that you have to plop the building and then reselect it or not?
if i plop one lot, will the menu go away so i have to reselect it, or wil the menu stay?

nope :thumbsup: one you select you can plop away to your heart's delight  :satisfied:

And to answer another question, lots are not automatically detected by this mod, however the process of adding lots to the menu system is not very complicated. Once the internals are finalised (and I'm almost there), we will start adding some existing sets to this system (probably replacing some MML's in the process).
1. Install SC4+RH
2. Install LEX (CD&DVD helps) and latest NAM + updates
3. Play the game
4. ? ? ? ?
5. Profit!