Page 1 of 1
Way to check for something constantly
Posted: Tue Feb 16, 2016 5:37 am
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.
Re: Way to check for something constantly
Posted: Tue Feb 16, 2016 1:49 pm
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.
Re: Way to check for something constantly
Posted: Tue Feb 16, 2016 3:40 pm
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.
Re: Way to check for something constantly
Posted: Tue Feb 16, 2016 3:55 pm
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.
Re: Way to check for something constantly
Posted: Tue Feb 16, 2016 4:48 pm
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>