Mod localisation

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

strude
Posts: 1471
Joined: Wed, 3. Aug 05, 08:15
x4

Mod localisation

Post by strude »

Hi there. I've had a report from a Steam user indicating that one of my mods isn't working. I current use the mod, so I know it's working fine. The screenshots they have supplied show that the text options are displaying readtext references instead of the actual text in the xml file. They are also not using an English version of Rebirth. The only t file I have provided is the 0001-L044.xml file, which contains this.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<language id="44">
	<page id="777001" title="Black Market Seminars" desc="Text for Black Market Seminars" voice="no">
		<t id="1">Stop Selling Seminars</t>
		<t id="2">Confirm Uninstall</t>
		<t id="3">Cancel Uninstall</t>
		<t id="10">Black Market Seminars removed from game.\n\nSeminar items will still be available until you change zones.\n\nRemember to unsubscribe/deactivate the mod when you exit the game.</t>
	</page>
</language>
In order to get some correct text to display, do I need to provide extra files, and if so how do I go about that? I had assumed that if text for a particular language was unavailable, that whatever text was supplied would be used.

The user has made the comment that it doesn't work in V4.0, however I'm waiting for clarification as to whether that means it was working previous and no longer works, or if V4 is merely referenced as the version they are playing.

Regards

Simon
Gaming PC: Gigabyte H270M-D3H | i7 7700 | 16Gb DDR4 | Gigabyte GTX1060 6Gb OC | Asus Xonar DGX | Window 10 Home 64bit | Samsung 256Gb SSD
Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang »

Odd... Black Market Seminars work perfectly fine for me.
strude
Posts: 1471
Joined: Wed, 3. Aug 05, 08:15
x4

Post by strude »

Well that's good to hear at least. I assume you don't play in English?

I've only ever had one other person report a fault with it, and that was with one of the beta releases of V4.

These are the screenshots that the user posted
http://steamcommunity.com/sharedfiles/f ... =642243497
http://steamcommunity.com/sharedfiles/f ... =642243556
http://steamcommunity.com/sharedfiles/f ... =642243610

The last one is showing no seminars available, which I thought might just be bad luck (it can happen). Maybe the mod isn't installed properly on their end then.

If they do a verification through Steam do you know if that will refresh their mod files also, or just the core game files?
Gaming PC: Gigabyte H270M-D3H | i7 7700 | 16Gb DDR4 | Gigabyte GTX1060 6Gb OC | Asus Xonar DGX | Window 10 Home 64bit | Samsung 256Gb SSD
User avatar
alexalsp
Posts: 1896
Joined: Fri, 18. Jul 14, 05:28
x4

Post by alexalsp »

Add to the folder file - 0001.xml
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: Mod localisation

Post by UniTrader »

strude wrote:In order to get some correct text to display, do I need to provide extra files, and if so how do I go about that? I had assumed that if text for a particular language was unavailable, that whatever text was supplied would be used.
nope. language-specific files will only be used for that language. (indictes by the L-****-suffix

9


if a file should be used for all languages it shouldt have this suffix, like 0001.xnl fot the t-file - this one will be used if no language-specific file is found ;)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
strude
Posts: 1471
Joined: Wed, 3. Aug 05, 08:15
x4

Post by strude »

If I was to add a 1000.xml file with the English text, can I leave the L0044 file there? Then at some later date if I added a file, say L0049 it would use the 49 file if that was the set language, and default to using the straight 1000.xml file if not actual language is present?
Gaming PC: Gigabyte H270M-D3H | i7 7700 | 16Gb DDR4 | Gigabyte GTX1060 6Gb OC | Asus Xonar DGX | Window 10 Home 64bit | Samsung 256Gb SSD
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

you can yeah. the 0001.xml serves as a default for not found translations.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
User avatar
Marvin Martian
Posts: 3614
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian »

with 0001.xml
you need to use

Code: Select all

<language>
instead of

Code: Select all

<language id="44">
otherwise it is NOT default and "text not found" still present
User avatar
alexalsp
Posts: 1896
Joined: Fri, 18. Jul 14, 05:28
x4

Post by alexalsp »

0001.xml

Code: Select all

<?xml version="1.0" encoding="UtF-8"?>
<language>
      <page id="******" voice="no">



    </page>	  
</language>
Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang »

strude wrote:Well that's good to hear at least. I assume you don't play in English?

I've only ever had one other person report a fault with it, and that was with one of the beta releases of V4.

These are the screenshots that the user posted
http://steamcommunity.com/sharedfiles/f ... =642243497
http://steamcommunity.com/sharedfiles/f ... =642243556
http://steamcommunity.com/sharedfiles/f ... =642243610

The last one is showing no seminars available, which I thought might just be bad luck (it can happen). Maybe the mod isn't installed properly on their end then.

If they do a verification through Steam do you know if that will refresh their mod files also, or just the core game files?
oh well if the person is playing in a different language that isn't english I got nothing. I am playing in english so...
User avatar
alexalsp
Posts: 1896
Joined: Fri, 18. Jul 14, 05:28
x4

Post by alexalsp »

Requiemfang wrote:
strude wrote:Well that's good to hear at least. I assume you don't play in English?

I've only ever had one other person report a fault with it, and that was with one of the beta releases of V4.

These are the screenshots that the user posted
http://steamcommunity.com/sharedfiles/f ... =642243497
http://steamcommunity.com/sharedfiles/f ... =642243556
http://steamcommunity.com/sharedfiles/f ... =642243610

The last one is showing no seminars available, which I thought might just be bad luck (it can happen). Maybe the mod isn't installed properly on their end then.

If they do a verification through Steam do you know if that will refresh their mod files also, or just the core game files?
oh well if the person is playing in a different language that isn't english I got nothing. I am playing in english so...
0001.xml

Code: Select all

<?xml version="1.0" encoding="UtF-8"?>
<language>
      <page id="******" voice="no">



    </page>	  
</language>

In this file, English. It will be for all, English. If you need a Russian, then be added

0001-L007.xml

if German

0001-L049.xml

etc
strude
Posts: 1471
Joined: Wed, 3. Aug 05, 08:15
x4

Post by strude »

Their Steam profile lists them from Italy, so I assume that's the language they are playing.

It might actually be something else not working, as they have also posted a video showing 3 black market traders in a row without any seminars. I've asked them to try changing sectors and check other traders if they haven't already. Also asked them to come to this page so they might be able to provide input here rather than chatting on the Steam comments.

I have a suspicion they might have uninstalled the mod at some point and reinstalled. The main startup script looks like this.

Code: Select all

		<cue name="Start" checktime="1s" checkinterval="1s">
			<conditions>
				<cue_is_complete cue="md.Setup.Start" />
			</conditions>
			<actions>
				<!-- definitions of seminar wares to add to inventory. [ware reference, min available, max available, percent chance of being in inventory] -->
				<!-- prices are set in the libraries/wares.xml file -->
				<set_value name="$strudo76_add_seminar_combat" exact="[ware.inv_virtualseminarcombat, 1, 3, 15]" />
				<set_value name="$strudo76_add_seminar_engineering" exact="[ware.inv_virtualseminarengineering, 1, 3, 15]" />
				<set_value name="$strudo76_add_seminar_leadership" exact="[ware.inv_virtualseminarleadership, 1, 3, 15]" />
				<set_value name="$strudo76_add_seminar_management" exact="[ware.inv_virtualseminarmanagement, 1, 3, 15]" />
				<set_value name="$strudo76_add_seminar_morale" exact="[ware.inv_virtualseminarmorale, 1, 3, 15]" />
				<set_value name="$strudo76_add_seminar_navigation" exact="[ware.inv_virtualseminarnavigation, 1, 3, 15]" />
				<set_value name="$strudo76_add_seminar_science" exact="[ware.inv_virtualseminarscience, 1, 3, 15]" />
				<!-- Add virtual seminars to black market traders inventory -->
				<append_to_list name="md.$ShadyGuyLists.{1}" exact="$strudo76_add_seminar_combat"/>
				<append_to_list name="md.$ShadyGuyLists.{1}" exact="$strudo76_add_seminar_engineering"/>
				<append_to_list name="md.$ShadyGuyLists.{1}" exact="$strudo76_add_seminar_leadership"/>
				<append_to_list name="md.$ShadyGuyLists.{1}" exact="$strudo76_add_seminar_management"/>
				<append_to_list name="md.$ShadyGuyLists.{1}" exact="$strudo76_add_seminar_morale"/>
				<append_to_list name="md.$ShadyGuyLists.{1}" exact="$strudo76_add_seminar_navigation"/>
				<append_to_list name="md.$ShadyGuyLists.{1}" exact="$strudo76_add_seminar_science"/>
				<!-- set variable to indicate mod is installed -->
				<set_value name="$strudo76_blackmarket_seminars_installed" exact="true" />
			</actions>
		</cue>
My understanding is that start script will only ever run once, so if someone uninstalls the mod, and the later reinstalls it, this start script won't run and the items won't get added to the trader inventory lists. Does that sound accurate?

If that's the case, would I be better off having the start script fire on something other than md.Setup.Start being complete, maybe something that fires every game start, and use the $strudo76_blackmarket_seminars_installed variable I set to true to limit it to only run when that value is false or doesn't exist?
Gaming PC: Gigabyte H270M-D3H | i7 7700 | 16Gb DDR4 | Gigabyte GTX1060 6Gb OC | Asus Xonar DGX | Window 10 Home 64bit | Samsung 256Gb SSD
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

even if they uninstalled it the changed inventory of the Traders should persist.. possibly even if the related ware doesnt exist in the meantime (dindt test the behavior of non-existing macro/ware yet).

also no matter what you check - your cue is not instantiated so it wil by design only run once. even if you uninstalled it in the meantime (cue state of non-existing cues persists, so they continue where they stopped if they are available again)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

strude wrote:My understanding is that start script will only ever run once
I think so, yes. Although I still feel a bit awkward around md.

You could reset the cue when you uninstall. You probably do that also via md? Then add a patch node to the uninstall cue to reset the start cue for anyone who already uninstalled before you added the reset then reinstalls later.
strude
Posts: 1471
Joined: Wed, 3. Aug 05, 08:15
x4

Post by strude »

UniTrader wrote:even if they uninstalled it the changed inventory of the Traders should persist.. possibly even if the related ware doesnt exist in the meantime (dindt test the behavior of non-existing macro/ware yet).

also no matter what you check - your cue is not instantiated so it wil by design only run once. even if you uninstalled it in the meantime (cue state of non-existing cues persists, so they continue where they stopped if they are available again)
I add a conversation topic to black market traders to allow uninstall, which runs this code

Code: Select all

		<!-- cue to handle conversation for uninstall -->
		<cue name="SectionHandler" instantiate="true">
			<conditions>
				<event_conversation_next_section sectionprefix="strudo76_blackmarket_seminars_uninstall"/>
			</conditions>
			<actions>
				<!-- display uninstall confirmation if uninstall conversation option selected -->
				<do_if value="event.param == 'strudo76_blackmarket_seminars_uninstall'">
					<add_conversation_view />
					<add_player_choice text="{777001,2}" section="strudo76_blackmarket_seminars_uninstall_confirmed" position="top_left" />
					<!-- do nothing and return to previous conversation to cancel uninstallation -->
					<add_player_choice_return text="{777001,3}" position="top_right" />
				</do_if>
				<!-- uninstall is confirmed, so remove added items from the black market traders inventory list -->
				<do_elseif value="event.param == 'strudo76_blackmarket_seminars_uninstall_confirmed'">
					<do_if value="md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_combat} > 0" >
						<remove_value name="md.$ShadyGuyLists.{1}.{md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_combat}}" />
					</do_if>
					<do_if value="md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_engineering} > 0" >
						<remove_value name="md.$ShadyGuyLists.{1}.{md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_engineering}}" />
					</do_if>
					<do_if value="md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_leadership} > 0" >
						<remove_value name="md.$ShadyGuyLists.{1}.{md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_leadership}}" />
					</do_if>
					<do_if value="md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_management} > 0" >
						<remove_value name="md.$ShadyGuyLists.{1}.{md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_management}}" />
					</do_if>
					<do_if value="md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_morale} > 0" >
						<remove_value name="md.$ShadyGuyLists.{1}.{md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_morale}}" />
					</do_if>
					<do_if value="md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_navigation} > 0" >
						<remove_value name="md.$ShadyGuyLists.{1}.{md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_navigation}}" />
					</do_if>
					<do_if value="md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_science} > 0" >
						<remove_value name="md.$ShadyGuyLists.{1}.{md.$ShadyGuyLists.{1}.indexof.{Start.$strudo76_add_seminar_science}}" />
					</do_if>
					<show_help custom="{777001,10}"/>
					<!-- set variable to false, to disable showing the uninstall dialogue option -->
					<set_value name="Start.$strudo76_blackmarket_seminars_installed" exact="false" />
				</do_elseif>
				<do_else>
					<!-- unexpected section, throw error -->
					<debug_text text="'Error: Unexpected section=%1'.[event.param]" />
				</do_else>
			</actions>
		</cue>
which removes the items I added.
w.evans wrote:You could reset the cue when you uninstall. You probably do that also via md? Then add a patch node to the uninstall cue to reset the start cue for anyone who already uninstalled before you added the reset then reinstalls later.
Yes, that's probably what I should do. I've seen stuff regarding resetting the queue so I should be able to nut that out, but I've never done a patch before, so I might need some guidance with that.
Gaming PC: Gigabyte H270M-D3H | i7 7700 | 16Gb DDR4 | Gigabyte GTX1060 6Gb OC | Asus Xonar DGX | Window 10 Home 64bit | Samsung 256Gb SSD
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Code: Select all

<cue name="SectionHandler" instantiate="true" version="2">
	<conditions>
...
	</conditions>
	<actions>
...
		<reset_cue cue="Start"/>
	</actions>
	<patch sinceversion="2" state="complete">
		<reset_cue cue="Start"/>
	</patch>
</cue>
or something like that.

edit: oh wait. just noticed your uninstall cue is instantiated. eh, should still work. And cue="Start" assumes that they're on the same hierarchy.

edit 2: except i don't know if the patch node will read the state of the instance or the static cue. i'm thinking the static cue because instances are supposedly gone after they're done. hm. might not work after all.

you could try Uni's solution, except I don't think you can turn a static cue that's already been completed into an instantiating cue that'll still run without resetting it anyway.

can you, Uni?
strude
Posts: 1471
Joined: Wed, 3. Aug 05, 08:15
x4

Post by strude »

The uninstall cue is instantiated, but only runs when the uninstall conversation option is selected, which isn't displayed if the $strudo76_blackmarket_seminars_installed variable is false, which it would be if they have uninstalled it :D

First mod problems I guess.
Gaming PC: Gigabyte H270M-D3H | i7 7700 | 16Gb DDR4 | Gigabyte GTX1060 6Gb OC | Asus Xonar DGX | Window 10 Home 64bit | Samsung 256Gb SSD
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

To fix the particular problem, you could do the trick above with your Start cue instead. That should reset it as soon as the game detects that the cue is back but is a newer version.

Was about to say that it wouldn't be a long-term solution, but that might just do it, actually.

cue="this" instead of cue="Start" in that case, although I think either would work.
strude
Posts: 1471
Joined: Wed, 3. Aug 05, 08:15
x4

Post by strude »

So that's for the patch section?

And then just add a reset cue="me.Strudo76_BlackmarketSeminars.start"(or whatever is correct node format) to the uninstall script?
Gaming PC: Gigabyte H270M-D3H | i7 7700 | 16Gb DDR4 | Gigabyte GTX1060 6Gb OC | Asus Xonar DGX | Window 10 Home 64bit | Samsung 256Gb SSD
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Code: Select all

		<cue name="Start" version="2">
			<conditions>
				<check_any>
					<event_cue_completed cue="md.Setup.Start"/>
					<event_game_loaded/>
				</check_any>
				<check_value value="@$strudo76_blackmarket_seminars_installed" negate="true"/>
			</conditions>
			<actions>
...
			</actions>
			<patch sinceversion="2" state="complete">
				<remove_value name="$strudo76_blackmarket_seminars_installed"/>
				<reset_cue cue="this"/>
			</patch>
		</cue>

Code: Select all

<cue name="SectionHandler" instantiate="true">
   <conditions>
...
   </conditions>
   <actions>
...
      <remove_value name="$strudo76_blackmarket_seminars_installed"/>
   </actions>
</cue>
might do it.

edit: forgot a couple of things in the first block.

edit 2: depending on your script structure, you may have to change the way you refer to the variable in that last remove_value.

edit 3: have to admit, I'm a bit confused. Was going to add a reset_cue in your uninstall, but I remembered that my mict_init is not reset nor instantiated, but I'm pretty sure it runs every game load. Should check to see if I made the same mistake there.

Return to “X Rebirth - Scripts and Modding”