[MOD] Civilian Start Beacon

Distribute and discuss mods that are functional. Moderator - Grognak
RubbishDave
Posts: 6
Joined: Tue Jun 12, 2018 6:20 pm

[MOD] Civilian Start Beacon

Postby RubbishDave » Tue Jun 12, 2018 6:35 pm

Civilian Start Beacon is an alternative to "Universal Starting Beacon" for those who only use one mod that uses a custom START_BEACON event at a time.
Download it here.

For a long time, there has been no easy, clean way of changing what happens at the very first beacon of the game. Either a mod changed what happened at the start of the game but also at the start of every Civilian Sector (like the "Beginning Scrap Advantage" demo mod), or overly-complicated workarounds (like "Universal Starting Beacon" aka mod framework) had to be used, requiring chain-loading of events and making mod creation more difficult than it needs to be. But no more!

The way the vanilla game works, the START_BEACON event is the default on which the first beacon of any sector will fall back on if there is no other specified event for that beacon. As it turns out, every other sector has it's own type of START_BEACON event EXCEPT for Civilian Sectors, causing every Civilian Sector to use the default START_BEACON event. Reading through the XML makes it look very much as if this is an oversight, something that just got forgotten to be finished. So I finished it.

Civilian Start Beacon does not modify START_BEACON or START_GAME! It in no way affects the beginning of a new game by itself, but it does make it possible for other mods to do so without resulting to workarounds or other fancy trickery, while ensuring that any changes to the START_BEACON event happen only at the start of a new game and do not repeat themselves at every Civilian Sector. I have added back in the commented-out START_BEACON_CIVILIAN event and finished the rest of the stuff required to make it work that marked as "Justin to do." The result is that the start beacon of Civilian Sectors no longer fall back on the default START_BEACON event, and thus do not reactivate any custom events that other mods place there. Additionally, there is now less generic text shown at the start of Civilian Sectors.

Note that, while this is, in my opinion, cleaner than the "Universal Starting Beacon" mod, it will only allow one mod to make changes to the START_BEACON event at a time. If you use multiple mods that alter the start of the game, this mod is not the solution for you. However, there is nothing that makes this mod incompatible with "Universal Starting Beacon," so both can be used.
User avatar
mr_easy_money
Posts: 625
Joined: Fri May 29, 2015 9:05 pm

Re: [MOD] Civilian Start Beacon

Postby mr_easy_money » Thu Jun 14, 2018 10:52 pm

RubbishDave wrote:For a long time, there has been no easy, clean way of changing what happens at the very first beacon of the game.

Sure there is: just change the first event of the game to your own custom event. I've just realized this now, but the best choice is START_GAME, since its text (along with the textList TIPS_LIST_PC in newEvents.xml) is hardcoded to be placed at the beginning of a run anyways. Coding this in is pretty simple -- find the starting sector and change its starting event to START_GAME:

Code: Select all

<!-- place this in sector_data.xml.append -->
<mod:findName type="sectorDescription" name="STANDARD_SPACE">
   <mod-overwrite:startEvent>START_GAME</mod-overwrite:startEvent>
</mod:findName>
RubbishDave wrote:Either a mod changed what happened at the start of the game but also at the start of every Civilian Sector (like the "Beginning Scrap Advantage" demo mod)

Yeah... that's the big flaw in the demo mod... should be doing as above: create custom event and load custom event as STANDARD_SPACE startEvent.
RubbishDave wrote:or overly-complicated workarounds (like "Universal Starting Beacon" aka mod framework) had to be used, requiring chain-loading of events and making mod creation more difficult than it needs to be.

The main selling point of Universal Starting Beacon is the chain-loading -- it makes multiple mods that change the very first event compatible with each other, so that all the custom starting events can play out. I guess if you don't really care for compatibility there's no need to figure out how to use it. It's not so bad though: either add choices to START_GAME_CHOICES or make it load your event first before others.
RubbishDave wrote:Reading through the XML makes it look very much as if this is an oversight, something that just got forgotten to be finished. So I finished it.
...
Additionally, there is now less generic text shown at the start of Civilian Sectors.

I think that adding stuff to civilian sectors will make people less inclined to use this mod... it may be better to just leave it as vanilla. Additionally for compatibility reasons use code like above to change one line of the civilian sector instead of overwriting the entire sector, even if it's the vanilla one. Maybe I want to play the balance mod. :wink:

My main problem with this mod is that... I don't see its need, much like how I wouldn't really want to need people to first load Universal Starting Beacon. If the point of your mod is to let START_BEACON stay untouched, that's just as well accomplished by the modder in the first place --> change the very first event to another event (by the code I provided above), which will always work since sector 1 is always STANDARD_SPACE.

Thinking further, I guess this mod fixes broken mods like Beginning Scrap Advantage, but then it's not really a solution to the problem. In my opinion, mods that want to add to the very first event should (by themselves) replace the startEvent of sector 1 with a custom event, which leaves START_BEACON for civilian sectors untouched.
RubbishDave
Posts: 6
Joined: Tue Jun 12, 2018 6:20 pm

Re: [MOD] Civilian Start Beacon

Postby RubbishDave » Thu Jun 14, 2018 11:14 pm

I get what you're saying, but I guess you miss the point in this entirely. Which is fine. It's fairly clear from going through the XML that exactly this was intended from the start. And it's nothing against Universal Start Beacon in any way. But for anybody who's just starting to learn how to mod, USB makes things confusing, and if all you want is for something like the demo mod to work, it doesn't have much use. Yes, the chain-loading is its major feature. If you aren't trying to chain-load things, it's not that big of a deal. And if you are, this doesn't conflict in any way. And it doesn't actually add anything to the Civilian Secotrs. It just changes the text. But I guess if there's no point in adding things, why are there even mods?
User avatar
mr_easy_money
Posts: 625
Joined: Fri May 29, 2015 9:05 pm

Re: [MOD] Civilian Start Beacon

Postby mr_easy_money » Thu Jun 14, 2018 11:46 pm

RubbishDave wrote:I get what you're saying, but I guess you miss the point in this entirely. Which is fine. It's fairly clear from going through the XML that exactly this was intended from the start. And it's nothing against Universal Start Beacon in any way.

Then what exactly is "the point"? If it's to enable changes to the START_BEACON event, like I said, a modder shouldn't do that in the first place. A modder should change sector 1's starting event to another event (START_GAME makes the most sense).
RubbishDave wrote:But for anybody who's just starting to learn how to mod, USB makes things confusing, and if all you want is for something like the demo mod to work, it doesn't have much use.

I will agree that USB does make things confusing for a beginner modder, what with all those slipstream tags, and yeah that's fair. I'm not exactly advocating for USB, I'm just saying it has its use, but it's not at all necessary. It tries to be a common standard, but it could also be improved.
RubbishDave wrote:If you aren't trying to chain-load things, it's not that big of a deal.

Well chain-loading is for compatibility with other mods. Chain-loading in my own mods may be possible, but it's not the intention. Chain-loading allows multiple different mods that change the very first event to all simultaneously retain what they added. So like if my ship mod gave crew members on the first event and your ship mod gives a quest, both would happen through chain-loading.

Which in my opinion is kinda overrated, as most mods like that are not designed to be used with other mods that also change the very first event, but maybe some mods would want to support it? Maybe like pairing a mod that adds lots of lore with a ship mod that gives crew members would be a good use of USB.
RubbishDave wrote:And it doesn't actually add anything to the Civilian Secotrs. It just changes the text.

Changing the text is adding new text. That's what I meant by adding stuff to civilian sectors. I think that not everyone will want to use it -- if the point is a "bugfix" to let mods change START_BEACON, people may not want to use it if it also changes the game from vanilla.
RubbishDave
Posts: 6
Joined: Tue Jun 12, 2018 6:20 pm

Re: [MOD] Civilian Start Beacon

Postby RubbishDave » Fri Jun 15, 2018 3:56 am

mr_easy_money wrote:change sector 1's starting event to another event (START_GAME makes the most sense).

START_GAME only changes the text of the START_BEACON event for sector 1, and making said text something else is the only change one can make to START_GAME. Unless something has changed within the game in the last year that I'm unaware of, which is possible.

mr_easy_money wrote:Well chain-loading is for compatibility with other mods. Chain-loading in my own mods may be possible, but it's not the intention. Chain-loading allows multiple different mods that change the very first event to all simultaneously retain what they added. So like if my ship mod gave crew members on the first event and your ship mod gives a quest, both would happen through chain-loading.

Yeah, I get that. And if that's what the person playing wants, USB is great for that. If they want something like Beginning Scrap Advantage to work only in the beginning, as the name implies, they can't just drop it and USB in their mods folder and end up with the results they are probably expecting.

mr_easy_money wrote:Which in my opinion is kinda overrated, as most mods like that are not designed to be used with other mods that also change the very first event, but maybe some mods would want to support it? Maybe like pairing a mod that adds lots of lore with a ship mod that gives crew members would be a good use of USB.

Obviously I did an extremely poor job expressing myself, as this is exactly what I was getting at, in part. USB has its uses, but as a means of being a way to prevent "simple" mods that are intended to do something only once at the start and not repeat at every Civilian Sector, it's just not the solution.

mr_easy_money wrote:people may not want to use it if it also changes the game from vanilla.

Look, I know I seem like it, but I'm really not trying to be a complete d***. I get (or at least believe) that you're trying to be helpful. But if somebody doesn't want something that "changes the game from vanilla," why are they getting mods at all? And, to answer your initial question, the whole point is that this was supposed to be in vanilla. The start of it is already in the vanilla XML files, but was commented out because the rest of it was never finished. It's one of the many things with a big "JUSTIN - TO DO!" comment beside it. The START_BEACON event wasn't intended to run at the beginning of Civilian Sectors based on what's in the XML comments. So I made this to 1. finish the unfinished work and 2. give a simple solution for "simple" mods that use that START_BEACON event to work the way they're intended to. If you don't like it or you see no use for it that's fine. I'm not asking you, or anyone, to use it. I'm just offering it for those who might want to use it.
To me, a lot of the mods here are uninteresting. I either dislike or just have no interest in what they do. But I know other people disagree, which is why I don't go to the comments of those mods and say "Your mod is useless and pointless." If somebody made a mod that turned the artwork for every ship into a penis, I'd just say "Oh jeez" and move on.
By the way, I just actually read your sig. So again, I get that you're just trying to be helpful, and I'm really not an ass. Well, I am, but I'm not trying to be here. My little brain no workey so goodey these days, and what may seem like hostility on my part is frustration in not being able to get across what I mean. And maybe what's being taken as hostility from you is frustration in not being able to clearly understand what I'm being told.
User avatar
mr_easy_money
Posts: 625
Joined: Fri May 29, 2015 9:05 pm

Re: [MOD] Civilian Start Beacon

Postby mr_easy_money » Fri Jun 15, 2018 9:33 pm

RubbishDave wrote:
mr_easy_money wrote:change sector 1's starting event to another event (START_GAME makes the most sense).

START_GAME only changes the text of the START_BEACON event for sector 1, and making said text something else is the only change one can make to START_GAME. Unless something has changed within the game in the last year that I'm unaware of, which is possible.

yeah this is probably where the confusion is coming from. "START_GAME only changes the text" of the very first event of the game, not necessarily START_BEACON. in vanilla, this is START_BEACON, but it can be changed to another event! If the game's very first event is no longer START_BEACON, the START_BEACON event is only tied to civilian sectors. Also, while we can choose/create any event to be the game's very first event, it's best to choose START_GAME itself, because START_GAME is hardcoded to give text to the very first event --> which is now START_GAME! When we edit START_GAME's text, it will show up where we expect it to, which wouldn't happen if we chose some other event.

This solves the problem Beginning Scrap Advantage has (shows up in civilian sectors, should only be start of game) --> in fact, just to be even more clear, let's go fix Beginning Scrap Advantage!

Add this to sector_data.xml.append in the Beginning Scrap Advantage mod. This is where we change the very first event of the game to another event, and as I said earlier, START_GAME is the best choice:
mr_easy_money wrote:

Code: Select all

<mod:findName type="sectorDescription" name="STANDARD_SPACE">
   <mod-overwrite:startEvent>START_GAME</mod-overwrite:startEvent>
</mod:findName>

if slipstream tags are confusing, this is akin to writing this (basically what you do in your mod but instead of for CIVILIAN_SECTOR, we're doing it for STANDARD_SPACE, which is always the first sector):

Code: Select all

<sectorDescription name="STANDARD_SPACE" minSector="0" unique="false">
   <nameList>
      <name id="sectorname_STANDARD_SPACE" short="sectorname_short_STANDARD_SPACE"/>
   </nameList>
   <trackList>
      <track>civilian</track>
      <track>cosmos</track>
      <track>milkyway</track>
      <track>lostship</track>
   </trackList>
   <startEvent>START_GAME</startEvent>
   <event name="STORE" min="1" max="2"/>
   <event name="ITEMS" min="1" max="1"/> <!--DLC - CHanged from 1/2-->
   <event name="NEUTRAL_CIVILIAN" min="2" max="4"/>
   <event name="NOTHING" min="1" max="2"/>
   <event name="DISTRESS_BEACON" min="1" max="2"/>
   <event name="HOSTILE_CIVILIAN" min="4" max="6"/>
   <event name="NEBULA" min="0" max="4"/>
   <event name="QUESTS" min="1" max="1"/>
   <event name="HOSTILE1" min="2" max="2"/>
   <event name="HOSTILE_BOARDING" min="0" max="0"/>
</sectorDescription>

except instead of overwriting the entire sector (and thereby any other changes to the STANDARD_SPACE sector a previous mod makes), the slipstream tags only change one line, as we only need to change one line.

The new version of events.xml.append in the Beginning Scrap Advantage mod. Here we're just moving the START_BEACON event's stuff to START_GAME.

Code: Select all

<event name="START_GAME">
   <text>The data you carry is vital to the remaining Federation fleet. You'll need supplies for the journey, so make sure to explore each sector before moving on to the next. But get to the exit before the pursuing Rebel fleet can catch up!</text>
   <choice hidden="true">
      <text>Continue...</text>
      <event/>
   </choice>
   <choice req="engines" lvl="1" hidden="true">
      <text>(Mod) Strip a near-by asteroid for scrap.</text>
      <event>
         <text>You take a shuttle and grab as much metal as you can.</text>
         <autoReward level="HIGH">scrap_only</autoReward>
      </event>
   </choice>
</event>

Here's a download link to the "new and improved" Beginning Scrap Advantage: https://www.dropbox.com/s/t0eqae1may65d ... 3.ftl?dl=0

What I'm trying to get at is that makers of mods should not be editing START_BEACON at all. They should adapt this format (create new custom event and make it the very first event). That's why I said I don't see a point to your mod (the bugfixing part, not the new text).
RubbishDave wrote:Civilian Start Beacon does not modify START_BEACON or START_GAME! It in no way affects the beginning of a new game by itself, but it does make it possible for other mods to do so without resulting to workarounds or other fancy trickery

If the point of your mod is to enable "other mods" to modify START_BEACON, they should not be doing that in the first place! The mods themselves should change the very first event to their own custom event. To me, START_GAME is the best choice for a custom event for reasons I said earlier, but it can be anything.

If you think the code I've written is "fancy trickery", it isn't. It's very similar to your code, just with slipstream tags instead to be more compatible.
RubbishDave wrote:If they want something like Beginning Scrap Advantage to work only in the beginning, as the name implies, they can't just drop it and USB in their mods folder and end up with the results they are probably expecting.

yeah this is a very good point. Universal Starting Beacon seems geared towards beginners -- "use this, it's compatibility!" -- but it's kind of high-level, as Kieve says in the thread, his cranium is fried thinking of how to use the code. so I think one should look into USB if one wants compatibility, and only then. probably. Though, it seems like if it's a mod framework, in theory every mod that changes the very first event should support it --- but that's quite an ask, and not many people have supported it.
RubbishDave wrote:But if somebody doesn't want something that "changes the game from vanilla," why are they getting mods at all?

for a bugfix. I thought that was the whole point of this mod... it lets you edit START_BEACON like in the demo mod without any side-effects. It seems evident however that the extra stuff you added was so that there is more to this mod than just a bugfix.
RubbishDave wrote:And, to answer your initial question, the whole point is that this was supposed to be in vanilla. The start of it is already in the vanilla XML files, but was commented out because the rest of it was never finished. It's one of the many things with a big "JUSTIN - TO DO!" comment beside it.

Yeah but it was never finished, so it's not "official" vanilla. I'm trying to tell you that some people are very particular about their mod tastes. But since the idea is that modders should use this mod behind their mods, they could just as easily change that part back to vanilla, thanks to the fact that modding in FTL is pretty straightforward to do. So it's no big deal.

And just to add, the different texts you've added will no doubt make the start of civilian sectors less boring. "Welcome to a new sector! Get to the exit beacon and jump to the next sector before the pursuing Rebels catch you!" is all vanilla has to say? For crying out loud, that didn't even have to be said! At least give me a tiny bit about the sector instead of something I already know. :roll:
Rubbishdave wrote:If somebody made a mod that turned the artwork for every ship into a penis, I'd just say "Oh jeez" and move on.

haha the vanilla Federation player ships are already like that :lol:
RubbishDave
Posts: 6
Joined: Tue Jun 12, 2018 6:20 pm

Re: [MOD] Civilian Start Beacon

Postby RubbishDave » Sat Jun 16, 2018 4:35 pm

mr_easy_money wrote:The new version of events.xml.append in the Beginning Scrap Advantage mod. Here we're just moving the START_BEACON event's stuff to START_GAME.

Code: Select all

<event name="START_GAME">
   <text>The data you carry is vital to the remaining Federation fleet. You'll need supplies for the journey, so make sure to explore each sector before moving on to the next. But get to the exit before the pursuing Rebel fleet can catch up!</text>
   <choice hidden="true">
      <text>Continue...</text>
      <event/>
   </choice>
   <choice req="engines" lvl="1" hidden="true">
      <text>(Mod) Strip a near-by asteroid for scrap.</text>
      <event>
         <text>You take a shuttle and grab as much metal as you can.</text>
         <autoReward level="HIGH">scrap_only</autoReward>
      </event>
   </choice>
</event>



Ah, here's where the problem was. Last I knew/tried, adding anything other than text to START_BEACON (so choices, events, etc.) didn't do anything.

mr_easy_money wrote:I thought that was the whole point of this mod... it lets you edit START_BEACON like in the demo mod without any side-effects. It seems evident however that the extra stuff you added was so that there is more to this mod than just a bugfix. And just to add, the different texts you've added will no doubt make the start of civilian sectors less boring. "Welcome to a new sector! Get to the exit beacon and jump to the next sector before the pursuing Rebels catch you!" is all vanilla has to say? For crying out loud, that didn't even have to be said! At least give me a tiny bit about the sector instead of something I already know. :roll:

While working on my [url="https://www.subsetgames.com/forum/viewtopic.php?f=11&t=33329"]Build Your Own Ship mod[/url], and under the impression nothing functional could be added to START_GAME, I needed a way to keep the Civilian Sectors from triggering my beginning events. I was actually going through the XML to see if there was anything in it that made START_GAME behave the way it did (or I thought it did), and came across the commented-out START_BEACON_CIVILIAN. It was obvious right away that adding it back in and finishing it off would do the trick, and at the time made more sense to me than using USB, so I ran with it. It seemed like it might be useful to somebody, and made for a far less boring start to those sectors than the fall-back text that it seems to me was never meant to be displayed. That's why it's so generic: it's essentially just an error handler, the "catch" after a failed "try - START_BEACON_CIVILIAN."

mr_easy_money wrote:haha the vanilla Federation player ships are already like that :lol:

:lol: