Store Mod Problem
Verfasst: Mi 8. Jan 2014, 14:20
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:
to
Next thing, after this code:
I have added something like this:
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:
A little bit down from there, there's this line:
which I have changed to this:
.
And then there're lines like this, written as a coment:
So I have added after this those lines:
The next thing are classes of items to store:
So I've changed that to this:
And then there's:
I've written below this line (I have given up with comentaries):
After next few lines I have written
Then, there's:
after
4. Finally, editted gen_tt.tcl in Data/Scripts/gameplay.
After:
I have added:
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.
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}
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}
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}}
}
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}}
}
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 {} {}
Code: Alles auswählen
global store_food store_boxes store_mushrooms store_minerals store_rawminerals store_misc storage_list current_worker current_itemtype
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
/ }
Code: Alles auswählen
if {[get_prod_slot_cnt this _Ringen_einlagern] != 0} {
set store_rings 1
} else {
set store_rings 0
}
Code: Alles auswählen
set classes "Grillpilz Grillhamster Pilzbrot Raupensuppe Raupenschleimkuchen Gourmetsuppe Hamstershake Bier Pilzstamm Pilzhut Eisenerz Golderz Kristallerz Eisen Gold Kristall Stein Kohle"
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"
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
Code: Alles auswählen
set store_rings 0 ;// Waffen, Werkzeug & Tränke
Code: Alles auswählen
set_prod_slot_cnt this _Ringen_einlagern 0
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
}
Code: Alles auswählen
if {$store_minerals} {
lappend classes Eisen Gold Kristall Stein Kohle
}
After:
Code: Alles auswählen
{
_Mineralien_einlagern service material 1 { }
// Materials
{}
// Tools
{{exp_Transport 1.0}}
// Places
{Lager}
// Attribs
{}
}
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.