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
126 stars 41 forks source link

Dev Branch crashes and issues #95

Closed Bjorn0411 closed 1 month ago

Bjorn0411 commented 1 month ago

Heres a list of crashes I've come across so far:

The rest are all regarding the new Datapacks features:

Specifically the crashes occur when running these codeblocks ingame, either via the "run scene" button in the datapack scene editor, or with the datapack actually loaded, and encountering these scenes. Having a button with these blocks show up doesnt cause the crash, pressing the button does. I do see the pattern that in all of these cases, the first character of each block is an npc when it crashes. set "start fight" to PC then it just gives you a error that you cant fight yourself. Though I'm not a programmer, im just seeing a pattern, so I might be wildly off-base. Edit: Tested "Start Sex. Dom/Sub=()" with PC in first slot, still CTD'd, so my pattern doesnt even track, so nvm there.


And, if youll permit me to give 3 suggestions ^^


CanInBad commented 1 month ago

Suggesting to either make issues sperate or making each problem a checklist instead

making all issues into 1 big issue is hard to track which issue get solved

use syntax - [ ] to make a checkbox

Bjorn0411 commented 1 month ago

thank you for the feedback. Hope it looks good now.

Alexofp commented 1 month ago

I think I fixed all the crashes, thank you. Feel free to test x3. I will think about the suggestions

And the "Katherine likes you" thing. You actually really don't want to put 'flag increases' in your state code (outside of addButton/scene react calls). Why not? Well, this code gets executed each time this state is shown to the player. So it could be executed multiple times potentially. The easiest way to cause that is to Save and Load. I hope that makes sense x3. Yeah, it has nothing to do with your addMessage problem but basically you should do flag manipulation inside of addButton calls which might be clunky but yeah.. This could be helped if I add some kind 'code that gets executed once when the scene starts' place.. but that's an extra thing for people to get confused over, extra UI x3

Bjorn0411 commented 1 month ago

@Alexofp Thank you for fixing them so quickly! So far it seems like all the issues are fixed. I will let you know asap in a new report if I find more crashes/bugs ^^

I literally finished writing all of the stuff below before I realised what you meant by saving and loading lol. When you load you re-run the state code of whatever state you were in when you saved. So receive faction rep at the hand in state, save, load, and it gives it to you again. There are probably ways to solve that, adding a block that says "don't run on loading save" but as you said, an extra thing to get confused over. So like yeah fair enough haha. I suppose I'll either have to do the annoying "put it in all 12 hand ins" if I want the reward & feedback to be immediate, or put it in the leave button if I wanna make it easy but slightly delayed. A way to save blocks to easily put down elsewhere, would very much help reduce time spent setting those kinds of things up :P Thanks for the explanation, even though I'm silly enough where it took me a minute to understand it :P I'll keep the ramble below, but feel free to disregard/ignore it.

As for "Katherine likes you" being in state code, I DO want it to be able to be run multiple times! Say lets create a different example: Replace Kath with a team, call it Red for simplicity. Red team has multiple members, lets say a big number like 12, spread across the prison complex, and they act as a faction who if you increase their reputation, you can gain benefits with them. One way to increase said reputation, is to perform repeatable quests and scenarios. One quest, is to collect item X. Once you've grabbed it, you can hand it in to any of the 12 members. This will increase your faction standing, up to a certain cap, once that cap is hit you need to perform harder tasks. Doesn't it make sense, that for the hand in part, you put the "increase faction rep by 1 until x threshold" code in the hand in state, the button to access that state is locked behind the quest stage flag. Instead of putting the faction increase on all 12 buttons?


I do have 2(.5) more suggestions.

image

Example above. I wrote Missionairy 3, which was "the cum scene" and then 4END is the player leaving, with a couple other quick options. Then I realised I wanted the player to be able to cum in several different ways, inside like in three, or outside, or inside but hard (leading to BeatUp) so I had to tack on 3_2 and 3_3, it'd be nice if I could move 4END to be below all 3's, and rename 3 to 3_1Inside, for example. Also I wanna move WINFaceFuck to be under WIN, not at the bottom If you wanna go the extra, extra mile in organisation, folders that let you hide chunks of states in the state list, functioning similar to layer folders in Photoshop, would let creators like me build a branch, put it in a folder, then contract the list so it all looks a lot cleaner. But that's probably a lot of work, for probably a very limited set of users. I imagine it wouldn't be worth the work for you.

Wanna make it clear btw, been absolutely loving the new feature, and have spent many hours writing in it (I just hope to god my work doesn't break before release due to further work on the system XD (but also if it does, that's on me for tryna play around before you're done :P)) It's really good and fun to work in, the exact kind of capable but individually simple building blocks that works well for me. I look forwards to writing many, many scenes & quests! ^^

Alexofp commented 1 month ago

Implemented some stuff. Not everything

Image support, a separate tab for loading them. They will always show up before the text, just how the system works, no way around it Can rearrange/rename/duplicate states. Renamed states will always become last, just how the datastructure works. You can always move them after that. Added some bbcode tags buttons to the fullscreen text editor. Hopefully it will be intuitive how they work

Bjorn0411 commented 1 month ago

This is great! duplicating states I didnt expect but thats a great feature. var and ifvar is also fantastic, took me a minute to understand them but once I did it seems very powerful. Being able to say the player's name is a game changer :P However if you wanted your NPC to say, "ohh shit, its 21:00! We best get moving!" then they will say "Ohh shit, its 75600!" because theres only "get time in seconds" (unless I missed the cleartext version) So, heres my suggestions

Alexofp commented 1 month ago

Game already has a bunch of built-in macroses here is the list

You just write {pc.name} or {pc.he} (a single {, not double ones like with vars)

Bjorn0411 commented 1 month ago

Ohh shit, thanks! Then my suggestion is a link to that page somewhere maybe? A little "parser wiki" button on the topright of the fullscreen text box? Otherwise, thats perfect. More or less all I'll need for a long time. Also, you can change whatever is on that list regarding codeblocks, that isnt in the parser commands, and just add it to the parser, like time, location and pc location. Theyre already in codeblocks just not in a format thats useful for conversations.

Alexofp commented 1 month ago

The idea was always to write a big tutorial about how to use it all x3. But you somehow figured it all out without one, you're pretty smart x3

Not sure if location names would be very useful, can't you just type out "Meet me at the canteen" or something instead? Same for time really

Bjorn0411 commented 1 month ago

Thats very flattering! Thank you! My method is "brute force against all options I can think of untill it works."

Well, scenes have the option of "Enter Any Room", so they could appear in any location. I admit though that at the very least, location and pc location is a niiiiche difference. The codeblocks have set "pc loc" and "aim camera" so my brain tells me that there might be some niche use, but I cant think of any examples. With scene location, I could start a random, idk, gangbang, with "the {location} is very busy today. Why is that?" Or maybe I have part where the scene moves, but I want to re-use a state. Maybe a character asks your thoughts on whatever location you're in, and you can say if you like the place or not. you can then use the get pc location, and set that as a string variable, to referr to later.

Alexofp commented 1 month ago

Added a section for saving blocks. Should be persistent between launches

Bjorn0411 commented 1 month ago

Fantastic! I keep adding debug buttons to quickly test sections of my writing and logic, so I've added a "DEVMode" flag, and having a saved block for "IF get: dev mode == true, then button" saves me a lot of time over many, many buttons. Plus its already proving useful for occasional copying of blocks ^^

Alexofp commented 1 month ago

I think I added everything that you mentioned here. Feel free to test. But I don't plan on adding anything new now, I wanna do some other stuff x3. If you find any bugs/crashes, I will fix them obviously

Bjorn0411 commented 1 month ago

Thank you so much for adding my suggestions! I really appreciate the work you've put in to make stuff easier for me, and increase my possibilities.

if I DO come up with more suggestions(I currently have none), is it chill if I still post em? you can either ignore em or put em in a pile of "I'll do those eventually."

Also, I was confused at first expecting the "exclude from encounters" to work as I suggested, reworking that section in the character menu to have codeblocks. But just adding the codeblocks for excluding in the scene creator is a much simpler solution that works just as well ^^


I know youre gonna write a tutorial for all these things later, but I wanna ask for some quick best practices. If that's okay! If I wanted to exclude a character from encounters. What would be the best way? heres some examples:

Based on quest progress. Should I add it to the quest stages code? (if quest flag is x then add quest text & exclude from encounters)

based on scenes/states, I imagine I just put it into the button that should cause the exclusion. (will the game remember a exclusion like that between saving and loading?)


Most importantly, if I wanted it solely tied to a flag, one that could change in many, dynamic ways. (like the earlier mentioned "likes you" flag, for example.) What would be the best way to implement that? add a check for "if x value then exclude" on every button that changes the value? That would be a lot of work (work that is thankfully not a HUGE pain because blocks can now be saved and reused ^^) and be a lot of repeated codeblocks, making things a lil' messy haha. Plus maybe sometimes the flag changes in trigger code, not state/button code. Another method, could be to make a scene with, or add to a scene, a extra trigger with "enteranyroom" which, all it does is check for if the flag has x value, and then excludes if its correct. But that feels kinda yikes, running additional code for every single time you move. Can build up over many packs doing this. But maybe thats fine? maybe im over estimating how much work that is for the game, and its not like its on every tick.


So yeah, would love to know about the best practices on this ^^

And again, thank you so much for the actual days of work you've put in to add my suggestions, that does not go unnoticed or unappreciated! :)

(Also lil' tip for when you do make the datapack guide wiki, make sure "best practices" is something as many people as possible will read, so people for example dont do what I've done and add code to states that should be in buttons. It makes intuitive sense to non-programmers that you would add event code (like an orgasm) as they happen in the state, not in the button before the state. I'm still going over my work to fix that haha)

Alexofp commented 1 month ago

Quest code only gets executed when the player looks at the task list. Quests don't actually control anything, they are here just to show player what to do next in case they're stuck or something. So you gotta call the include/exclude blocks from the scene code. And its saved, you don't have to call it many times

If you have suggestions, sure. Throw them here somewhere. I will close this issue though, I think the crashes got fixed And thank you for testing the scene creator, your feedback was invaluable