Page 6 of 9 FirstFirst ... 4 5 6 7 8 ... LastLast
Results 101 to 120 of 168

Thread: [MOD] YaK's SSLTBS1 Fixpack (Spare Some Love To Banner Saga 1)

  1. #101
    Senior Modder YaK's Avatar
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    255
    Sure! Thanks!

    If you need, i've uploaded some new images on the nexus to explain better some changes.
    My mods: YaK's SSLTBS1 Unofficial Fixpack ( www.nexusmods.com/thebannersaga/mods/1 ) and Drake's & YaK's BS2 Unofficial Fixpack ( www.nexusmods.com/thebannersaga2/mods/2 )




    I think, therefore I am... I think.

  2. #102
    Nice Person Iuliana's Avatar
    Join Date
    Oct 2016
    Location
    Moldova
    Posts
    59
    YaK, thank you for this amazing work! It takes true love and dedication to put every little bit and piece in to the game. I can not imagine how much time and dedication it took to bring those changes to BS1. But I can say that we are all truly grateful.

    Thank You! You ROCK!

  3. #103
    Superbacker Ratatoskr's Avatar
    Join Date
    Apr 2012
    Location
    Colorado
    Posts
    280
    Nice to see you're still working on this, though I think I might still be a version off with GOG. I'll have to double check.
    But maybe we've finally managed to track down all those blasted typos

  4. #104
    Senior Modder YaK's Avatar
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    255
    @Iuliana: Thank you, let me know if all is working as it should. Feedbacks and suggestions are really welcome!



    @Ratatoskr Yeah, i am confident that there aren't any typos left at least on the map/descriptions, let's hope Stoic release an update to the modding tools, so i could fetch a complete Saga1 pack with all the stuff, in any case If GOG is updated with the "Balance Update", it should be fine (GOG version should be 2.36.16 if i remember correctly).

    That said, i am planning to do a little update to BS2 pack too and i could use your help! Right now there are just a few things on the list, so probably i'll wait till the localizations will exit the beta (to avoid updating/testing the stuff again):

    • The same Skogr description typo;
    • "The Serpent hisses just before a flash of light". How do you suggest to edit it?
    • Typo: Rugga: "...and they’ve chose me to lead that cause..." (should be: chosen) ---> I cannot help myself to remember this conversation, so i am unable to find the correct file to edit. Does this ring any bell to you?
    Last edited by YaK; 01-30-2017 at 07:12 PM.
    My mods: YaK's SSLTBS1 Unofficial Fixpack ( www.nexusmods.com/thebannersaga/mods/1 ) and Drake's & YaK's BS2 Unofficial Fixpack ( www.nexusmods.com/thebannersaga2/mods/2 )




    I think, therefore I am... I think.

  5. #105
    Superbacker Ratatoskr's Avatar
    Join Date
    Apr 2012
    Location
    Colorado
    Posts
    280
    Quote Originally Posted by YaK View Post
    @Ratatoskr Yeah, i am confident that there aren't any typos left at least on the map/descriptions, let's hope Stoic release an update to the modding tools, so i could fetch a complete Saga1 pack with all the stuff, in any case If GOG is updated with the "Balance Update", it should be fine (GOG version should be 2.36.16 if i remember correctly).

    That said, i am planning to do a little update to BS2 pack too and i could use your help! Right now there are just a few things on the list, so probably i'll wait till the localizations will exit the beta (to avoid updating/testing the stuff again):

    • The same Skogr description typo;
    • "The Serpent hisses just before a flash of light". How do you suggest to edit it?
    • Typo: Rugga: "...and they’ve chose me to lead that cause..." (should be: chosen) ---> I cannot help myself to remember this conversation, so i am unable to find the correct file to edit. Does this ring any bell to you?
    I might be caught up then. I've been playing Baldur's Gate instead of Banner Saga at the moment so I haven't tried it out.
    And let's see...

    I'm not sure but that Rugga lines sounds like it could be when he betrays you and tries to throw a coup. That's my best guess. Otherwise I can try to find it next time I do a play through.

    And that serpent line is just awkward. (It's like my version of your extra tree ) I wish I could remember the rest of the sentence to make it really flow, but I think the simplest way to make the first part grammatical would just be: "The serpent hisses and then there's a flash of light,.... (whatever the rest of the line is)." If you happen to have that last part, I could probably make it sound better.
    Last edited by Ratatoskr; 01-31-2017 at 09:53 AM.

  6. #106
    Senior Modder YaK's Avatar
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    255
    Sure, i will post the rest of the conversation here tomorrow. Regarding Rugga, believed it was something he said to the King or to Rook/Alette in Arberrang, but i was wrong. I'll dig further.
    My mods: YaK's SSLTBS1 Unofficial Fixpack ( www.nexusmods.com/thebannersaga/mods/1 ) and Drake's & YaK's BS2 Unofficial Fixpack ( www.nexusmods.com/thebannersaga2/mods/2 )




    I think, therefore I am... I think.

  7. #107
    Superbacker Ratatoskr's Avatar
    Join Date
    Apr 2012
    Location
    Colorado
    Posts
    280
    Quote Originally Posted by YaK View Post
    Sure, i will post the rest of the conversation here tomorrow. Regarding Rugga, believed it was something he said to the King or to Rook/Alette in Arberrang, but i was wrong. I'll dig further.
    Sounds good. As I said about the other line, I thought Rugga said something similar after the fire in the wood before he tries his coup, but it might not be that exact line.

  8. #108
    Senior Modder YaK's Avatar
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    255
    a) Found. It was one of the possible outcomes when you meet Rugga after arriving to Arberrang but BEFORE confronting the King (cnv_14_pop_postclansmen_battle.json):

    "I've discovered what these battle lines are all about," Rugga says. "The king's shut his people out. These clans are here to see that he feeds and protects his people as he is supposed to...and they've chose me to lead that cause."


    b) Here's the full conversation: https://writer.inklestudios.com/stories/r9pv

    [ juno] You blink, and the Serpent catches your hesitation.
    [serpent juno] “So, there is one you cannot control. He would be my salvation, but...”
    Another shudder.
    [juno] “I feel it too. We are both dying!”
    [serpent] “No satisfaction in mutual destruction. Impatience has undone me. Frustrating to learn a solution too late.”
    The space shakes horribly one last time.
    [juno] “Vǎnek di sím joķull...”
    {pageBreak}The Serpent hisses just before a flashing light. (changed in the current MOD version to: "The Serpent hisses just before a flash of light")
    {pageBreak} A terrible pain rips through you both.
    The two of you shriek simultaneously, and your vision dims.
    My mods: YaK's SSLTBS1 Unofficial Fixpack ( www.nexusmods.com/thebannersaga/mods/1 ) and Drake's & YaK's BS2 Unofficial Fixpack ( www.nexusmods.com/thebannersaga2/mods/2 )




    I think, therefore I am... I think.

  9. #109
    Superbacker Ratatoskr's Avatar
    Join Date
    Apr 2012
    Location
    Colorado
    Posts
    280
    Quote Originally Posted by YaK View Post

    b) Here's the full conversation: https://writer.inklestudios.com/stories/r9pv

    [ juno] You blink, and the Serpent catches your hesitation.
    [serpent juno] “So, there is one you cannot control. He would be my salvation, but...”
    Another shudder.
    [juno] “I feel it too. We are both dying!”
    [serpent] “No satisfaction in mutual destruction. Impatience has undone me. Frustrating to learn a solution too late.”
    The space shakes horribly one last time.
    [juno] “Vǎnek di sím joķull...”
    {pageBreak}The Serpent hisses just before a flashing light. (changed in the current MOD version to: "The Serpent hisses just before a flash of light")
    {pageBreak} A terrible pain rips through you both.
    The two of you shriek simultaneously, and your vision dims.
    Okay, that sentence really is my nemesis. But I think "The Serpent hisses and then there's a flash of light." is still the simplest and most grammatical option. And congrats on tracking down your other line

  10. #110
    Senior Modder YaK's Avatar
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    255
    Doesn't it loses a bit of drama?

    "The Serpent hisses. Suddenly a flash of light."?
    My mods: YaK's SSLTBS1 Unofficial Fixpack ( www.nexusmods.com/thebannersaga/mods/1 ) and Drake's & YaK's BS2 Unofficial Fixpack ( www.nexusmods.com/thebannersaga2/mods/2 )




    I think, therefore I am... I think.

  11. #111
    Superbacker Ratatoskr's Avatar
    Join Date
    Apr 2012
    Location
    Colorado
    Posts
    280
    Quote Originally Posted by YaK View Post
    Doesn't it loses a bit of drama?

    "The Serpent hisses. Suddenly a flash of light."?
    Okay, if you want drama,... I'd probably go with: "The Serpent hisses. There's a flash of light. A terrible pain rips through you both."

    It keeps the style they're using in that segment without having any incomplete sentences. We could say "There's a sudden flash of light" if you want, but I'm not sure sudden is really necessary. Honestly, how often is a flash of light not sudden?

  12. #112
    Senior Member Yellow's Avatar
    Join Date
    Feb 2013
    Location
    Norway
    Posts
    265
    Quote Originally Posted by YaK View Post
    Hi y'all!

    A new stable version of Saga1 is out (2.36.15) and an update to the fixpack too!

    Since the recent Balance update, unfortunately, TBSDecompiler (one of the tools used by modders) stopped working on some game files (mainly convos) and so I could not update the whole fixpack to work with the stable version of Banner Saga 1, anyway, in the meanwhile i've been able to fix some other nasty bugs not related to convos, so here it comes:

    YaK's Spare Some Love To Banner Saga 1 - LITE version 1.10



    that will address all i could port from the old fix pack, plus the interesting new fixes.


    Here's the changes in this v 1.10:

    [FIXED] A typo in the description of Skogr, on the map: "... the the beast ...";

    [FIXED] Grenilund location not clickable on the map;

    [FIXED] Nid lacking two stat point to allocate;

    [FIXED] Sigbjorn missing 4 WIL points;

    [FIXED] Gunnulf lacks two kills at the starting of the game (from the tutorial);

    [FIXED] New and consistent icons for the Skalfing Chieftain and his gingerish, grey dressed thugs (which are present in the tutorial, in the Meadhouse battle and in the Ash Mead Battle, in Boersgard) - Thanks to Aleo for the idea;

    [RESTORED] a color version of the Raidmaster enemy unit (v.0);


    [BONUS] As a bonus, i set in place the correct values to have a working Bolverk in Saga1, just for fun. To add him enable developer mode and type in the console:
    Code:
    saga roster_add bolverk

    Here's the changes in this v 1.00:

    [FIXED] The state of Boersgard's "Find a safe place for caravan to stay" event is not saved, so if you reaoad a game, the event will bug itself (see here: https://steamcommunity.com/app/237990...41879448505987).

    [FIXED] The importing of BS1 save into BS2 being inconsistent. Now you will not lose anymore the wrong item equipped by the hero killed by Bellower, nor promoting done before the last fight, renown gained/spent or items bought in the market JUST before the last fight and, of course, kills done in Bellower's fight. What i have changed, in details:

    • The save done just after you choose who will shot the arrow is now called "sav_crafters", with a proper description "The Silver Arrow: A treacherous trick";
    • A new save is created (that removes injuries and set all the right vars in place) AFTER you defeat Bellower (the new "sav_finale"), with a proper new image (a Boersgard panorama, free of Dredge and more focused on the river - "Onward" was my thought);
    • A new variable is created to control Boersgard view composition (Dredge/No Dredge/Bellower Showing/Bellower clickable), "7_bellowercomes" to replace the purpose of "7 boersbellow", that's still there cause is also used as a prerequisite to import the save into BS2. Deleted also the code that zeroed "7 boersbellow" after killing him (so BS2 will correctly recognize the file).
      This way we could have a working and consistent importing of promoted heroes/renown/kills/items and whatever into BS2, editing files just from BS1 side, while lefting untouched BS2 files Importing tested multiple time (Rook/Alette) on the latest vesion of both games


    [FIXED] Bellower Battle don't award you any renown at all and didn't show the battle ending recap banner (with injuries, renown gain etc.).

    [FIXED] Now Bellower (second part battle) is considered a "Rank 11" enemy, so, on death it will show (and will award) a "+10 Renown" banner. Holy cow, he's the Immortal Sundr!

    [FIXED] In the tutorial battle, you get +6 Renown, but Ubin Caravan start whit just 5. Do you remember that missing faen renown needed to promote that hero, buy that bloody item or that vital bunch of supplies? Well, i've found where it was hiding

    [FIXED] A few typos on the MAP, practically all the reamining ones reported by Ratatoskr and not yet officially fixed in this thread and few more found on Steam's forum or by myself. Fore a detailed list (with the line i edited) look here.

    [CHANGED] Starting difficulty is now "Hard", so it will not reset to "Normal" if you start a new game, possibly wrecking the achievement if you didn't notice it soon.

    [CHANGED] Unlocked Tryggvi by default, as explained in Aleo's thread. TO STOIC: If it's a problem, just let me know and i would remove that part.

    [FIXED] Rook required in party on Onef's ambush fight;

    [FIXED] Nid required in party in her first battle.

    [FIXED] Got rid of THE TWO NOTORIOUS OBNOXIOUS FAEN TREES (On the way to Frostvellr, after Hogun's & Mogun's village, and in Wood just before Onef's ambush);

    [FIXED] The error preventing the second in-camp conversation with Ubin from happening. It will fire up at the first camping after the treasury cart event, if you'll lose the tithe (sending back some varls with the taxes will prevent the event from poppening, is intended).

    I wish i could do more, but if the Dev's left the things as they're now, that's the crude reality

    To Do List, if it'll become possible again to mess with convos:

    • Edit the event in which you go searching food with Oddleif in Boersgard. Right know it will take THREE days (+1 day to search for food unsuccessfully, +1 day to read the note, accept the deal and go in the low quarter during the night and +1 just to wait till morning and have deal with the merchants.
      It's odd and often it's totally useless or you have not enough time to complete all the series of event, so logically it should be just +1 day to search food, +12 hours to wait the night and another +12 hours to wait till morning. Totally: 2 days;
    • It have always upset me that, if Ludin is alive, In Boersgard is said that "Hakon joins you with three hundreds varl and the Prince Ludin and his retinue." but there are only 280 varl. Where are all the fighters from Ludin retinue (+85 fighters) and the human warriors from Strand (+100) gone? Do varl eat human flesh ? I'll probably add something around +70 fighters (assuming more than half die) and reduce a bit the supplies, to balance the thing out;
    • On Ridgehorn, if you let Ludin go away (and horribly die, togheter with Bersi and Yrsa) no fighter is removed (need to cross-check). I'll probably set fighters to zero (it makes sense that all humans will go with their Prince);
    • Adding clansmen in one of the option at Reynivik: "[rook] With some help you gather up the casks of mead and head back to the caravan, Sigbjorn and the other survivors in tow. The caravan gives the boisterous varl a large berth as you set out for Boersgard." I counted them in the board. There are 42 people. And a dog.
    • Correct all the other various typos reported by Ratatoskr in convos;
    • OF COURSE, update all the reamining fixes from SSLTBS1 to work with the latest version of BS1, excluding the ones officially corrected by Stoic.




    Download link and notes:

    THIS WILL WORK WITH BANNER SAGA 2.36.15


    On Nexusmods: https://www.nexusmods.com/thebannersaga/mods/1/?

    GDrive download link: https://drive.google.com/open?id=0B_...E40Z2VUb1RWYnc
    Pretty great stuff! I really hope more of it gets adressed officially at some point via a patch.
    "Forged by Fire; Empowered by Passion"

  13. #113
    Skald Aleonymous's Avatar
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    2,444
    I hope that horrible cyan background is not present in-game!
    Together we stand, divided we fall.

  14. #114
    Senior Modder YaK's Avatar
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    255
    Quote Originally Posted by Aleonymous View Post
    I hope that horrible cyan background is not present in-game!
    Of course is not!

    (Damned daltonism...)
    My mods: YaK's SSLTBS1 Unofficial Fixpack ( www.nexusmods.com/thebannersaga/mods/1 ) and Drake's & YaK's BS2 Unofficial Fixpack ( www.nexusmods.com/thebannersaga2/mods/2 )




    I think, therefore I am... I think.

  15. #115
    I've spent some research into the convo-files of the latest tbs1 version.
    They changed the format totally. In older versions the content were stored as zlib-compressed json like all the other assets.

    The current files are still zlib-compressed, but the content isn't stored in json format anymore. Now its stored as a mix of byte-markers/flags and content.
    So you have to read some bytes, which gives you information about the next content. Read the content and then you have to read the next byte-marker and so on...
    I think they changed it for performance reasons.


    I did some reverse engineering and put it into the src-code of tbs_decompiler. Currently I can decompress the new convo-files and put the content into json.
    Writing changes is not possible, but it's not necessary since you can use Zeno to compile changes.

    Unfornately the changes are not loseless, so that the compressed assets do not contain all information from src-versions.
    But the good news are: It looks like the game does not need that information, since the lost information contains mainly metadata.
    I recompiled(through Zeno) 3 or 4 of my decompressed files and the game still worked. So I'm optimistic that the others also will do.

    Currently this is only working in my development environment, but eventually I can provide an executable next week.

    I zipped the list of changed convo-files from your latest patch version 1.40. The archive contains the decompressed ones and the original ones from assets_source(the ones from 2013 ) as comparison.
    tbs_dec_data.zip
    You can adapt your changes from prevois versions and use zeno to recompile them.
    If you find some errors or need additional convo-files, just tell me.

  16. #116
    Senior Modder YaK's Avatar
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    255
    Thanks, having the opportunity to decompile them and\or having a decompiled version will TOTALLY help as soon as I'll resume working on the mod!

    I have the previous version original file packed with the mod and also a backup of the full version, so comparison will not be a problem.

    I suppose they decided to use the same system they will use on Saga3, that dropped inkle writer as a base, hence the useless metadata. Hopefully they didn't change a single line of text in the real data.
    My mods: YaK's SSLTBS1 Unofficial Fixpack ( www.nexusmods.com/thebannersaga/mods/1 ) and Drake's & YaK's BS2 Unofficial Fixpack ( www.nexusmods.com/thebannersaga2/mods/2 )




    I think, therefore I am... I think.

  17. #117
    Skald Aleonymous's Avatar
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    2,444
    Awesome progress, Gest!

    I didn't understand what the changes --technically-- are, but the question is: Is the new (decompiled) convo format more easily human-readable than the previous one?

    Quote Originally Posted by YaK View Post
    I suppose they decided to use the same system they will use on Saga3, that dropped inkle writer as a base, hence the useless metadata. Hopefully they didn't change a single line of text in the real data.
    This.
    Together we stand, divided we fall.

  18. #118
    The new format is more low-level. Only text contents are stored in utf-8.
    The rest(more or less the process instructions to parse the content) is not displayable or look like windings.

    You have to read it i an specific order.

    1. Read an integer value, but this value is never used anymore
    2. Read another integer value, which represents the number of conversation nodes(stitches in old format) in this file
    3. Read a utf-8 string, which represents the name of the initial conversation node
    4. Read the inkle url key
    5. Read with a while-loop the number(the 2nd value) of conversation nodes (and their sub-entries)

    And so on...

    If you don't do that in the correct order, you get just nonsense.
    Last edited by Gestaltzerfall; 02-13-2017 at 12:22 PM.

  19. #119
    Skald Aleonymous's Avatar
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    2,444
    Hey Gest,

    John saw your posts but had some trouble with the forums last night, so he asked me pass this info on to you:

    Code:
    class ConvoDef
    {
    ...
    		public function readBytes(input : ByteArray, logger : ILogger) : ConvoDef
    		{
    			// header
    			var flags : int = input.readInt();
    
    			var nodeCount : int = input.readInt();
    
    			initial = input.readUTF();
    			inkleUrlKey = input.readUTF();
    
    			// read the nodes
    
    			for (var i : int = 0; i < nodeCount; ++i)
    			{
    				var n : ConvoNodeDef = new ConvoNodeDef(this);
    				n.readBytes(input, logger);
    				n.convo = this;
    
    				nodesArray.push(n);
    				nodesById[n.id] = n;
    			}
    
    			var numSpeakers : int = input.readByte();
    
    			for (i = 0; i < numSpeakers; ++i)
    			{
    				var ss : String = input.readUTF();
    				speakers[ss] = ss;
    			}
    
    			readStringsVector(input, mark1, logger);
    			readStringsVector(input, mark2, logger);
    			readStringsVector(input, mark3, logger);
    			readStringsVector(input, mark4, logger);
    
    			return this;
    		}
    
    		private static function readStringsVector(input : ByteArray, vv : Vector.<String>, logger : ILogger) : Vector.<String>
    		{
    
    			var numFlags : int = input.readByte();
    			if (numFlags)
    			{
    				if (!vv)
    				{
    					vv = new Vector.<String>;
    				}
    				for (var i : int = 0; i < numFlags; ++i)
    				{
    					vv.push(input.readUTF());
    				}
    			}
    
    			return vv;
    		}
    
    		public function writeBytes(output : ByteArray) : void
    		{
    			// header
    			var flags : int = 0;
    
    			output.writeInt(flags);
    
    			// node count
    			output.writeInt(nodesArray.length);
    
    			output.writeUTF(initial ? initial : "");
    			output.writeUTF(inkleUrlKey ? inkleUrlKey : "");
    
    			// write the nodes
    
    			for each (var n : ConvoNodeDef in nodesArray)
    			{
    				n.writeBytes(output);
    			}
    
    			var sass : Array = ArrayUtil.getDictionaryKeys(speakers);
    			sass.sort();
    
    			writeStringsArray(output, sass);
    
    			writeStringsVector(output, mark1);
    			writeStringsVector(output, mark2);
    			writeStringsVector(output, mark3);
    			writeStringsVector(output, mark4);
    
    		}
    
    		private static function writeStringsVector(output : ByteArray, vv : Vector.<String>) : void
    		{
    			output.writeByte(vv ? vv.length : 0);
    
    			if (vv)
    			{
    				for each (var s : String in vv)
    				{
    					output.writeUTF(s);
    				}
    			}
    
    		}
    
    		private static function writeStringsArray(output : ByteArray, vv : Array) : void
    		{
    			output.writeByte(vv ? vv.length : 0);
    
    			if (vv)
    			{
    				for each (var s : String in vv)
    				{
    					output.writeUTF(s);
    				}
    			}
    
    		}
    ...
    }
    
    class ConvoNodeDef {
    ...
    		public function readBytes(input : ByteArray, logger : ILogger) : ConvoNodeDef
    		{
    			var bitflags : int = input.readInt();
    
    			var hasSpeaker : Boolean = (bitflags & 0x01) != 0;
    			var hasCamera : Boolean = (bitflags & 0x02) != 0;
    			var hasLink : Boolean = (bitflags & 0x04) != 0;
    			var hasPageLabel : Boolean = (bitflags & 0x08) != 0;
    			var hasCameraUnitFacing : Boolean = (bitflags & 0x10) != 0;
    			var hasConditions : Boolean = (bitflags & 0x20) != 0;
    
    			runOn = (bitflags & 0x40) != 0;
    			skip = (bitflags & 0x80) != 0;
    			advanceIfSkipped = (bitflags & 0x100) != 0;
    			pageBreak = (bitflags & 0x200) != 0;
    			notranslate = (bitflags & 0x400) != 0;
    			joinNext = (bitflags & 0x800) != 0;
    
    			id = input.readUTF();
    			var tt : String = input.readUTF();
    
    			parseText(tt, true, false);
    
    			if (hasSpeaker)
    			{
    				speaker = input.readUTF();
    			}
    
    			if (hasCamera)
    			{
    				camera = input.readUTF();
    			}
    
    			if (hasLink)
    			{
    				link = new ConvoLinkDef(convo).readBytes(input);
    			}
    
    			var i : int = 0;
    
    			var numOptions : int = input.readByte();
    			if (numOptions)
    			{
    				options = new Vector.<ConvoOptionDef>;
    
    				for (i = 0; i < numOptions; ++i)
    				{
    					var cod : ConvoOptionDef = new ConvoOptionDef(this).readBytes(input, logger);
    					cod.nodeId = id;
    					cod.index = options.length;
    					options.push(cod);
    				}
    			}
    
    			flags = readFlagsVector(input, logger);
    			metaflags = readFlagsVector(input, logger);
    
    			pageNum = input.readByte();
    
    			if (hasPageLabel)
    			{
    				pageLabel = input.readUTF();
    			}
    
    			cameraStageIndex = input.readInt();
    
    			if (hasCameraUnitFacing)
    			{
    				cameraUnitFacing = input.readUTF();
    			}
    
    			cameraMarkFacing = input.readByte();
    
    			// convo set externally
    
    			//rawText = input.readUTF();
    
    			// json no longer needed for this
    
    			if (hasConditions)
    			{
    				conditions = new ConvoConditionsDef().readBytes(input);
    			}
    
    			return this;
    		}
    
    		public static function readFlagsVector(input : ByteArray, logger : ILogger) : Vector.<ConvoFlagDef>
    		{
    			var vv : Vector.<ConvoFlagDef>
    
    			var numFlags : int = input.readByte();
    			if (numFlags)
    			{
    				vv = new Vector.<ConvoFlagDef>;
    
    				for (var i : int = 0; i < numFlags; ++i)
    				{
    					var cfd : ConvoFlagDef = new ConvoFlagDef().readBytes(input, logger);
    					vv.push(cfd);
    				}
    			}
    
    			return vv;
    		}
    
    		public function writeBytes(output : ByteArray) : void
    		{
    			// header
    			var bitflags : int = 0;
    
    			bitflags |= speaker ? 0x01 : 0;
    			bitflags |= camera ? 0x02 : 0;
    			bitflags |= link ? 0x04 : 0;
    			bitflags |= pageLabel ? 0x08 : 0;
    			bitflags |= cameraUnitFacing ? 0x10 : 0;
    			bitflags |= (conditions && conditions.hasConditions) ? 0x20 : 0;
    
    			bitflags |= runOn ? 0x40 : 0;
    			bitflags |= skip ? 0x80 : 0;
    			bitflags |= advanceIfSkipped ? 0x100 : 0;
    			bitflags |= pageBreak ? 0x200 : 0;
    			bitflags |= notranslate ? 0x400 : 0;
    			bitflags |= joinNext ? 0x400 : 0;
    
    			output.writeInt(bitflags);
    
    			output.writeUTF(id);
    			output.writeUTF(_text ? _text : "");
    
    			if (speaker)
    			{
    				output.writeUTF(speaker);
    			}
    
    			if (camera)
    			{
    				output.writeUTF(camera);
    			}
    
    			if (link)
    			{
    				link.writeBytes(output);
    			}
    
    			output.writeByte(options ? options.length : 0);
    
    			if (options)
    			{
    				for each (var cod : ConvoOptionDef in options)
    				{
    					cod.writeBytes(output);
    				}
    			}
    
    			writeFlagsVector(output, flags);
    			writeFlagsVector(output, metaflags);
    
    			output.writeByte(pageNum);
    
    			if (pageLabel)
    			{
    				output.writeUTF(pageLabel);
    			}
    
    			output.writeInt(cameraStageIndex);
    
    			if (cameraUnitFacing)
    			{
    				output.writeUTF(cameraUnitFacing);
    			}
    
    			output.writeByte(cameraMarkFacing);
    			// convo is set externally
    			//output.writeUTF(rawText);
    
    			// json no longer needed
    
    			if (conditions && conditions.hasConditions)
    			{
    				conditions.writeBytes(output);
    			}
    
    		}
    
    		public static function writeFlagsVector(output : ByteArray, vv : Vector.<ConvoFlagDef>) : void
    		{
    			output.writeByte(vv ? vv.length : 0);
    			if (vv)
    			{
    				for each (var cfd : ConvoFlagDef in vv)
    				{
    					cfd.writeBytes(output);
    				}
    			}
    		}
    ...
    }
    
    class ConvoOptionDef {
    ...
    		public function readBytes(input : ByteArray) : ConvoLinkDef
    		{
    			var flags : int = input.readByte();
    
    			var hasConditions : Boolean = (flags & 0x01) != 0;
    			var hasPath : Boolean = (flags & 0x02) != 0;
    
    			if (hasPath)
    			{
    				path = input.readUTF();
    			}
    
    			if (hasConditions)
    			{
    				conditions = new ConvoConditionsDef().readBytes(input);
    			}
    
    			return this;
    		}
    
    		public function writeBytes(output : ByteArray) : void
    		{
    			// header
    			var flags : int = 0;
    
    			flags |= (conditions && conditions.hasConditions) ? 0x01 : 0;
    			flags |= path ? 0x02 : 0;
    
    			output.writeByte(flags);
    
    			if (path)
    			{
    				output.writeUTF(path);
    			}
    
    			if (conditions && conditions.hasConditions)
    			{
    				conditions.writeBytes(output);
    			}
    		}
    ...
    }
    
    class ConvoConditionsDef {
    ...
    		public static function cleanupCondition(cv : String) : String
    		{
    			if (!cv)
    			{
    				return cv;
    			}
    
    			cv = StringUtil.stripSurroundingSpace(cv);
    
    			var r : RegExp;
    
    			for each (var ob : OperatorBinary in OperatorBinary.order)
    			{
    				r = new RegExp("\\s*" + ob.escapedStr + "\\s*", "g");
    				cv = cv.replace(r, ob.str);
    			}
    
    			for each (var group : Array in OperatorUnary.order)
    			{
    				for each (var ou : OperatorUnary in group)
    				{
    					r = new RegExp("\\s*" + ou.escapedStr + "\\s*", "g");
    					cv = cv.replace(r, ou.str);
    				}
    			}
    
    			// finally replace var names spaces
    			cv = cv.replace(/ /g, "_");
    
    			return cv;
    		}
    
    		public function readBytes(input : ByteArray) : ConvoConditionsDef
    		{
    			var flags : int = input.readInt();
    
    			notIfConditions = readConditionsVector(input);
    			ifConditions = readConditionsVector(input);
    
    			return this;
    		}
    
    		private function readConditionsVector(input : ByteArray) : Vector.<String>
    		{
    			var count : int = input.readInt();
    			if (!count)
    			{
    				return null;
    			}
    
    			var vv : Vector.<String> = new Vector.<String>;
    
    			for (var i : int = 0; i < count; ++i)
    			{
    				var cv : String = input.readUTF();
    				cv = cleanupCondition(cv);
    				vv.push(cv);
    			}
    			return vv;
    
    		}
    
    		public function writeBytes(output : ByteArray) : void
    		{
    			// header
    			var flags : int = 0;
    
    			output.writeInt(flags);
    
    			writeConditionsVector(output, notIfConditions);
    			writeConditionsVector(output, ifConditions);
    		}
    
    		private function writeConditionsVector(output : ByteArray, vv : Vector.<String>) : void
    		{
    			var count : int = vv ? vv.length : 0;
    
    			output.writeInt(count);
    
    			for (var i : int = 0; i < count; ++i)
    			{
    				var s : String = vv[i];
    				output.writeUTF(s);
    			}
    		}
    ...
    }
    I presume it's parts of the (new) decompiler source, to help read (and write?) into the game-data files.
    Last edited by Aleonymous; 02-14-2017 at 03:00 AM.
    Together we stand, divided we fall.

  20. #120
    Thanks, that's exactly the code I used to decompile the new convo-files.
    But these snippets are indeed helpful, cause the variables have meaningful names. If I decompile the games src, variables just named like param1 or _loc_1.

Page 6 of 9 FirstFirst ... 4 5 6 7 8 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •