Store Mod Problem

Feel free to ask any question.
We hope that we can help you, as we are a german-speaking community.
Antworten
ekspresi
Beiträge: 5
Registriert: Di 17. Dez 2013, 22:05

Store Mod Problem

Beitrag von ekspresi »

Hi there once again,

I was thinking about modding some stuff in the game, just to make it easier for myself. So I started from adding an additional option to the Store to have an ability to store rings there. I'm not very good in any code work but after a few tried I got that kind-of-working. That's exacly what I've done:

1. Added new icon to Data/GUI/icons named _Ringen_einlagern.tga or Ringen_einlagern.tga. I haven't tested yet which one really works, but the game reads the file.

2. Edited techtreetunes.tcl from Data/Scripts/misc.
In Lager section I have changed:

Code: Alles auswählen

set tttitems_Lager					{_Kisten_einlagern _Nahrung_einlagern _Pilze_einlagern _Rohmineralien_einlagern _Mineralien_einlagern}
set tttpreinv_Lager					{_Kisten_einlagern _Nahrung_einlagern _Pilze_einlagern _Rohmineralien_einlagern _Mineralien_einlagern}
to

Code: Alles auswählen

set tttitems_Lager					{_Kisten_einlagern _Nahrung_einlagern _Pilze_einlagern _Rohmineralien_einlagern _Mineralien_einlagern _Ringen_einlagern}
set tttpreinv_Lager					{_Kisten_einlagern _Nahrung_einlagern _Pilze_einlagern _Rohmineralien_einlagern _Mineralien_einlagern _Ringen_einlagern}
Next thing, after this code:

Code: Alles auswählen

	"_Mineralien_einlagern" {						;// Werte sollten für alle Lager-Items gleich sein!
		set tttmaterial__Mineralien_einlagern		{}
		set tttinvent__Mineralien_einlagern			{}
		set tttgain__Mineralien_einlagern			{{exp_Transport 0.001}}
		set tttinfluence__Mineralien_einlagern		{{exp_Transport 1.0}}
	}
I have added something like this:

Code: Alles auswählen

"_Ringen_einlagern" {						;// Werte sollten für alle Lager-Items gleich sein!
		set tttmaterial__Ringen_einlagern		{}
		set tttinvent__Ringen_einlagern		{}
		set tttgain__Ringen_einlagern			{{exp_Transport 0.001}}
		set tttinfluence__Ringen_einlagern		{{exp_Transport 1.0}}
	}
to fit the pattern.

3. Edited LAGER.TCL in Data/Scripts/classes/work.
At the beggining, after other lines, which defines new classes, I added this:

Code: Alles auswählen

def_class _Ringen_einlagern							service material 1 {} {}
A little bit down from there, there's this line:

Code: Alles auswählen

global store_food store_boxes store_mushrooms store_minerals store_rawminerals store_misc storage_list current_worker current_itemtype
which I have changed to this:

Code: Alles auswählen

global store_food store_boxes store_mushrooms store_minerals store_rawminerals store_misc store_waepons store_rings storage_list current_worker current_itemtype
.

And then there're lines like this, written as a coment:

Code: Alles auswählen

/		if {[get_prod_slot_cnt this _Waffen_Werkzeug_und_Traenke_einlagern] != 0} {
/				set store_misc 1
/		}  else {
/				set store_misc 0
/		}
So I have added after this those lines:

Code: Alles auswählen

		if {[get_prod_slot_cnt this _Ringen_einlagern] != 0} {
				set store_rings 1
		}  else {
				set store_rings 0
		}
The next thing are classes of items to store:

Code: Alles auswählen

set classes "Grillpilz Grillhamster Pilzbrot Raupensuppe Raupenschleimkuchen Gourmetsuppe Hamstershake Bier Pilzstamm Pilzhut Eisenerz Golderz Kristallerz Eisen Gold Kristall Stein Kohle"
So I've changed that to this:

Code: Alles auswählen

set classes "Grillpilz Grillhamster Pilzbrot Raupensuppe Raupenschleimkuchen Gourmetsuppe Hamstershake Bier Pilzstamm Pilzhut Eisenerz Golderz Kristallerz Eisen Gold Kristall Stein Kohle Ring_Der_Erde Ring_Der_Luft Ring_Der_Magie Ring_Des_Feuers Ring_Des_Lebens Ring_Des_Wassers Ring_Des_Wissens"
And then there's:

Code: Alles auswählen

		set store_food   	   0	  ;// Nahrung lagern
		set store_boxes 	   0      ;// Kisten lagern
		set store_mushrooms    0      ;// Pilzstämme und -hüte lagern
		set store_rawminerals  0      ;// Eisenerz Golzerz Kristallerz
		set store_minerals     0	  ;// Stein Eisen Gold Kristall Kohle
		set store_misc		   0	  ;// Waffen, Werkzeug & Tränke
I've written below this line (I have given up with comentaries):

Code: Alles auswählen

set store_rings		   0	  ;// Waffen, Werkzeug & Tränke
After next few lines I have written

Code: Alles auswählen

set_prod_slot_cnt this _Ringen_einlagern 		0
Then, there's:

Code: Alles auswählen

			if {$store_rings} {
				lappend classes Ring_Der_Erde Ring_Der_Luft Ring_Der_Magie Ring_Des_Feuers Ring_Des_Lebens Ring_Des_Wassers Ring_Des_Wissens
			}	
after

Code: Alles auswählen

			if {$store_minerals} {
				lappend classes Eisen Gold Kristall Stein Kohle
			}
4. Finally, editted gen_tt.tcl in Data/Scripts/gameplay.

After:

Code: Alles auswählen

{
_Mineralien_einlagern service material 1 { }

// Materials
{}
// Tools
{{exp_Transport 1.0}}
// Places
{Lager}
// Attribs
{}
}
I have added:

Code: Alles auswählen

{
_Ringen_einlagern service material 1 { }

// Materials
{}
// Tools
{{exp_Transport 1.0}}
// Places
{Lager}
// Attribs
{}
}

Okay. There is no error while loading Wiggles. So when I'm in game, there's an icon in Store, which I created. But when I select it, nothing happens. Red bullet turns to green and no dwarf do anything with it. Could you help me with this?

Thanks in advance.
Benutzeravatar
cech12
Zwerg
Zwerg
Beiträge: 242
Registriert: Di 9. Jun 2015, 12:18
Kontaktdaten:

Re: Store Mod Problem

Beitrag von cech12 »

Hey ekspresi!

I know my answer comes very late. :D

You can find a way to modify the store in this post: viewtopic.php?f=10&t=27 (in german)

You can also use the "Lagerverbesserung"-Mod of the DigglesModManager (Github, Forum (german))

I hope this helps you!

Chris

Edit (18th April 2016):

Your code is very good:

1. You need a Ringen_einlagern.tga file. :)

2. looks right!

3. You added store_waepons to the global variables:

Code: Alles auswählen

global store_food store_boxes store_mushrooms store_minerals store_rawminerals store_misc store_waepons store_rings storage_list current_worker current_itemtype
That is wrong. So your line have to look like that:

Code: Alles auswählen

global store_food store_boxes store_mushrooms store_minerals store_rawminerals store_misc store_rings storage_list current_worker current_itemtype
The other code looks good.

4. The Data/Scripts/gameplay/gen_tt.tcl file is generated by the game itself. So you do not have to change something in this file.


After these changes you have to start a new game. In an old savegame the changes does not work.
Antworten