I have a massive game project where the player must have two separate gameplay codes within one object. I know that a simple 50-something switches could turn off and on basic coding, but for the level of complexity this game has, I’ll be needing several hundred. Alternatively, if I could toggle bundles on and off like an enable block, I could fix this issue in two blocks. Thanks for your time.
You could use a global and a filter
This actually sounds really helpful, especially for free users who don’t have access to unlimited objects!
Yes, but this involves countless more items such as switches to protect against the incremental global inputs and filters to test instead of switches.
From what I see, there are a few things you could try.
- Use Switches for the inputs, toggling which ones you are controlling.
- Make another object that you spawn/swap with the player.
- Create states inside the player that will only allow the player to do basic things if the states are true. (example: the idle animation plays if these states are true: OnGround, NotMoving)
It’s just 3 behaviours and 3 for the setting
The issue is, I will be using several different player types, e.g. tank controls and a platforming character with automatic camouflage will be in the same block. I will have to use an insane amount of input controls for this. There will be several dozen separate animation sets for the one player block.
I could make a bundle that acts as this big switch you want rq
I’m attempting to find how to do this; @Galactian if you wish to make an example I’d love some help! My main issue is that there are so many internal inputs such as timers and always and saves that all of these must be turned off. It’s going to take a ridiculous amount of time to make…
@grazer is a bundle toggle something we could hope for in the future?
Hmmm, this is actually a good idea. And I’ve requested something similar in the past. Still, I couldn’t give enough use cases for this feature - and to be fair, it is possible to have a robust AND organized player logic with several different states. The tips from @JR01 are pretty concise with how I code my player objects, and it works perfectly.
Either way, the option to disable bundles or groups of logic sounds incredibly useful and time-saving:
Use case one:
Code back-up: Currently, when I want to back up a piece of Flowlab code, I have to cut the bundle and paste the code in a .txt notepad, while this works, it’s not really practical.
If we had the option to disable Bundles, we could keep and check the disabled code at any time without having to search for the .txt file and import it.
Use case two:
Disabling Bundle “states”: Yes, it’s possible to do it currently by adding the switches, on/off states/bundle inputs WHILE they are being created (not after). But it would be just easier to just have the ability to turn on/off a bundle entirely.
So, it is a possibly helpful feature buuuuut it’s not really necessary. It would save time though
all the code in here
It’s not necessary, but like you said, imagine trying to make a 3d game on flowlab or animated 3d sprite stacking without this. I really hope this will be implemented. In my case, I will never finish my game within a year unless this is implemented.
Thanks, I’ll look at it as soon as I can.
So this is something that has come up before, and I agree that we need it, and will get it at some point.
I have had it mind that really this should take the form of a State Machine instead of sets of bundles that turn on and off.
This mechanism would enable some logic to only run while the object is in a specific state, and moving to a new state would enable different logic and disable the other states’ behaviors.
The underlying logic would be (relatively) straightforward, but I haven’t yet come up with an interface for defining and manipulating the states and transitions that I feel is simple, discoverable, & intuitive enough.
Some examples of what I have in mind when I’m talking about object states:
- an enemy NPC could have “wandering”, “searching”, “chasing”, and “attacking” states
- a player could have “running”, “jumping”, “landing”, & “attacking” states
- the main game logic could have “playing”, “cut scene”, and “rollup” states
This seems quite similar to Battlefield Portal’s If/Else and conditional command lines. That would be a great addition, and it would most likely use clear variables like you are saying. Maybe bundles can be inputted into state blocks, and depending on the input it activates or deactivates the bundles? Just a thought.