#Help please! i still don't know why the power ups are not working

60 messages · Page 1 of 1 (latest)

graceful loom
#

Also how would i add a system that makes the menu buttons random? i want to also add upgrades such as increased bullet count that would spawn two bullets in two diffrent directions

vagrant jasper
#

Just so I don't have to look through the code, where do you keep the power up code?

#

Like, in which script?

graceful loom
vagrant jasper
#

You seem to be going through the vboxcontainer instead of the label, is this intended?

graceful loom
#

This is the set up i have seen online for menu's

#

Is this what you were asking?

vagrant jasper
#

Are you doing this through a tutorial perchance?

graceful loom
#

it was a totally diffrent menu tutorial so i can't go back to it for this project

#

i could not find a tutorial on this power up mechanic'

vagrant jasper
#

Are you writing the code yourself for the power up menu I mean

graceful loom
#

no,they were from tuts and ai

vagrant jasper
#

Okay, thanks

#

So the problem here is

#

In the code you are accessing the wrong node

#

See the for loop?

#

For button in bla bla bla

graceful loom
#

yeah

vagrant jasper
# graceful loom

It goes through this little thing until it reaches vboxcontainer

#

And it looks for everything inside that

#

But it's only detecting the label

graceful loom
#

oh damn

vagrant jasper
#

And the buttons it's supposed to detect is in the label

#

So to fix this you extend the path to the label

#

$PanelContainer/Panel/VBoxContainer/Label.get_children()

graceful loom
#

now i get this error

#

Invalid assignment of property or key 'pause_mode' with value of type 'int' on a base object of type 'Button'.

#

func _ready():
for button in $PanelContainer/Panel/VBoxContainer/Label.get_children():
if button is Button:
button.pause_mode = 2 # PROCESS mode manually set
button.pressed.connect(_on_button_pressed.bind(button.text))

vagrant jasper
#

There is the problem, does the game not let you move when this error appears? It shouldn't if it's a runtime error

graceful loom
#

whole project is gray

vagrant jasper
#

Yeah

#

Can you screenshot the inspector of the buttons?

#

Wait nevermind

#

Yeah do it

graceful loom
vagrant jasper
#

Yeah not sure what pause mode is supposed to be

#

Are you sure you followed the tutorial fully?

graceful loom
#

ITS WORKING!

#

i removed button.pause_mode = 2

#

and made a refrence for the fire cooldown

#

but now another problem..

vagrant jasper
#

Yeah?

graceful loom
#

increasing the fire rate just makes another pistor in the middle of the screen

#

for whatever reason

vagrant jasper
#

Pistol?

graceful loom
#

This video provides everything

#

all the codes and nodes

#

ITS FIXED!!

#

now this is cool

#

I had to reference the pistol in the player script

#

Thank you Felix

vagrant jasper
#

You kinda fixed this yourself, lol

graceful loom
#

Well you did point me to the fix lol

vagrant jasper
#

You're welcome then

graceful loom
#

"not sure what paused mode is" and "pistol?" made me look them up

vagrant jasper
#

It's cus you said Pistor 😭

graceful loom
#

Shhhiittt time to add a piss pistol