Page 1 of 1

Replacing The Start Event

Posted: Sun May 19, 2019 8:56 am
by TeamEXAngus
Hi,

I'm trying to replace the start event to add my own story to the game, however I cannot get a second text box to generate. Could anyone tell me how to get it to work?

Code: Select all

<event name="START_GAME">
   <text>Your ship's computer alerts you that you have exited hyperspace. You look around for whoever hired you, but no one sticks out in the traffic coming and going at this beacon.</text>
   <choice hidden="true">
   <text>Continue...</text>
      <event load="VERITY_START_1" />
   </choice>
</event>

<event name="VERITY_START_1">
   <text>Your computer informs you that your employer is sending you their coordinates. They direct you to a small station behind nearby moon.</text>
   <choice hidden="true">
   <text>Continue...</text>
      <event load="VERITY_START_2" />
   </choice>
</event>

<event name="VERITY_START_2">
   <text>You dock with the station and come aboard. It is a run down Federation station, the type often used by pirates.</text>
</event>


Thanks

Re: Replacing The Start Event

Posted: Sun May 19, 2019 6:34 pm
by mr_easy_money
TeamEXAngus wrote:Hi,

I'm trying to replace the start event to add my own story to the game, however I cannot get a second text box to generate. Could anyone tell me how to get it to work?

the problem is that by default, START_GAME only gives the text for the first event of the game (and the second tip paragraph is loaded from TIPS_LIST_PC in newEvents.xml). the event that actually does the event (second and further text boxes) is START_BEACON.

but START_BEACON is also used as the start event in civilian sectors, so the fix imo is to replace the very first event with START_GAME itself since it already does the text, so it can handle both text and event stuff.

so basically the fix is, just make a file called sector_data.xml.append and pop this in there, then it should work:

Code: Select all

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

(uses slipstream tags: it finds the starting sector called STANDARD_SPACE and overwrites its starting event to START_GAME. the slipstream tags let us change only what we want to change, and not overwrite everything in the process)

Re: Replacing The Start Event

Posted: Mon May 20, 2019 6:26 am
by TeamEXAngus
mr_easy_money wrote:so basically the fix is, just make a file called sector_data.xml.append and pop this in there, then it should work:

Code: Select all

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

(uses slipstream tags: it finds the starting sector called STANDARD_SPACE and overwrites its starting event to START_GAME. the slipstream tags let us change only what we want to change, and not overwrite everything in the process)


Thanks for the help!
After a long and late night, and a much more successful second day, I have been playing around with events, mostly through trial and error. I've managed to get it working, though.

My code is this for anyone else having trouble. Feel free to adapt it for whatever you're doing.

Code: Select all

<event name="START_BEACON">
   <text>Welcome to the Bounty Hunters mod by TeamEXAngus! This mod adds unique ships, characters, and stories to the world of FTL. Pick a story to begin.</text>
   <choice hidden="true">
      <text>Skip Story/No Story</text>
      <event />
   </choice>
   <choice req="engines" lvl="1" hidden="true">
      <text>(Verity Quinn) You are Verity Quinn, a famous Bounty Hunter who has just been hired by a mysterious contractor.</text>
      <event load="GET_VERITY" />
   </choice>
</event>

Re: Replacing The Start Event

Posted: Mon May 20, 2019 7:22 am
by mr_easy_money
TeamEXAngus wrote:My code is this for anyone else having trouble. Feel free to adapt it for whatever you're doing.

Code: Select all

<event name="START_BEACON">
   <text>Welcome to the Bounty Hunters mod by TeamEXAngus! This mod adds unique ships, characters, and stories to the world of FTL. Pick a story to begin.</text>
   <choice hidden="true">
      <text>Skip Story/No Story</text>
      <event />
   </choice>
   <choice req="engines" lvl="1" hidden="true">
      <text>(Verity Quinn) You are Verity Quinn, a famous Bounty Hunter who has just been hired by a mysterious contractor.</text>
      <event load="GET_VERITY" />
   </choice>
</event>

well as I slightly noted, using START_BEACON has two issues:

1. START_BEACON's text does not show up on the very first event of the game, so everything you have in the <text> field will be ignored, need START_GAME for the first paragraph and TIPS_LIST_PC for the second (tip) paragraph

2. START_BEACON is not only the event for the very first beacon of the game, but also for civilian sectors... so creating choices etc will affect the civilian start beacons too... that is, your event will occur at the beginning of civilian sectors as well.

~~~ to avoid this, you either use START_GAME as the starting event as I described instead of START_BEACON and add that thing to sector_data. or you change the civilian starting beacons to another event, but in my opinion that gives rise to poor compatibility with other mods, when you only really want to change the starting event, and well you also still have to use START_GAME anyway for the first text.

so to make it clear, if you change the above event's name to START_GAME and use the code I provided, there shouldn't be any problems.

Re: Replacing The Start Event

Posted: Mon May 20, 2019 8:59 am
by TeamEXAngus
mr_easy_money wrote:1. START_BEACON's text does not show up on the very first event of the game, so everything you have in the <text> field will be ignored, need START_GAME for the first paragraph and TIPS_LIST_PC for the second (tip) paragraph

This was my first thought when it didn't work. I found the text_events.xml and changed it before I first posted, when the event wasn't working. I had the event under a different name while testing, and just changed it once I got the event working, so I didn't bother to remove the <text></text> field.

mr_easy_money wrote:2. START_BEACON is not only the event for the very first beacon of the game, but also for civilian sectors... so creating choices etc will affect the civilian start beacons too... that is, your event will occur at the beginning of civilian sectors as well.


I've done something very crudely, and set the SECTOR_DEFAULT to unique, so it only appears once. This is because of the reasons you mentioned above, but also because I've made the Civ sector much kinder to the player. It will be something I change if this mod takes off, but it's not a big deal atm.

Thanks again for your help!

Re: Replacing The Start Event

Posted: Mon May 20, 2019 9:20 am
by mr_easy_money
TeamEXAngus wrote:I've done something very crudely, and set the SECTOR_DEFAULT to unique, so it only appears once.

I'm sorry, but I don't get what you mean by this...? The STANDARD_SPACE sector only appears once anyway, it's the starting sector. Making it unique won't change anything because it's not in any sector lists anyway -- but the civilian sector will still be affected by the change to START_BEACON.
TeamEXAngus wrote:...I've made the Civ sector much kinder to the player.

oh, well if you are going to change the civilian sector anyways then you don't need to really worry about this, just give it a different start event (or the same one: it's up to you :))

Re: Replacing The Start Event

Posted: Mon May 20, 2019 9:45 am
by TeamEXAngus
mr_easy_money wrote:
TeamEXAngus wrote:I've done something very crudely, and set the SECTOR_DEFAULT to unique, so it only appears once.

I'm sorry, but I don't get what you mean by this...? The STANDARD_SPACE sector only appears once anyway, it's the starting sector. Making it unique won't change anything because it's not in any sector lists anyway -- but the civilian sector will still be affected by the change to START_BEACON.


Really? I was unaware standard space and civillian were different! Thanks for that!