Lost Technology

Lost Technology

Zbyt mało ocen
Modding the .dat files
Autorstwa: Fii
This guide details the observations and tricks I have acquired from playing around with the unit and class .dat files. Most of these were obtained through experimental observation (ie. restarting the game alot) and may not be perfectly complete.
   
Przyznaj nagrodę
Ulubione
Ulubione
Usuń z ulubionych
General Modding Instructions
The .dat files can be found in Steam\steamapps\common\Lost Technology\LostTechnology\script\official folders. Create a backup of the original files before you start modding!

Important files to note:
\system\context.dat - contains general game constants (eg. maximum unit count, stack size)
\spot.dat - contains information of territories (eg. number of stacks allowed, income)
\power.dat - contains information of factions (eg. allowed units, identity of leader)
\class.dat - contains information of unit types (eg. cost, abilties, stats)
\unit.dat - contains information of heroes (eg. name, base unit type)

The main two .dat files this guide will focus on is the class.dat and unit.dat.

All .dat files can be opened in a text editor like notepad. I recommend notepad++.
// comments the line, the game will ignore this line when loading the file.

Saved games do not load edited .dat files, they appear to contain all the unit definitions in them so you will have to begin a new game to test any changes.
class.dat
This file contains the information of your generic units like human swordsmen, elf archers, etc.
As well as information on all the other stuff like neutral monsters, summons, some of the props (eg. gates)

The primary concerns are controlling unit recruitment and defining exp.

I will use the example unit "culverin" to illustrate my findings: (this appears around line 7600 in the class.dat file; search for "culverin" to jump to it)
class culverin : culverin_l { // name = 大砲 image = culverin w = 48 h = 32 sex = neuter movetype = wheel no_regular = on multi = 10, attack, defense, magdef, dext, 10, hp hp = 1000 attack = 100 defense = 100 magic = 0 magdef = 50 speed = 50 dext = 50 move = 50 consti = sword*6,lance*6,arrow*7,club*2, toxin*10,dark*10,poi*10, para*10, ill*10, conf*10, sil*10, stone*10, fear*10, suck*10, magsuck*10, drain*10, death*10 skill = cannon_culverin,longcannon_culverin break = ef_mechabom no_knock = on satellite = 32 no_cover = on }

This particular unit is the cannon that appears when fighting the neutrals in Port City Panchaea. It would be cool to have, right? However, if you just added culverin to the recruitment list of a hero (since no one starts with them), you'll find it either shows up red (ie. can't recruit) or doesn't appear at all.

Let's fix this unit.

To ensure the cannon can be recruited, its race and class needs to appear in the recruiting hero's staff and friend list. It's class must also be in the recruiting hero's merce list.

The first problem is apparent, the culverin is the class, but there is no race! Add:
race = human
to the definition. I put mine above the sex to keep things in roughly the relevant area.

Now your recruiting hero just needs to have:
staff = human,culverin friend = human,culverin merce = culverin
in order to recruit the cannon! (add the race and class to the ones the hero already has, refer to unit.dat section)

You'll also notice that the cannon cannot recruit more cannons (unlike other units). You need to add:
fkey = culverin
in order to do so.

But wait, you'll notice the cannon has 0 cost. So you'll have to decide a balanced price for your cannon unit. Add a:
price = 200
to make the cannon cost 200 to recruit. Adjust to taste.

If you go ahead and start using your cannon, you'll notice something interesting happen. After the cannon shoots something or otherwise levels up, its level will go straight to 100.
This happens because the exp required to level isn't given and defaults to 0. So your cannon needs 0 exp to level up.

Now, you can copy the human swordsman exp rate:
exp = 200 exp_mul = 120 exp_max = 0
but in practice this makes cannons hard to level. Their shot loads so slowly that it will be nearly impossible to level up. You can decrease this to exp = 50 and you might get something about balanced.

And now you have a cannon that doesn't look out of place among the rest of your units!


Now, later in the game, you might want to hire leveled cannons instead of new cannons starting at level 1. For this, you need to create a derivative class, call it culverin2.
class culverin2 : culverin2_l
Any properties you define inside it's {} block will override the normal cannon's, but otherwise, culverin2s will inherit everything from it's predecessor, so it will be very short.

Unit evolutions occurring at 10 level intervals are controlled by the change property.
eg. Human swordsmen have
change = hus2 * 10
I suspect but have not verified that the * 10 controls which level the evolution happens.
So add
change = culverin2 * 10
to the culverin class (not the culverin2 class!).

You should then add
level = 10
to the culverin2 class to make it's starting level 10, and
merce = culverin,culverin2_psc
to allow you to recruit culverin2s from other culverin2s. (otherwise the leveled cannon will not appear on the recruitment list) But culverin2_psc doesn't exist yet.

If you just put culverin2 in the merce property, culverin2 will have the same cost as culverin. So, you need another derivative of culverin2 to apply the usual cost increase.
class culverin2_psc : culverin2
in this block, culverin2_psc gets all its properites from culverin2. You then put price = 2000 in it and there you have it.

You can copy the pattern for further levels if you want, just refer to the hsc blocks (human swordsman, aka. enlistee)


Optionals and other interesting things
  • cost - Upkeep cost. This is shown in the drk1 class (dragon tamer, another fun unit to play with).
  • line - "front" or "back" controls the default frontline/backline setting.
  • consti - controls resistances to status effects and damage types. In units of 10%; sword*6 is 60% resistance to swords.
  • multi - controls statistic gain per level; preset "10, attack, defense, magdef, dext, 10, hp" gives 10 attack, defense, magdef, dext and 100 hp per level. If left blank, gains no stats per level!
  • member - controls the default stack that appears at game start.
    eg. if you added "member = culverin * 7" to the properties, changing z1s5 in spot.dat to have the property "member@sc1 = lars,meghnad,marguerite,crookes,culverin" will start Musket with 8 cannons. Note that this doesn't have to be the culverin class!
  • friend - controls what can be part of the stack of this unit.
    By default, is the same race and class. You can add other units to this, eg. adding
    friend= human,culverin,hsc1,hub1
    to your cannon will allow a cannon stack leader to be able to have human enlistee and bowman units in the stack. If you have the "fkey = culverin" property, not having culverin in friend property won't make a difference, but if you don't have the fkey property, cannons can have other cannons in the stack but can't recruit cannons.

To allow the culverin as a stack leader, you need to add the culverin class to the staff property in the power.dat file for your chosen faction.
Eg. in power reinald, having staff = human, hum1,emi1,emk1,culverin will allow you to have cannon stack leaders in reinald empire.
unit.dat
unit.dat controls definitions for specific units. Heroes.

Despite the difference, Heroes are basically just another class. Most of the class.dat properties will apply to heroes just as well.

In particular:
  • staff/friend - controls what is allowed in the stack
  • merce - controls what classes can be recruited
Staff and friend must have the race and the class, while merce must have the class but not the race. (if you put a race in merce, it'll show up as a red unrecruitable nameless, pictureless recruitment with 0 cost)

This controls both which heroes can be recruited and which units can be. You will note that this means any unit type a hero can recruit is also the unit type of roaming hero you can recruit with this.

Now, you can also add a hero's name to the friend property, this will then override all other requirements and allow you to recruit that specific hero to your faction using this one. (eg. Chromium has niccolum,mcgraw,hissssa and can recruit these heroes even if they're lizards)

Adding a hero's name to the staff property will allow that specific hero to be in this hero's stack regardless of other requirements. (eg. Stig is allowed to be in Gereon's stack even if he's not a priest)

Here's a probably complete list of all the race and classes that appears by race:
  • angel,anm1,ank1
  • human,hus1,hub1,hum1,hum1f,ghm1,pr1,huk1,drk1,dek1,pi1,rg1,rg1f,emi1,emk1,yo1,sam1,mu1,pom1,s_th1,s_elm1,s_lm1,s_mesho,s_doctor,s_pankration,s_fashiondesigner,s_bodybuilder
  • therianthrope,tas1,tam1
  • lizard,lis1,lim1
  • fairy,fyd1,fyd1f,fyw1,fyw1f
  • dwarf,dws1,dwm1,alm1
  • elf,elb1,els1
  • frog,frs1,frm1
  • devil,des1,dem1,ghm1
  • dragon,progenitor,ice_dragon1,red_dragon1,blue_dragon1,green_dragon1,black_dragon1,gold_dragon1,holy_dragon1
  • undead,ud_skeleton1,ud_zombie1,ud_ghost1,ud_vampire1,ud_lich,ud_drg_s,ud_drg_g,ud_drg_z
  • monster,s_slug1,s_snake,beast,wild_wolf,hound_dog,wild_squid,wild_moffle,wild_frog,wild_turtle,wild_fish,wild_eel,wild_flower_r,wild_flower_y,wild_flower_b,cockatrice,cyclops,giant,snowman,griffin
  • element,el_fire1,el_water1,el_earth1,el_air1,el_light1,el_dark1,el_sonic1,el_snow1,el_lightning1,el_golem1,el_slime1,el_guardian1,el_chess1,el_chess2,el_chess3,el_chess4,el_chess5,el_grisguris1
  • chimera,chi1
  • mail,mai1
  • mecha_sc1,mecha_sol1,mecha_ac

As a single block you can copy and paste:
in staff & friends
angel,anm1,ank1,human,hus1,hub1,hum1,hum1f,ghm1,pr1,huk1,drk1,dek1,pi1,rg1,rg1f,emi1,emk1,yo1,sam1,mu1,pom1,s_th1,s_elm1,s_lm1,s_mesho,s_doctor,s_pankration,s_fashiondesigner,s_bodybuilder,therianthrope,tas1,tam1,lizard,lis1,lim1,fairy,fyd1,fyd1f,fyw1,fyw1f,dwarf,dws1,dwm1,alm1,elf,elb1,els1,frog,frs1,frm1,devil,des1,dem1,ghm1,dragon,progenitor,ice_dragon1,red_dragon1,blue_dragon1,green_dragon1,black_dragon1,gold_dragon1,holy_dragon1,undead,ud_skeleton1,ud_zombie1,ud_ghost1,ud_vampire1,ud_lich,ud_drg_s,ud_drg_g,ud_drg_z,monster,s_slug1,s_snake,beast,wild_wolf,hound_dog,wild_squid,wild_moffle,wild_frog,wild_turtle,wild_fish,wild_eel,wild_flower_r,wild_flower_y,wild_flower_b,cockatrice,cyclops,giant,snowman,griffin,element,el_fire1,el_water1,el_earth1,el_air1,el_light1,el_dark1,el_sonic1,el_snow1,el_lightning1,el_golem1,el_slime1,el_guardian1,el_chess1,el_chess2,el_chess3,el_chess4,el_chess5,el_grisguris1,chimera,chi1,mail,mai1,mecha_sc1,mecha_sol1,mecha_ac

and in merce
anm1,ank1,s_th1,s_elm1,s_lm1,pom1,hus1,hub1,hum1,hum1f,ghm1,pr1,huk1,drk1,dek1,pi1,rg1,rg1f,emi1,emk1,yo1,sam1,mu1,tas1,tam1,lis1,lim1,fyd1,fyd1f,fyw1,fyw1f,dws1,dwm1,alm1,elb1,els1,frs1,frm1,des1,dem1,ghm1,ud_skeleton1,ud_zombie1,ud_ghost1,ud_vampire1,ud_lich,ud_drg_s,ud_drg_g,ud_drg_z,s_slug1,s_snake,chi1,mai1,progenitor,ice_dragon1,red_dragon1,blue_dragon1,green_dragon1,black_dragon1,gold_dragon1,holy_dragon1,wild_wolf,hound_dog,wild_squid,wild_moffle,wild_frog,wild_turtle,wild_fish,wild_eel,wild_flower_r,wild_flower_y,wild_flower_b,cockatrice,cyclops,giant,snowman,griffin,el_fire1,el_water1,el_earth1,el_air1,el_light1,el_dark1,el_sonic1,el_snow1,el_lightning1,el_golem1,el_slime1,el_guardian1,el_chess1,el_chess2,el_chess3,el_chess4,el_chess5,el_grisguris1,chi1,mai1,mecha_sc1,mecha_sol1,mecha_ac

This will let that hero recruit all other heroes (except for defined enemies) and every single unit in the game that can be recruited. This is in no way balanced, especially the units as the monsters have no leveled versions and elementals have 0 cost. Progenitor costs 1 million and has no skills (!!).

Optionals
  • level@sc1 - controls the level at the start of the game
  • learn - controls the level at which skills are gained; note that skills in each line are replaced by the next
  • diplomacy - a value of "off" means that if you roam and establish a faction with this hero, you cannot conduct diplomacy; delete to remove this
  • loyal - the hero's name in this property must be recruited first before this hero can be recruited
    I have no idea what happens if you put a generic unit in here but it should apply accordingly (you need that unit to recruit)
  • enemy - if your leader is the given value, you cannot recruit this hero
  • leader_skill - listed skills, if known, will be given to all units in the stack if this hero is the stack leader
  • delskill - this hero does not have the listed skills

Weird Stuff
Adding a hero's name to the merce property allows you to recruit multiple copies of that hero as if they were a generic unit (!), and each of those copies act like a vassal equivalent.
Eg. adding ephemeral to her own merce property allows her to recruit herself. These copies behave exacty like any other vassal, including lack of training when idle, battle speeches, retreating instead of dying when killed in combat, etc.
They will not be faction leaders even if they are the same unit.

You can also add weird stuff like the s_mesho,s_doctor,s_pankration,s_fashiondesigner,s_bodybuilder to merce property, which will sometimes give you imageless units or skillless units.
Komentarzy: 4
Muffintopwarrior 29 sierpnia 2021 o 20:35 
Really nice guide, I had been curious about modding this game, thanks for the help.
MainTerranGallian 6 lipca 2021 o 1:07 
wait.. now it keeps crashing everytime i do battle with it?
MainTerranGallian 6 lipca 2021 o 0:26 
nvm found it
MainTerranGallian 6 lipca 2021 o 0:20 
im getting an error around culverin2_psc?