Page 1 of 1

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

Posted: Sat Sep 22, 2012 2:42 pm
by Alblaka
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.

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

Posted: Sat Sep 22, 2012 2:58 pm
by SSk77
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 ?

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

Posted: Sat Sep 22, 2012 2:59 pm
by Alblaka
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.

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

Posted: Sat Sep 22, 2012 3:02 pm
by SSk77
I grant you it's something unknown so.....

I just rewritten 3 times! in ANSI and that keeps occurring.

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

Posted: Mon Oct 15, 2012 10:30 pm
by cogitator
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?

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

Posted: Mon Oct 15, 2012 10:42 pm
by Whale Cancer
Alblaka wrote:Used tutorial since the START-event denies being altered (or acts buggy)
Modify START_BEACON instead.