Help debug my mod? [Events]

Discuss and distribute tools and methods for modding. Moderator - Grognak
Kiloku
Posts: 66
Joined: Mon Nov 19, 2012 5:52 pm

Help debug my mod? [Events]

Postby Kiloku » Sat May 10, 2014 7:42 am

I've been developing a mod that's supposed to add a new element to Sleeper Service's CE (+Infinite and Endless Loot).

But my mod isn't working quite as I expected, something is going wrong.

What's supposed to happen:

1. Player reaches trade beacon and has a Weapon Blueprint augment. He sees a blue option that says "(Weapon Blueprint) Have a weapon built." He clicks it.

2. Then the new screen says "You dock to check out the engineering corporations aboard the trade hub. This will take a while." and gives a single option:
"Hire "Glurgh's Workshop" (low price)"
(there are supposed to be more options, but for testing purposes, I only added one for now)

3. The player is taken to a new screen that says "You head to their workshop. The place smells terrible, and the Mantis who answers at the door is obviously on drugs. "Whatchu want?" he asks." and gives two choices:
"Build a Burst Laser II weapon from the blueprint (about 25 scrap)" and
"Give up on building your weapon."

4. Finally (if the player decides to build), he's supposed to get either a Substandard Burst Laser II or a regular Burst Laser II (along with a text prompt specific for each different reward).


The problem is, what's happening is that step 1 occurs normally, but step 2. is as follows:
The new screen says "You dock to check out the engineering corporations aboard the trade hub. This will take a while.". It gives the "Hire "Glurgh's Workshop" (low price)" option but it also includes a box beside it that sometimes has a scrap cost, sometimes has a scrap gain, sometimes even has a BL II or Substandard BL II. Once clicked, it takes you to a random event that is unrelated to the weapon building mod.

The player never even sees steps 3 and 4.
(Besides, it's causing my game to crash sometimes if I click "Restart" from the ESC menu, and I have no idea why)

You can download the .ftl file here: http://www.sendspace.com/file/6xm7gu

The mod requires that CE Endless Loot is loaded. This in turn requires CE Infinite, which requires FTL Captain's Edition. All of these mods are available from Sleeper Service's thread here: viewtopic.php?f=11&t=15663
My mod is also supposed to be the last one in the mod order, and the loading should be done using the Slipstream Mod Manager.
The Kestrel B has the required augment for testing. The event triggers if you have the augment and reach a Store.
Image
FtDLulz
Posts: 38
Joined: Mon May 05, 2014 9:42 pm

Re: Help debug my mod? [Events]

Postby FtDLulz » Sat May 10, 2014 5:53 pm

I'm a newbie at modding atm, so any advice may be wrong. I do see though that your <item type="scrap" min="-33" max="-38"/> needs <item_modify> and </item_modify> around it. Hopefully some other gives you some more sure advice ;)

Also, instead of using negative scrap amounts, put steal="true".

Code: Select all

<item_modify>
     <item type="scrap" min="33" max="38" steal="true"/>
</item_modify>
Last edited by FtDLulz on Sat May 10, 2014 9:15 pm, edited 1 time in total.
User avatar
Sleeper Service
Posts: 2305
Joined: Sun Mar 24, 2013 8:49 pm

Re: Help debug my mod? [Events]

Postby Sleeper Service » Sat May 10, 2014 6:15 pm

First of all: If you have little code to review then you can also just post it in the thread. This way people do not have to download stuff just to help you.

Concerning the actual mod:

Code: Select all

      <choice>
         <text>Give up on building your weapon.</text>
      </choice>


This is missing the <even/> tag or an actual event that it calls. The way it is now it apparently causes problems. You can check some original events to see what is possible to put after choices and what not. They should always have an event capsule, an event load tag or at last the <event/> tag that ends the event when taking the choice. Like here:

Code: Select all

   <choice>
      <text>We will not accept surrender!</text>
      <event/>
   </choice>


Apart from that it looks alright to me, but I never used the advanced stuff SMM offers much, so I can't guarantee that that is all working.
FtDLulz
Posts: 38
Joined: Mon May 05, 2014 9:42 pm

Re: Help debug my mod? [Events]

Postby FtDLulz » Sat May 10, 2014 6:20 pm

I didn't know it would cause problems if you didn't put <event/>. I'll be sure to keep that in mind.
Kiloku
Posts: 66
Joined: Mon Nov 19, 2012 5:52 pm

Re: Help debug my mod? [Events]

Postby Kiloku » Sat May 10, 2014 7:33 pm

Guys, thanks a lot! It's working now, it's always something minor, isn't it? Now that the barebones are working, I'll start making the brunt of the mod!
Image