Replacing The Start Event

Discuss and distribute tools and methods for modding. Moderator - Grognak
TeamEXAngus
Posts: 38
Joined: Thu May 17, 2018 5:38 am
Location: TeamEX Headquarters
Contact:

Replacing The Start Event

Postby TeamEXAngus » Sun May 19, 2019 8:56 am

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
User avatar
mr_easy_money
Posts: 610
Joined: Fri May 29, 2015 9:05 pm
Location: A galaxy far, far away

Re: Replacing The Start Event

Postby mr_easy_money » Sun May 19, 2019 6:34 pm

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)
TeamEXAngus
Posts: 38
Joined: Thu May 17, 2018 5:38 am
Location: TeamEX Headquarters
Contact:

Re: Replacing The Start Event

Postby TeamEXAngus » Mon May 20, 2019 6:26 am

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>
User avatar
mr_easy_money
Posts: 610
Joined: Fri May 29, 2015 9:05 pm
Location: A galaxy far, far away

Re: Replacing The Start Event

Postby mr_easy_money » Mon May 20, 2019 7:22 am

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.
TeamEXAngus
Posts: 38
Joined: Thu May 17, 2018 5:38 am
Location: TeamEX Headquarters
Contact:

Re: Replacing The Start Event

Postby TeamEXAngus » Mon May 20, 2019 8:59 am

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!
User avatar
mr_easy_money
Posts: 610
Joined: Fri May 29, 2015 9:05 pm
Location: A galaxy far, far away

Re: Replacing The Start Event

Postby mr_easy_money » Mon May 20, 2019 9:20 am

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 :))
TeamEXAngus
Posts: 38
Joined: Thu May 17, 2018 5:38 am
Location: TeamEX Headquarters
Contact:

Re: Replacing The Start Event

Postby TeamEXAngus » Mon May 20, 2019 9:45 am

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!

Who is online

Users browsing this forum: No registered users and 9 guests