Omerta Modding Options
#61
It's possible to do almost anything with data in single player, yes.

And be careful what you wish for, I have a lot of evidence which suggests the engine won't scale upwards nicely -- with good reason, the entity count will explode as I expand outwards. Even testing a fairly lightly populated map yields a lot of overload I wasn't prepared for, even after similar experiments with T4.
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#62
I'm having trouble with renaming characters, I seem to be changing vital information instead (in English.HPK) which causes immediate crashes, with weapons I knew what to change, but with character names I'm not so sure.

EDIT: It's mainly the character descriptions that keeps failing me, maybe because I have to replace all of them at once.
Reply
#63
How are you replacing them?
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#64
(06-02-2013, 02:05 AM)Swixel Wrote: How are you replacing them?

My brother asked me to change Walker into Notorious B.I.G. (for obvious reasons) and I did manage to change the name but as soon as I started to change their Bio, crashes.

It's a lot of text, will remove it after it's read. This is from Game.cvs opened with notepad.

I replaced:

<paste>
Reply
#65
I'm guessing you're not used to CSVs ...

Try opening it in Excel, as it opens CSV. Failing that, open it in OpenOffice's spreadsheet tool. You'll see the headings. Replace the value under "Old Translation", failing that try "New Translation" (reverting it).

You've replaced the Text attribute (what it uses to find it), so it's probably performing a null lookup. Otherwise take what you have now and reset the third value so it goes:

Code:
3268, 153598, Walker "Big Man" Johnson, [rest of the line]

EDIT: Disclaimer, I haven't looked at translation, I'm basing this of Tropico 4 and the CSV itself. I'm still contented wasting my limited spare time on maps >_>
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#66
(06-02-2013, 02:41 AM)Swixel Wrote: You've replaced the Text attribute (what it uses to find it), so it's probably performing a null lookup. Otherwise take what you have now and reset the third value so it goes:

Code:
3268, 153598, Walker "Big Man" Johnson, [rest of the line]

Mmm... for the weapon names and character name I also changed the text attribute and the following names and it worked then.

I alwasy replace all three instances of the same text. For example I changed the Rifle into:

Gewehr 98 Rifle,Lua/Weapons.lua(01160),,,,156025,Gewehr 98 Rifle,Gewehr 98 Rifle,,OK
7309,156025,

Could be that I just forget to replace something now, because I'm using bigger texts, makes me lose focus.
Reply
#67
I had a quick poke around, and I stand corrected: they're using IDs, in this case 3268 is used in the table. I'll test something really quickly ...

Okay, I replaced line 765 with:
Code:
3268,153598,"Notorious B.I.G.",Data/CombatUnitDef.lua(00280),CombatUnitDef Big Man display_name,,,153598,"Notorious B.I.G.","Notorious B.I.G.",,OK

What I *suspect* is happening is you've got a spare " (but you removed the past, so I can't see it).

Ordinarily I'd use Lua to handle this modification, just finding the suitable reference (_G[1652][3268], in this case), and patch it with regex (but that would require LPeg), or static string replacements/gsub (so it is doable), but this works fine too.

Make sure you check your quotes, a single extract ", and your commas (','), as an extra will cause issues for the parser.
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#68
(06-02-2013, 03:16 AM)Swixel Wrote: What I *suspect* is happening is you've got a spare " (but you removed the past, so I can't see it).


Make sure you check your quotes, a single extract ", and your commas (','), as an extra will cause issues for the parser.

I had a few problems which combined both things you said.

1. When you want something to appear as "Fixit" for example I had to use ""Fixit"" in the .CSV (I didn't know this yet).

2. What you said about definition seems to be true at the Bio, I only edited the second and third descriptions instead of all three and it suddenly worked. As soon as I change something about the first, it'll crash.
Reply
#69
I managed to do it, by changing only the second and third texts, seems like they're the ones you need to change. Here's a video with the "new" character, without custom soundset yet and only a very lightly edited Bio, cause I'm lazy. The portait turned out pretty well (though not perfect):


Problem I still had is replacing the Big Man (his combat name), because that's also used for definition and I don't know which I can and which I can't change.
Reply
#70
(06-02-2013, 11:30 PM)Fireman Wrote: Problem I still had is replacing the Big Man (his combat name), because that's also used for definition and I don't know which I can and which I can't change.

Try line 1288:
Code:
3695,153598,Big Man,Data/CombatUnitDef.lua(01820),CombatUnitDef Big Man (1) display_nick,,,153598,Big Man,Big Man,,OK

to:
Code:
3695,153598,Big Man,Data/CombatUnitDef.lua(01820),CombatUnitDef Big Man (1) display_nick,,,153598,Whatever1,Whatever2,,OK

That way you'll know which columns you change -- you only need to change the translation columns, not the text one.
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#71
(06-02-2013, 11:36 PM)Swixel Wrote: Try line 1288:
Code:
3695,153598,Big Man,Data/CombatUnitDef.lua(01820),CombatUnitDef Big Man (1) display_nick,,,153598,Big Man,Big Man,,OK

to:
Code:
3695,153598,Big Man,Data/CombatUnitDef.lua(01820),CombatUnitDef Big Man (1) display_nick,,,153598,Whatever1,Whatever2,,OK

That way you'll know which columns you change -- you only need to change the translation columns, not the text one.

Thanks! I tried using Excel (though weirdly enough it couldn't open it before, it can now). And now it's a lot easier to see what I can and can't change. Now just to find a couple of soundsets to test with.
Reply
#72
anyone successful in decompling CombatUnitDef?
Using Luadec 3.2 by Swixel only spits out parts.
Reply
#73
(07-02-2013, 11:01 PM)Devacore Wrote: anyone successful in decompling CombatUnitDef?
Using Luadec 3.2 by Swixel only spits out parts.

Use Chunkspy ( http://chunkspy.luaforge.net/ ) to reverse it from the logic.

EDIT: From a quick poke around, it dumps enough that you should get the idea.
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#74
Any news on map content?
Has anyone figured out what the grid* files are about?

Has anyone like Swixel created actually content on the games mechanic (T4 though)?


In this sense

Smartcom


*In a moment of reckless stupidity i thought, it may refers to the esri file format [raster GIS file] …
Quote:"Ich weiß nicht ob es besser wird, wenn es sich ändert. Aber ich weiß das es sich ändern muß, wenn es besser werden soll."
Georg Christoph Lichtenberg *1742, †1799, deutscher Schriftsteller
Reply
#75
Height + visible are obvious; water types are obvious; im/passable are they sound like; and type specifies what is pretty much just a texture.

In terms of items, they're in objects.lua, and the "PlaceObject" function handles a lot of what you'd be interested in. Notably, architecture in the game isn't handled by a single entity, but a lot of them placed together, which is slightly problematic for map making, particularly since it then requires a logic entity to handle the building type.
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#76
Thanks in advance for your advice!
It's maybe just a coder's block, but what file format are the respective one?
Actually doesn't get it ... -.-


In this sense

Smartcom
Quote:"Ich weiß nicht ob es besser wird, wenn es sich ändert. Aber ich weiß das es sich ändern muß, wenn es besser werden soll."
Georg Christoph Lichtenberg *1742, †1799, deutscher Schriftsteller
Reply
#77
They're just a binary serialisation ... Maps are (almost entirely I think?) 768x768, which is stored as 769 for some reason. Assuming it's a 769^2 map, you're looking at 591361 pieces of information you want. Taking an arbitrary example, (06_Church), you're looking at exactly two bytes for each piece of data in the height grid and height visible grid. Following the same pattern you'll find other things elsewhere... Type stores only the 768x768, using a single byte for each tile. Type is the easiest to understand. As for im/passibility, I've never had a reason to play with them in any depth.

I can do a fair bit with all of them, understand some more or less completely (height, type), completely disregard others (im/passibility), but they're not really a concern given you could just borrow another map's data, wipe it, and experiment with types and placements of entities. I don't have lists of what the numbers mean at present though ... I have this sort of data for Tropico 4, but it's on archive/a backup-drive somewhere.
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#78
(14-02-2013, 10:10 PM)Swixel Wrote: They're just a binary serialisation ...
[…]
Well, seems my first try wasn't that bad actually. Cool
Really, really helpful – appreciate your help!


In this sense

Smartcom
Quote:"Ich weiß nicht ob es besser wird, wenn es sich ändert. Aber ich weiß das es sich ändern muß, wenn es besser werden soll."
Georg Christoph Lichtenberg *1742, †1799, deutscher Schriftsteller
Reply
#79
Has anyone changed the camera to rotate like Grand Ages Rome?
Reply
#80
Does anyone know how to decompile Weapons.lua? I can't completely decompile it with Luadec. Any help would be appreciated thank you.
Reply
#81
(02-03-2013, 09:07 AM)seamus2008 Wrote: Does anyone know how to decompile Weapons.lua? I can't completely decompile it with Luadec. Any help would be appreciated thank you.

http://luaforge.net/docman/83/98/ANoFril...ctions.pdf
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#82
(02-03-2013, 11:28 AM)Swixel Wrote:
(02-03-2013, 09:07 AM)seamus2008 Wrote: Does anyone know how to decompile Weapons.lua? I can't completely decompile it with Luadec. Any help would be appreciated thank you.

http://luaforge.net/docman/83/98/ANoFril...ctions.pdf

Thank you, but this 50-page document seems way out of my league. I just want to modify the weapon damage/accuracy. I followed this guide: http://steamcommunity.com/app/208520/dis...482839307/
However, after decompiling with luadec, the resulting file had 6 instances of "--" string instead of 3. The guide said it wouldn't work if it has more than 3. I tried anyways and it didn't work.
Is it possible for someone to post or send me a decompiled version of weapons.lua? Thanks again.
Reply
#83
As I posted there, LuaDec 3.2 is fairly terrible... and as was said in the T4 forums, while I usually have decompiled things, I'm not about to distribute core game files in any form.

While it may seem out of your league, it's just a series of logical steps. You can use chunkspy to get the registers and work from there.
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#84
Upon further testing, while using the HPK Archiver to unpack lua.hpk, it gives me an error "C:\Users\User\Desktop\omerta mods\Lua\LuaRevision.txt Could not decompress the file."
Then, if I repack it, withOUT changing anything, the new lua.hpk will make the game crash at start up.
Reply
#85
Just add a blank file called "LuaRevision.txt" to the Lua directory you're packing.
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#86
(03-03-2013, 07:59 AM)Swixel Wrote: Just add a blank file called "LuaRevision.txt" to the Lua directory you're packing.

I've already tried that, the game still crashes at startup
Reply
#87
In my repack folder it's in Lua\LuaRevision.txt I put in the content: "1100" (it matches what I had at the time) It's also in the same folder as MissionDef.lua. If that's not working then I can't really help you; it works for me, and I'm doing some fairly weird things in that HPK.
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#88
(03-03-2013, 08:50 AM)Swixel Wrote: In my repack folder it's in Lua\LuaRevision.txt I put in the content: "1100" (it matches what I had at the time) It's also in the same folder as MissionDef.lua. If that's not working then I can't really help you; it works for me, and I'm doing some fairly weird things in that HPK.

Thank you so much, cause before you said blank file and that's what I did (deleted the content in the file), and it didn't work. Now I replaced the content with "1100", and it finally works!! Now it's just a matter of testing actual changes. Thanks again!
Reply
#89
Oh, right, I removed the value check too, which would explain why I no longer needed the value (my current version is actually empty).
"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
Reply
#90
(02-03-2013, 02:55 PM)Swixel Wrote: You can use chunkspy to get the registers and work from there.

What are registers? The only modding experience I have is changing numbers in an xml, and maybe simple compiling with a compiler with 2 lines of instructions. I got chunkspy, but it's just a file, it opens in a text editor. The guide says to start it in interactive mode. I assume using cmd? I did that (navigated to the directory and typed "chunkspy.lua --interact" in cmd) and it just opened the chunkspy file in a text editor. Am I supposed to change the text itself? I don't know.
Reply




Users browsing this thread: 1 Guest(s)