• 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.

HandsOn

I do agree with Chrisim - it is indeed the best thing since buttered bread (or was that breaded butter?). Anyway, I totally love the idea, but I do have one tiny problem: it's called "my brain". Because this little used grey mass between my ears hurts when I try to understand the read-me. It does assume a fair bit of prior knowledge which - unfortunately - I don't have. I've asked the master of ceremonial tutorials, Diggis, to write one for simpletons like myself, but he's perchance busy with the rest of his rugby life. Thus my question: could you elaborate the document a bit? Like what ID's for what; what are the pitfalls, if any; that sort of thing.

Much obliged..


Why not visit The Empire MD
Just updated on July 2nd, 2008
And after the game's done.. - The Storyteller's Logbook

Diggis

It think if you read the top of the readme it does point out that this is a medium level Modding excercise.  :thumbsup:

I will endeavor to write a version for dummies, as it were, but it will still require familiarity with the readme.

HandsOn

Quote from: Diggis on May 22, 2008, 08:24:29 AM
It think if you read the top of the readme it does point out that this is a medium level Modding excercise.  :thumbsup:

I will endeavor to write a version for dummies, as it were, but it will still require familiarity with the readme.
Back from the pub, eh?  ;D

Jokes aside, thanks, Diggis; it'll be a while before I get to "medium" - I'll have to pass "beginner" first..


Why not visit The Empire MD
Just updated on July 2nd, 2008
And after the game's done.. - The Storyteller's Logbook

daeley

Quote from: Chrisim on May 22, 2008, 06:52:25 AM
Dear Dealey,
your custom submenus system is fantastic - it can make it so much easier to select custom content and I had no problem so far  :)
I used the Reader to look and understand the system - and I can tell that it is a masterpiece &apls
The most significant achievement for SC4 custom gameplay for years, just next to the NAM. Thank you!  :)
However, there is still much work to be done to get the custom submenu system working for much more sets.

I downloaded the developer tool kit and read your tutorial, but I haven't tried generating new submenues yet.
Obviously, the customMenu.dat is the main "controller" LUA file for all folders (the main sub menu and sub-sub menues).
And each menu file like JRJ Modular Zoo.dat contains a LUA file that does reference the main LUA file. Clever!

I have a few questions:
Translations. It is easy to add more LTEXT (just changing the GID in the usual way). But much text is inside the LUA files. Do we have to create a LUA file for each language or can you use constants inside LUA that are defined in a central language file?

Is the main menu structure (Recreation, ..., Air) and the first level submenu final?
Example: for Transport, there are only two submenues: public transport and others
I would create one submenu for each type of network, e.g., train lots, ..., bus stops, ..., GLR stations, ...
If you ask 100 persons, you would get 200 opinions how to structure it.  ;)
Everybody could in principle create a personal version of customMenu.dat, but in order to get one system (to which everybody can contribute), you (or the BSC) may probably want to keep ownership of this main controller and update it from time to time?

Are you going to create a (high level) visible forum thread with a list of existing sets, where contributors can tell which sets they are working on (to avoid duplicate work)? New files, shall they be attached inside such a thread? A publication of single files on the LEX would not make much sense, but a regular LEX publication of all available sets would then be useful. What's the strategy?

question 1: Everything in LTEXT's can be translated the usual way. This is limited to the description messages. The item and menu titles, and info[1] and info[2] messages can't be translated this way and are coded into LUA. If you would want everything translated including the menu titles etc, you would have to create a different version of the code.

question 2: The base menu structure can be changed, but I would recommend leaving it as it is. We have thouroughly discussed it (and as you say, every person has a different opinion) and as it is now seemed to be a good compromise. Stuff such as train, GLR etc can be put inside the transport menu, so you get menu's like Home > Transport > Public Transport > GLR Station sets > ..." In theort the menu depth is unlimited. For compatibility between users, the idea is that the main controller is the same for everyone.

HandsOn: If you think this version is difficult, you should've seen the first one... it didn't even have a button cutter or code generator  :shocked2:
1. Install SC4+RH
2. Install LEX (CD&DVD helps) and latest NAM + updates
3. Play the game
4. ? ? ? ?
5. Profit!

Diggis

Quote from: daeley on May 23, 2008, 08:06:25 AM
question 1: Everything in LTEXT's can be translated the usual way. This is limited to the description messages. The item and menu titles, and info[1] and info[2] messages can't be translated this way and are coded into LUA. If you would want everything translated including the menu titles etc, you would have to create a different version of the code.

question 2: The base menu structure can be changed, but I would recommend leaving it as it is. We have thouroughly discussed it (and as you say, every person has a different opinion) and as it is now seemed to be a good compromise. Stuff such as train, GLR etc can be put inside the transport menu, so you get menu's like Home > Transport > Public Transport > GLR Station sets > ..." In theort the menu depth is unlimited. For compatibility between users, the idea is that the main controller is the same for everyone.

HandsOn: If you think this version is difficult, you should've seen the first one... it didn't even have a button cutter or code generator  :shocked2:

I can vouch for that.  :angrymore:

HandsOn

Quote from: Diggis on May 23, 2008, 08:17:59 AM
I can vouch for that.  :angrymore:
No need, Diggis, I do program thus know about my betas and alphas. Where my understanding is still hapazard, partially because the explanations are so fractured over various sites buried in different tutroials and fori, is the relationship between files and parameters in SC4. It's like Betty-May's family in the Ozarks! LUA this, T21 that, exemplars that exemplify and exemplars that simply don't, and let's not forget the LD, 3D, DDT, and the meeting at the PTA!

Aargh, now my head hurts again - mother said I shouldn't be thinking about it AND play with the axe..  &cry2


Why not visit The Empire MD
Just updated on July 2nd, 2008
And after the game's done.. - The Storyteller's Logbook

Andreas

Quote from: daeley on May 23, 2008, 08:06:25 AM
question 1: Everything in LTEXT's can be translated the usual way. This is limited to the description messages. The item and menu titles, and info[1] and info[2] messages can't be translated this way and are coded into LUA. If you would want everything translated including the menu titles etc, you would have to create a different version of the code.

Well, thankfully, it looks like you can use unicode in LUA code (as you can do in Item Name properties and the like), so it's possible to use accented characters. I still didn't had the time for a closer look, but I assume that we could distribute a special German base set at SimCityKurier that has the proper translations embedded into the code. :)
Andreas

CasperVg

By the way, because you need to have info 'pop-up' setting on, does this mean you will also have the obnoxious pop-ups for information/reward unlocks? If so, is there a fix for making those not appear, while the Custom Submenu System would still work?
Follow my SimCity 4 Let's play on YouTube

daeley

Quote from: Andreas on May 23, 2008, 08:48:08 AM
Well, thankfully, it looks like you can use unicode in LUA code (as you can do in Item Name properties and the like), so it's possible to use accented characters. I still didn't had the time for a closer look, but I assume that we could distribute a special German base set at SimCityKurier that has the proper translations embedded into the code. :)

for example, such a thing could be done. However you would have to take care to install all menu addons in german as well. If you install an english addon with a german base controller, the addon will create new english menu's for itself.

I will have a look if there's an easy way around this.

Quote from: caspervg on May 23, 2008, 08:52:02 AM
By the way, because you need to have info 'pop-up' setting on, does this mean you will also have the obnoxious pop-ups for information/reward unlocks? If so, is there a fix for making those not appear, while the Custom Submenu System would still work?

I never saw them as obnoxious so I never bothered to check... I'll see what I can do
1. Install SC4+RH
2. Install LEX (CD&DVD helps) and latest NAM + updates
3. Play the game
4. ? ? ? ?
5. Profit!

Andreas

Quote from: daeley on May 23, 2008, 02:32:01 PM
However you would have to take care to install all menu addons in german as well. If you install an english addon with a german base controller, the addon will create new english menu's for itself.

Well, there's always the problem that foreign lots will have English (or any other foreign language) names and descriptions, so I guess non-English players are used to that. From all languages, I assume the German fans have the largest selection of lots that got translated, and obviously, German addons could be released as well.
Andreas

Chrisim

Translations - I translated the main file to German and played it together with an English addon file. As you said, Daeley, the english addon created an english main menu entry itself below the German main menu entries.
Is there a way to prevent this and keep things more consistent? Presently your system does reference menus by linknames that are also displayed in the menus.  Would it be possible to separate link and displayed text, by using an ID (a Daeley ID: DID ;) )? Such a system would permit localized main menues and international addons to work together.

daeley

well, while I could do something like that, it would make it slightly harder to develop files and build add-ons. Right now, if you see a menu called "Transport", you just use "transport" to add to that menu, no problem. With that system, you'd have to look up the id. Also, typing errors are generally easier to spot then id errors (I think). It's all not a big difference, I know, but I've been trying very hard to pinch off every minute needed to develop additional DAMN's and still there's only one person (thank you Diggis) who has done any.
1. Install SC4+RH
2. Install LEX (CD&DVD helps) and latest NAM + updates
3. Play the game
4. ? ? ? ?
5. Profit!

Jonathan

Thanks Daeley for helping with the PID, I tried that and it worked so thanks :)

I tried making another set but I couldn't get it to work although I think I know why now.

Just wondering if you could get the LUA to "know" where the dat they are in is. So it would be possible to have a DAMN folder and then you just add folders for more menus?

daeley

Quote from: Warrior on May 25, 2008, 03:09:26 AM
Just wondering if you could get the LUA to "know" where the dat they are in is. So it would be possible to have a DAMN folder and then you just add folders for more menus?

not really sure if I understand what you mean bacause I think what you mean is already possible :) they don't really need to know where they are to work, you can put them anywhere. Even the order in which the game loads them shouldn't matter.
1. Install SC4+RH
2. Install LEX (CD&DVD helps) and latest NAM + updates
3. Play the game
4. ? ? ? ?
5. Profit!

Jonathan

#194
I mean depending where you put them in your plugins folder, they will show up in the custom menus.

So if you had a tram station and wanted it in the custom menu: Transport/GLR

You'd have some folder in your plugins like this:

Plugins
  DAMN
   Transport
     GLR
      Tram Station.dat
     Public Transport
     Other
And the LUA would know automatically where to put the tram station in custom menus.

daeley

hmm, that's actually not a bad idea... will have to check out the possibilities!
1. Install SC4+RH
2. Install LEX (CD&DVD helps) and latest NAM + updates
3. Play the game
4. ? ? ? ?
5. Profit!

Chrisim

Quote from: daeley on May 25, 2008, 02:43:15 AM
well, while I could do something like that, it would make it slightly harder to develop files and build add-ons. Right now, if you see a menu called "Transport", you just use "transport" to add to that menu, no problem. With that system, you'd have to look up the id.
Not if you use text as ID. This is what I had tried:
From my translated German customMenu.dat:
local culture    = DAMenu.addMenu(DAMenu,"Kultur")
   local cultural  = DAMenu.addMenu(culture,"Bildung")
   local religious = DAMenu.addMenu(culture,"Religion")

Then, the English addon tested:
local menu = DAMenu.findItem("Culture/Cultural/Jeronij's Modular Zoo & Aquarium")
if (menu == nil) then
...

and it created an additional main menu.
If the English addon would test for "culture" and "cultural" instead of "Culture/...", it should work. Unless I oversee an argument ...

daeley

well, that's not as easy as you say, because those are just variable names and they're not actually stored anywhere.

I think I'm going to have a look at Warrior's idea, that would solve some of the translation problem as well.
1. Install SC4+RH
2. Install LEX (CD&DVD helps) and latest NAM + updates
3. Play the game
4. ? ? ? ?
5. Profit!

Diggis

I'd have to say Warriors idea was brilliant. As part of that the final menu title could be the file name.  Although that would mean you can't add new sets to an existing menu like you could if you used just the folder structure.

JoeST

so if i get you... you are going to see if you can use the LOT file as a placer in the folder structure it is placed in... nice idea

or is it going to be some extra file you have to use for each lot/set? that are then arranged in the directory structure?

Joe
Copperminds and Cuddleswarms