[MODDING] I made a tutorial: create custom events & sectors!

Discuss and distribute tools and methods for modding. Moderator - Grognak
CaptainShooby
Posts: 20
Joined: Sun Sep 16, 2012 4:54 pm

Re: [MODDING] I made a tutorial: create custom events & sect

Postby CaptainShooby » Fri Sep 21, 2012 10:11 am

I'm sorry for not responding sooner, I've been quite busy.

Icehawk78 wrote:You mention that the start_event of the new game sector isn't called, because it fires a different event - do you know which event that is, or if there's a way to override it?


Instead of using the sector startEvent, the game launches "START_GAME" from the events.xml file.
I'm not sure, but I think someone noted in another thread that only the text part of the sector startEvent might be overwritten. Either way, customizing the startup event of the game and/or any sector is very much possible.

Icehawk78 wrote:Is it possible to have an event require you to not have something? Such as having a "pacifist" option which is only available if you *don't* have any weapons, or an "anti-mantis" event that doesn't let you help if you have a Mantis on the crew?


Unfortunately, I don't know. I haven't had enough time to go through a lot of the events, so I can't help you with this one. I'm sure you could figure out if it's possible by going through the events file.

This is how I usually find and figure out how stuff in the game works:
I use a capable editor (Sublime Text 2) to "search in files" for a specific element I wish to investigate, which gives me all the references to said element in every file. This way I get a bigger picture of what's going on. You can find lists of all the elements here: http://www.ftlgame.com/forum/viewtopic.php?f=4&t=2270
CaptainShooby
Posts: 20
Joined: Sun Sep 16, 2012 4:54 pm

Re: [MODDING] I made a tutorial: create custom events & sect

Postby CaptainShooby » Fri Sep 21, 2012 10:13 am

antisyzygy wrote:I'm glad you posted this, thanks! I can read code pretty well but it's nice to have a starting point.

No problem!

antisyzygy wrote:I think I am going to try to make a slower pace mod, with not so urgent of an objective.


Sounds nice, good luck!
Mr. Mister
Posts: 491
Joined: Sun Sep 23, 2012 8:51 am

Re: [MODDING] I made a tutorial: create custom events & sect

Postby Mr. Mister » Mon Sep 24, 2012 7:33 pm

Could someone study how the second event on the secret ship quest (the Zoltan study) manages to REMOVE that augmentation from you, and see if it's hardcoded or what?
rolfy
Posts: 11
Joined: Mon Oct 01, 2012 4:06 am

Re: [MODDING] I made a tutorial: create custom events & sect

Postby rolfy » Mon Oct 01, 2012 12:00 pm

Icehawk78 wrote:I don't, however, think there's currently any way of ensuring that you only get this event based upon using my specific custom-made ship

I haven't done anything with augmentations yet, so I'm kinda guessing, but I think you could create a new aug, put it in your ship, and have the event test if the ship has that aug?
(As Mr Mister notes, though, there doesn't seem to be any way to remove augs - unless maybe you try give the aug and the event that removes it the same names as the Zoltan stasis pod aug and event - so you might want to make your special aug do something else, too, just to keep the player happy)

Update:
I've decided to do something a bit similar for my mod, and give each ship its own unique intro to the game. I'm doing this by making sure that every ship has at least one unique thing about its systems, subsystems, augments or crew, and testing for that in START_BEACON - there will be 18 choices for this event, but in each game, the player will only see one. Here's my code:

Code: Select all

<event name="START_BEACON"> <!-- Except for the text node, this is autoloaded by the START_GAME event - need to make sure that this beacon is not used, except by the starting sector -->
   <text>[BUG - Please report] You should never see this text.</text>
   <choice hidden="true" req="pilot" lvl="3"> <!-- Prospector (Icarus Prospector Type A) -->
      <text>Got it. Let's Play!</text>
      <event>
         <text>Intro text for prospector</text>
         <choice>
            <text>Continue text for prospector</text>
            <event />
         </choice>
      </event>
   </choice>
   <choice hidden="true" req="human" lvl="6"> <!-- Miner Transport (Icarus Prospector Type B) -->
      <text>Got it. Let's Play!</text>
      <event>
         <text>Intro text for mutiny on the Miner Transport</text>
         <boarders min="2" max="6" class="human"/>
         <choice>
            <text>Continue text for Miner Transport</text>
            <event />
         </choice>
      </event>
   </choice>
</event>

As you can see, I've only created one ship so far: type A has a level 3 autopilot, and type B has 6 human crew members. I figure it won't be too hard to make sure none of the other 8 ships (x2 types) will have either of those qualities.
Icehawk78
Posts: 230
Joined: Tue Sep 18, 2012 4:55 pm

Re: [MODDING] I made a tutorial: create custom events & sect

Postby Icehawk78 » Thu Oct 04, 2012 8:34 pm

rolfy wrote:I haven't done anything with augmentations yet, so I'm kinda guessing, but I think you could create a new aug, put it in your ship, and have the event test if the ship has that aug?
(As Mr Mister notes, though, there doesn't seem to be any way to remove augs - unless maybe you try give the aug and the event that removes it the same names as the Zoltan stasis pod aug and event - so you might want to make your special aug do something else, too, just to keep the player happy)

Update:
I've decided to do something a bit similar for my mod, and give each ship its own unique intro to the game. I'm doing this by making sure that every ship has at least one unique thing about its systems, subsystems, augments or crew, and testing for that in START_BEACON - there will be 18 choices for this event, but in each game, the player will only see one. Here's my code:

Code: Select all

<event name="START_BEACON"> <!-- Except for the text node, this is autoloaded by the START_GAME event - need to make sure that this beacon is not used, except by the starting sector -->
   <text>[BUG - Please report] You should never see this text.</text>
   <choice hidden="true" req="pilot" lvl="3"> <!-- Prospector (Icarus Prospector Type A) -->
      <text>Got it. Let's Play!</text>
      <event>
         <text>Intro text for prospector</text>
         <choice>
            <text>Continue text for prospector</text>
            <event />
         </choice>
      </event>
   </choice>
   <choice hidden="true" req="human" lvl="6"> <!-- Miner Transport (Icarus Prospector Type B) -->
      <text>Got it. Let's Play!</text>
      <event>
         <text>Intro text for mutiny on the Miner Transport</text>
         <boarders min="2" max="6" class="human"/>
         <choice>
            <text>Continue text for Miner Transport</text>
            <event />
         </choice>
      </event>
   </choice>
</event>

As you can see, I've only created one ship so far: type A has a level 3 autopilot, and type B has 6 human crew members. I figure it won't be too hard to make sure none of the other 8 ships (x2 types) will have either of those qualities.


For reference, it's been discovered that via XML files, it's not possible to remove augmentations (the stasis pod removal is hardcoded in the game), and you're also unable to create new Augmentations that do things other than "take up space and alter the choices available via choice requiremenets.
NuggetandSkull
Posts: 2
Joined: Sat Dec 15, 2012 11:23 pm

Re: [MODDING] I made a tutorial: create custom events & sect

Postby NuggetandSkull » Sat Dec 15, 2012 11:28 pm

I find this to be a really odd error but every time I do the basic sector event for the starting sector, the game will either crash on startup or crash when I manage to select a ship and click jump. After restoring the old data.dat and re-adding the mods I downloaded via the mod managed, my event is in the sector without errors. However, if I try to edit the data to change it and then repack the data, it will crash like before.

The ctd error I get starts with assertion fail and says it's a C++ runtime error. Any help?
User avatar
Kieve
Posts: 952
Joined: Tue Sep 18, 2012 2:21 pm
Location: Low Orbit
Contact:

Re: [MODDING] I made a tutorial: create custom events & sect

Postby Kieve » Sun Dec 16, 2012 3:42 am

"Runtime error" almost always indicates that there's something wrong in your event code. The event XMLs are very sensitive to bad syntax, to the point where a single misplaced </tag> can bugger the whole thing. Whatever code you're adding, go through it with a fine-toothed comb and make sure every <event>, <text>, and <choice> call has a proper </close> as well. If you've verified everything is as it should be, the problem might be a little more obscure, in which case try starting a new thread with the code posted. There are a few folks around here who can proofread it for you and spot the problem(s).
NuggetandSkull
Posts: 2
Joined: Sat Dec 15, 2012 11:23 pm

Re: [MODDING] I made a tutorial: create custom events & sect

Postby NuggetandSkull » Sun Dec 16, 2012 6:54 am

Oddly enough, every time I pack the mods after a failure to fix the issue, the change will work and the game will act as if the modification never caused an error.
alextfish
Posts: 183
Joined: Sun Sep 30, 2012 2:24 pm
Location: Cambridge, UK
Contact:

Re: [MODDING] I made a tutorial: create custom events & sect

Postby alextfish » Sun Dec 16, 2012 1:17 pm

Icehawk78 wrote:One of the things I enjoy in games where there's a level of customization is playing RNG Roulette, and then basing my build-out from that. So I'd like to be able to create a new player Ship which has access to all systems, but which comes with none preinstalled (up to and including weapons), and you get a random selection of equipment from the following list...I don't, however, think there's currently any way of ensuring that you only get this event based upon using my specific custom-made ship, unless you gave it a crew of one of the "ghost" types (whatever that is, doesn't appear to be implemented yet) and set the "get random stuff" to only trigger upon that specific crew type.
I believe you can do this if you give your ship an augment, either one that's not on any of the other starting ships, or a custom one created in your mod, which will have no effect except to trigger this event. This actually sounds really fun, and I'd love to see it: let me know if you want to go ahead and make it and need any help :)

Icehawk78 wrote:Another question, which I've not been able to discern:

Is it possible to have an event require you to not have something? Such as having a "pacifist" option which is only available if you *don't* have any weapons, or an "anti-mantis" event that doesn't let you help if you have a Mantis on the crew?
More or less. You need to use the technique described in the X-dependent events thread. The option when you have a Mantis will show up blue, but it'll be the only option. The option when you don't have a Mantis will show up white, and will also be the only option, and will be required to have the text "Continue...", but it can do something completely different and better if you wish.
theDoomBox

Re: [MODDING] I made a tutorial: create custom events & sect

Postby theDoomBox » Sun Mar 02, 2014 11:43 pm

Hey, I'm having a slight problem with this. After everything is in place, I try to run unpack_data.bat, but I get the error "Windows cannot find '..\ftldat'." Can anyone enlighten me in this matter? Thanks ;)

EDIT: So I don't get that error anymore, but when I try to run "unpack_data.bat", From what I can tell it does almost nothing, except open a console for a split second before closing

Who is online

Users browsing this forum: No registered users and 37 guests