Way to check for something constantly

Discuss and distribute tools and methods for modding. Moderator - Grognak
Post Reply
DocterNope
Posts: 2
Joined: Thu Feb 11, 2016 4:51 am

Way to check for something constantly

Post by DocterNope »

Hello, I am currently trying to make a mod for FTL, but have encountered a snag that is halting development. Basically I need an event or way to trigger one that happens constantly. Basically I want to make it so having 100 scrap at any given time will bring down your scrap to 0 and do some damage to your hull. I know how to do that by itself, but I can't find an event that happens constantly. Any suggestions for one? If need be I will take one that happens every jump.
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: Way to check for something constantly

Post by kartoFlane »

Not really possible, there's no way to check something continuously and trigger an event based on that. Best you could do would be having the same event occur on every jump, but then you'd only ever encounter that one event all game long.
Superluminal2 - a ship editor for FTL
stargateprovider
Posts: 229
Joined: Thu Oct 03, 2013 1:21 pm

Re: Way to check for something constantly

Post by stargateprovider »

kartoFlane wrote:Not really possible, there's no way to check something continuously and trigger an event based on that. Best you could do would be having the same event occur on every jump, but then you'd only ever encounter that one event all game long.
You could do this, if you add this event that checks for scrap at the beginning of every event in the game. However, that's a lot of work. Maybe you could make one check-event for every sector and then fill the entire sector with only that event. The check-event would then check for the scrap and always load a random sector-specific event after itself.
Some of my FTL mods you may like, or hate, or... yeah:
Image Image
User avatar
Sleeper Service
Posts: 2275
Joined: Sun Mar 24, 2013 8:49 pm

Re: Way to check for something constantly

Post by Sleeper Service »

DocterNope wrote: Hello, I am currently trying to make a mod for FTL, but have encountered a snag that is halting development. Basically I need an event or way to trigger one that happens constantly. Basically I want to make it so having 100 scrap at any given time will bring down your scrap to 0 and do some damage to your hull. I know how to do that by itself, but I can't find an event that happens constantly. Any suggestions for one? If need be I will take one that happens every jump.
Would work as a baseline, but subsequent event lists can't provide the same event-seeding mechanics that sector blueprints offer. Sector blueprints can guarantee that certain events happen (stores for example). It would also screw with event labelling on the map, and even with nebula spawning. Depending on what OP wants to do with it that might still be sufficient I guess.

To exactly implement what DocterNope wants one could create _SCRAP_CHECK variants of every single event in the game that then lead to the actual events individually. That could preserve vanilla event seeding, but would be a pretty insane amount of work.
Image
Working on a sci-fi deckbuilder nowadays.
Other games I made.
meklozz
Posts: 350
Joined: Wed Sep 23, 2015 9:11 am

Re: Way to check for something constantly

Post by meklozz »

Since changing the beginnings of events would be a lot of work, and likely to create problems with the map, like Sleeper Service has said, maybe adding it at the end would work.

Basically, doing a search for any event that is either empty (<event/>, you may also have to avoid the ones with load="".. not sure if an event with both load="" and a new added choice would default to load anyway, which would be convenient here, or not) or doesn't contain a <choice>? If you found a way to exclude surrender/damage events (not sure if they are in separate files or have anything specifically exclusive to them, if not it could be a problem), you should be able to get a check at virtually every beacon in the game.

Of course, giving up on the advanced tags and working with some other tool to change and upload whole event files would be easier, but much less compatible.

@edit
Something like this:

Code: Select all

<mod:findLike type="event">
	<mod-append:choicetemp/>
	<mod-append:texttemp/>
</mod:findLike>
<mod:findWithChildLike type="event" child-type="choice">
	<mod:findLike type="choicetemp">
		<mod:removeTag/>
	</mod:findLike>
</mod:findWithChildLike>
<mod:findWithChildLike type="event" child-type="text">
	<mod:findLike type="texttemp">
		<mod:removeTag/>
	</mod:findLike>
</mod:findWithChildLike>
<mod:findWithChildLike type="event" child-type="texttemp">
	<mod-append:text>Scrap amount needs to be verified.</mod-append:text>
</mod:findWithChildLike>
<mod:findWithChildLike type="event" child-type="choicetemp">
	<mod-append:choice hidden="true" req="pilot">
		<text>Verify scrap.</text>
		<event/>
	</mod-append:choice>
</mod:findWithChildLike>
<mod:findLike type="event">
	<mod:findLike type="choicetemp">
		<mod:removeTag/>
	</mod:findLike>
	<mod:findLike type="texttemp">
		<mod:removeTag/>
	</mod:findLike>
</mod:findLike>
Post Reply