AtomicTorch Studio Forums

VoidExpanse => Modding info => Topic started by: Ophidios on April 06, 2014, 02:22:06 PM

Title: Interesting modding bug - help?
Post by: Ophidios on April 06, 2014, 02:22:06 PM
So I was testing the waters for modding (I'm not completely new to scripting and game modding, so I figured why not?)

I started out simple by changing a line of dialog just to see how it all shakes out (adding the word TESTING to the Freedom faction dialog).  So I made a single text change to the "data/topics/any_jobs.js" file, packed ONLY that file (in the same directory structure) using the guidelines posted here, and made the appropriate changes to the Header file and the ModsConfig file.

But when I load a game with this mod activated, it causes all conversations with all characters to simply not trigger.  Clicking on them causes nothing to happen.

The any_jobs.js changes made:
using(ship);
using(relations);
using(npc);
using(console);

function OnCheckRequirements()
{
return true;
}

function OnStart()
{
}

function OnDialogue()
{
var npc_ship_id = topic.GetCurrentNpcShipId();
var faction = relations.GetShipFaction(npc_ship_id);

if(faction == "order")
{
topic.AddPhrase("100", "We, The Order, always have some job for gifted young fellows, like you.");
topic.AddPhrase("101", "If you feel like killing pirates and other criminals, you might want to talk to our Security Officer, he is in charge of this sort of stuff.");
topic.AddPhrase("102", "Talk to our Intendant for delivery and other supply jobs. Dull stuff, but well-paid.");
topic.AddPhrase("103", "You can visit our Commander, if you think you're ready for real challenges.");
}
else if(faction == "freedom")
{
topic.AddPhrase("200", "TESTING - Well, of course, brother, if you're looking for an honest work, we will gladly provide!");
topic.AddPhrase("201", "Talk to people on the station, there bound to be someone looking for some help.");
}
else if(faction == "fanatics")
{
topic.AddPhrase("300", "Our masters will highly appreciate your services to them. Working for masters is the only way to true ascension.");
}
else if(faction == "pirates")
{
topic.AddPhrase("400", "We'll give you job, just don't blew it.");
topic.AddPhrase("401", "Go talk with someone on the station.");
}
else
{
topic.AddPhrase("500", "Well, try to walk around the station, ask some people, maybe you'll find some job.");
}

}


The header.xml file:
<?xml version="1.0" encoding="utf-8"?>

<root>
<id>test</id>
<title>Language test</title>
<author>Ophidios</author>
<description>TESTING.</description>
<version>0.0.1</version>
<updated>06.04.2014</updated>
<modtype>2</modtype> <!-- 1 - server, 2 - client-server, 3 - client -->
</root>


And the ModsConfig.xml file:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<mods>
  <mod>core_0.1.0</mod>
  <mod>test_0.0.1</mod>
</mods>


Everything looks kosher to me.  Anything I might be missing?
Title: Re: Interesting modding bug - help?
Post by: Jax43 on April 06, 2014, 05:12:32 PM
I had something very similar happen to me as well, I cant figure out what I might be missing. Must have looked it over a million times now LOL
Title: Re: Interesting modding bug - help?
Post by: DLirry on April 07, 2014, 03:27:08 AM
Hello!
I've tested your mod - it worked perfectly.
My guess is that your inner structure of .mpk file was not exactly correct. Root of every .mpk can have only 3 entities:
header.xml - mandatory
data - folder
content - folder

Meanwhile, a tip - it's better to to test mods in multiplayer mode:
first launch server .exe file from folder /server, and then launch client in multiplayer mode, enter "localhost" as address.
If something doesn't work right, you can just look at server app - it will, probably, show an error in scripts or xml...
Title: Re: Interesting modding bug - help?
Post by: carch on April 07, 2014, 06:13:06 AM
this should probably go into a bugs section, but I've had a similar problem with no mods installed at all. sometimes the conversations just.. don't show up. it usually mends itself after quiting and reloading. and I have had that moving to a new system fixes it. also have had that it doesn't fix it. I can't accurately reproduce it. it just.. rarely.. happens? I'll try to keep a few note on when and where it happens. maybe I can find a cause.
Title: Re: Interesting modding bug - help?
Post by: Ophidios on April 07, 2014, 12:15:30 PM
Quote from: DLirry on April 07, 2014, 03:27:08 AM
Hello!
I've tested your mod - it worked perfectly.
My guess is that your inner structure of .mpk file was not exactly correct. Root of every .mpk can have only 3 entities:
header.xml - mandatory
data - folder
content - folder

Meanwhile, a tip - it's better to to test mods in multiplayer mode:
first launch server .exe file from folder /server, and then launch client in multiplayer mode, enter "localhost" as address.
If something doesn't work right, you can just look at server app - it will, probably, show an error in scripts or xml...

I appreciate the response.  I don't want to jump to any goofy conclusions, but I am fairly sure that I had the structure correct.  I will whack everything and attempt again from scratch.  If I continue to have the same issue, I will post some screenshots and additional details as well.  I will also try a fresh download of the client.

@carch:

Unfortunately for me, it happened with repeated attempts.  I was able to revert all files back to normal and conversations worked fine 100% of the time.  On 3 separate occasions I installed the tiny mod, and on all 3 occasions it broke conversations.  Weird.
Title: Re: Interesting modding bug - help?
Post by: DLirry on April 07, 2014, 07:37:19 PM
If you have what seems a proper mod. but which doesn't work, please, send it to us, we'll check if it has errors, or not =)
This mystery is kinda disturbing. On our tests everything always worked great.
Title: Re: Interesting modding bug - help?
Post by: Ophidios on April 08, 2014, 06:39:54 PM
Very strangely, but instead of changing the file contents, I deleted all the files and manually recreated each file from scratch, and simply copy-pasted the original contents into the files. It worked.

COMPUTERS!

Strange.
Title: Re: Interesting modding bug - help?
Post by: DLirry on April 13, 2014, 10:56:13 PM
Yeah, such stuff happens to me all the time) Makes me wonder, if it's me, or it's just another bug in The Matrix.