Altering "Fire Bullet" Behavior Mid-Game

I started using GDevelop recently and I read the space shooter tutorial, and now I’m trying to make my own. Things are going pretty well, but have one problem. I want to make a power-up that does a few things but the part that I’m struggling with is the rate of fire, which the power-up will increase. I’m using the “Fire Bullets” behavior on the player object and you can manually change the time between each shot, but I can’t figure out how to do it during the game when grabbing a power-up for example. I’m sure I can figure it out on my own with some more time and practice with GDevelop, but any help is greatly appreciated.

If your player/ship fire bullets based on a timer just increase or decrease the timer lapse time, if you are shooting in other way just share some screenshot so we can see and help.

You can add an action yourself to the behavior as it is a very easy task. The extension team has this already on their roadmap, it’ll probably be done someday.

1 Like

Here is how i did the shooting actions. I used a behavior and then added an event that the behavior includes

How do I add an action to the behavior?

You open the extension from the project manager, then the behavior, then click on add a function, click on custom, and click on the new function. Now enter the name and description of the new action, then go to parameters, add 1 parameter, change the type to number, set the name new_value, and a label of your choice. In the events sheets below, add a new event without conditions and the action to set the property you want to change, and use as value GetArgumentAsNumber("new_value").

1 Like

alright, sounds a bit complicated but ill try to do that give me a minute.

ok, so theres one issue and its pretty much the same as earlier. the property I want to change is the rate of fire, which you change on the screen where you manage an objects behaviors. this property does not show up on the list of actions i can set on the function.

Ok i think i found an alternative that works fine. thanks for the help though.

Honestly I just wouldn’t use the fire bullet behavior. I personally find it easier to use the create object command and add a permanent force (With a timer for a custom cooldown), but if you want to use the fire bullet behavior you can just set the cooldown to 0, and then use a timer and only fire a bullet when that timer reaches a certain value, which can be controlled using a variable.

1 Like

yeah, thats what i ended up doing, since i figured out that replicating the fire bullet behavior on my own is a lot easier than i thought. the official tutorial said i should use it, though it seems to be a bit limited as you said.

1 Like