Nifflas' Support Forum

Level Editing Support => Knytt Stories Level Editing Support => Topic started by: Fubaka on April 20, 2016, 12:51:28

Title: A Warp requiring three Flags...
Post by: Fubaka on April 20, 2016, 12:51:28
So in my upcoming level, I need a warp that functions only if three Flags are all set on. I've been storming about trying to find a solution to this problem, but nothing has worked so far.

My last strategy was to have three separate screens, each warping to the next if the right flag was set, but that didn't work. Only the first one triggered.

Anyone have any ideas?

Note: I do have a fallback plan if this can't be made to work, but it'd be a bit of extra work to implement.
Title: Re: A Warp requiring three Flags...
Post by: sergiocornaga on April 20, 2016, 13:10:57
It would be a lot easier to have a warp that only doesn't function if three flags are all set off, so I'd recommend that approach. Or is that already your fallback plan?

Example below just in case my wording isn't clear.

Code: [Select]
FlagWarpX(A)=1
FlagWarpX(B)=1
FlagWarpX(C)=1
Flag(A)=0
Flag(B)=1
Flag(C)=2
Title: Re: A Warp requiring three Flags...
Post by: Vegetal Gibber on April 20, 2016, 14:15:50
If you're using KS+, there's a feature called "Flag All" that does exactly what you need. Just select "Flag All" in the level editor, set it to "True" (last option in the list) and set up the X-Y warp below. Then set Flags A, B and C to whatever you want.

Here's a World.ini code example:

Code: [Select]
[x1000y1000]
Flag(All)=True       ; Needed for this to work
Flag(A)=Power0    ; Choose the first flag
Flag(B)=Power1    ; 2nd flag
Flag(C)=Power2    ; 3rd flag
FlagWarpY(All)=-3 ; Warp 3 screens up if the player has the Run, Climb and Dbl-Jump powers.
Title: Re: A Warp requiring three Flags...
Post by: Fubaka on April 20, 2016, 19:30:04
It would be a lot easier to have a warp that only doesn't function if three flags are all set off, so I'd recommend that approach. Or is that already your fallback plan?

Example below just in case my wording isn't clear.

Code: [Select]
FlagWarpX(A)=1
FlagWarpX(B)=1
FlagWarpX(C)=1
Flag(A)=0
Flag(B)=1
Flag(C)=2

That is indeed my fallback plan. I will need to rearrange a lot of flag warps to make it work though. I suppose that's just what I'll have to do, since this is not a KS+ level.

Thanks for the support, guys.
Title: Re: A Warp requiring three Flags...
Post by: egomassive on April 20, 2016, 23:07:24
A long long time ago before the existence of KS+ I made 2 demo levels for someone wanting to open a door only when three switches were activated.
One Door, Three Switches (http://egomassive.com/nifflas/egomassive-OneDoorThreeSwitches.knytt.bin)
1 Door, 3 Switches, 2 Realities (http://egomassive.com/nifflas/egomassive-1Door3Switches2Realities.knytt.bin)
They use the same kind of logic seen in Shipwrecked. There are notes inside explaining how they work.

I must say though, that I like Sergio's idea. It is much more elegant.
Title: Re: A Warp requiring three Flags...
Post by: Fubaka on April 21, 2016, 00:13:01
A long long time ago before the existence of KS+ I made 2 demo levels for someone wanting to open a door only when three switches were activated.
One Door, Three Switches (http://egomassive.com/nifflas/egomassive-OneDoorThreeSwitches.knytt.bin)
1 Door, 3 Switches, 2 Realities (http://egomassive.com/nifflas/egomassive-1Door3Switches2Realities.knytt.bin)
They use the same kind of logic seen in Shipwrecked. There are notes inside explaining how they work.

I must say though, that I like Sergio's idea. It is much more elegant.

That's helpful. I could use something like this yet, or go with sergio's idea again. :P