who needs fancy cutscene scripting when IEnumerable is like, *right there*

#GameDev

C# can be your scripting language if you try hard enough

by the way this is pretty much exactly how i did all the sequences in super bernie world (end of stage, castle drop, final boss, and death sequences)

i just didn't have the same tidy scaffolding, they were just special cased to run at the right times. but they were just manipulating the game via IEnumerable and yield

anyway if you like this kinda shit check out CoSharp my coroutines library https://github.com/Enichan/CoSharp
GitHub - Enichan/CoSharp: Lua style coroutines for C# with Unity style waiting

Lua style coroutines for C# with Unity style waiting - GitHub - Enichan/CoSharp: Lua style coroutines for C# with Unity style waiting

GitHub
@eniko same thing I did for the script reader in LF once you get past the "script format" stuff
@eniko "cutscenes" in Kandria are basically just weird quests with tasks that complete themselves after running some code. Works surprisingly well :v

@eniko I've also been doing some horrible things with this in Unity: https://www.nuget.org/packages/Microsoft.DotNet.Interactive.CSharp

Super useful!

Microsoft.DotNet.Interactive.CSharp 1.0.0-beta.22606.2

Microsoft.DotNet.Interactive.Kernel implementation for C#

@eniko just like I use C as my scripting language <.<
@eniko C# makes for a decent scripting language with LINQPad. I've often used it to develop, test, and run complex one-off scripts without having to create a whole .NET project.
@dHeinemann ohh linqpad looks nice, hadn't heard of that before

@eniko Generators are massively versatile, although I still dislike the syntax...

I also like how they are compatible with Linq. I find that very useful for some lower-level processing, like I am currently generating geometry at runtime and streaming vertices through a series of transforms and filters to get the ones you need is pretty compact and understandable...

@eniko now I'm scared to ask, what would be the "right" way to do this
@oledfish probably some domain specific scripting language? maybe a whole dang framework with tooling that lets designers/writers write branching narratives and stuff and then an additional runtime on top of that that integrates into your engine
@eniko @oledfish while it may be not very user friendly, for game designers or artists, this does look like a robust and elegant solution.
@maid @oledfish yeah since i have to do the work of integrating the script and fleshing out any action inside the cutscenes anyway i figured it was just easier to do it like this
@eniko yaaay coroutines

@lisyarus i made a whole coroutine library actually! https://github.com/Enichan/CoSharp

although im not using it here for ... reasons

GitHub - Enichan/CoSharp: Lua style coroutines for C# with Unity style waiting

Lua style coroutines for C# with Unity style waiting - GitHub - Enichan/CoSharp: Lua style coroutines for C# with Unity style waiting

GitHub
@eniko So cool! C++ has coroutines now but I haven't had the chance to play with them.