[CODE] Found a way to make X-dependant events!

Discuss and distribute tools and methods for modding. Moderator - Grognak
Alblaka
Posts: 98
Joined: Thu Sep 20, 2012 1:41 pm

[CODE] Found a way to make X-dependant events!

Postby Alblaka » Sat Sep 22, 2012 2:42 pm

Tested example:

Code: Select all

<event name = "TUTORIAL_ENEMY">
   <text>Every new location will have an event like this. You might have multiple choices available to you at an event. In this example, a weak pirate ship is trying to destroy you.</text>
   <choice req="sensors" lvl="2" hidden="true">
      <text>Special BLUE choices like these are unlocked by having certain upgrades or equipment. They are nearly always a good choice.</text>
      <event>
         <text>Useless TEST text.</text>
         <ship load = "TUTORIAL_PIRATE" hostile="false"/>
      </event>
   </choice>
   <text>I don't want to see this.</text>
   <ship load = "TUTORIAL_PIRATE" hostile="true"/>
</event>

Used tutorial since the START-event denies being altered (or acts buggy)

Situation 1: Your ship does not have the requirement (tested it with Sensors 3, a thing the tutorial Kestrel does not have)
Game will display

Code: Select all

I don't want to see this.

1. Continue...


Situation 2: Your ship does have the requirement (as visible, Sensors 2, Tutorial Kestrel has this)
Game will display

Code: Select all

I don't want to see this.

1. Special BLUE choices like these are unlocked by having certain upgrades or equipment. They are nearly always a good choice.

Pirate will jump to neutral, indicating the choice is successfully picked.


Result:
I suspected the game to add a "Continue"-default choice whenever no choice is avaible (since this is pretty much done throughout the whole event files) and it appears I guessed right. By only giving a single 'requirement' choice, you can force the player to click this choice if requirement is true (since there are no other choices). If requirement is false, the game adds a generic continue. You can now add different event-load's to the two outcomes and proceed accordingly.

It is now officially possible to make events which 'automatically' can react to the player's status, f.e. armament, crewmembers, augments, etc...

PS: For people not that much into FTL-scripting: I'm not talking about how to add blue choices, I'm talking about a workaround to force people into picking blue choices if avaible.
Greetz,
Alblaka
SSk77
Posts: 57
Joined: Fri Sep 21, 2012 8:09 pm

Re: [CODE] Found a way to make X-dependant events!

Postby SSk77 » Sat Sep 22, 2012 2:58 pm

Nice Alblaka, always expert on coding.
This will help many people.

Also, I'm having a problem with my mod:

Image

I'm getting this error when I launch the game, do you know why that's happening ?
Alblaka
Posts: 98
Joined: Thu Sep 20, 2012 1:41 pm

Re: [CODE] Found a way to make X-dependant events!

Postby Alblaka » Sat Sep 22, 2012 2:59 pm

SSk77 wrote:Also, I'm having a problem with my mod:

Image

I'm getting this error when I launch the game, do you know why that's happening ?


Possible causes:
1. Syntax error, aka you have a typo SOMEWHERE in your files.
2. If you're using GMM: UTF-8 formatted XML files can cause that issue, use ANSI instead.
3. Something unknown.
Greetz,
Alblaka
SSk77
Posts: 57
Joined: Fri Sep 21, 2012 8:09 pm

Re: [CODE] Found a way to make X-dependant events!

Postby SSk77 » Sat Sep 22, 2012 3:02 pm

I grant you it's something unknown so.....

I just rewritten 3 times! in ANSI and that keeps occurring.
cogitator
Posts: 35
Joined: Sat Oct 06, 2012 1:04 pm

Re: [CODE] Found a way to make X-dependant events!

Postby cogitator » Mon Oct 15, 2012 10:30 pm

Sorry to necro a dead post, but looking for some more details on this. How does the game decide which event to load if you don't meet the special requirements? Is it just the event outside the choice? I guess I'm looking for a functional example... Does anyone have one?
First playable release of Extra Scoop is out! Download Link!
Whale Cancer
Posts: 272
Joined: Fri Sep 21, 2012 3:28 pm

Re: [CODE] Found a way to make X-dependant events!

Postby Whale Cancer » Mon Oct 15, 2012 10:42 pm

Alblaka wrote:Used tutorial since the START-event denies being altered (or acts buggy)


Modify START_BEACON instead.
Contribute to help save the Whales from their various diseases! *DELAYED* Should release the skeleton with the main quests attached by the end of the week (By NOV 9)! *DELAYED* Don't listen to my dates! Things always seem to come up!