Alexofp / BDCC

Text based game about being a prisoner in a space prison with a lot of adult themes. Working title is Broken Dreams Correctional Center or BDCC for short. Test the latest version here: (could be unstable)
https://alexofp.github.io/BDCC/
MIT License
145 stars 45 forks source link

Suggestion for calling flags from other packs #101

Open Bjorn0411 opened 2 months ago

Bjorn0411 commented 2 months ago

Currently, its quite easy to set up a simple block that checks if a character exists from another datapack, and then, for example, switches out characters in scenes, or adds entire new scenes. You could create a questline for a character from a completely different pack, allowing a really cool level of collaboration.

However, whilst we can call characters no problem, we cant call other datapack flags. Meaning if we wanted to add additional scenes, or alternate paths, to quests, or add additional scenes to a character after they've had their quests completed, this is currently not possible. It's only possible to create fresh start stuff.

It'd be really cool if we could check for flags from other datapacks, even change them. It would open up a huge opportunity for collaborative packs.

A suggestion for implementation. Add a "get exists [datapack/mod]" codeblock to let you check if a thing exists, outputs as a boolean. this means you could add to any datapack or mod, without them having characters to check for. Then also, instead of the dropdown when selecting the flags in your datapack, it opens a menu with 3 tabs at the top, first is the flags in your datapack, 2nd is the flags in the base game, 3rd is all flags from other datapacks Or, keep the dropdown but a "more..." button at the bottom of the dropdown that opens this menu. As long as you only add calls for flags that might not exist, inside an if then block that checks if the datapack/mod exists, it shouldnt throw any errors.

CanInBad commented 2 months ago

I think flags are stored by $"{ModuleName}.{FlagName}", this is true for modules but I don't know if it is the case for datapacks

Bjorn0411 commented 2 months ago

I think flags are stored by $"{ModuleName}.{FlagName}", this is true for modules but I don't know if it is the case for datapacks

Having fiddled around by putting a raw string block inside the flag selection box, and then typing in the "$"{ModuleName}.{FlagName}"" (obviously with my pack and flag in there instead) and any variations I could think of, I cant find a way to use that command to grab a flag from another pack. If you were able to make it work, I'd love to know.

Alexofp commented 2 months ago

You can use the raw string to get any flag, yeah. Module flags are ModuleID.FlagID (with a dot in the middle) Datapack flags are DatapackID:FlagID (with a : in the middle)

It's just that you can't check if the flag exist x3. It will always error out if that flag doesn't exist

Alexofp commented 2 months ago

btw, if you add other datapack as a requirement it will be loaded too when testing scenes, no need for special saves

Bjorn0411 commented 2 months ago

You can use the raw string to get any flag, yeah. Module flags are ModuleID.FlagID (with a dot in the middle) Datapack flags are DatapackID:FlagID (with a : in the middle)

So, I'm trying to do that right now, but it doesnt seem to work? Below are pictures into the raw string I tried "brevmanscharacterpack2:metkatherine" and "brevmanscharacterpack2:MetKatherine" (difference is one is capitalized like the flag) both without the quotes I am using a save I know has the pack enabled. I also tried setting the pack as a dependency, no change.

image image image
Alexofp commented 2 months ago

Oh yeah, I see it now. Yeah, sorry, I limited it to only the current datapack flags. Sorry x3

Bjorn0411 commented 2 months ago

No worries! I do have plans to use it, but not in the near future, I have plenty of other ideas to work on first haha. So as long as it gets fixed eventually im good ^^