The title says for itself. I want to migrate my Game Maker Studio Project into Godot as my 1 year license is about to expire within a month. Is there a similar way to accomplish this? I heavily rely on this as it makes coding a bit easier for me.
Is there are a With Statement in Godot (Similar to Game Maker Studio)
I'm not familiar with game maker, never used it, but might a for loop or match be what you are after perhaps: https://docs.godotengine.org/en/3.1/getting_started/scripting/gdscript/gdscript_basics.html#keywords
a With Statement is just one way to access a specific instance of an object.
Example: with(instance_find_id[box, 1010010]){ // Change variables widthSprite = 100; heightSprite = 100; }
These two variables belong to "box" with an id of 1010010 and no other objects or "box" instance. However, this statement is written not inside the "box" object but from a controller object or another object.
But thanks anyway for the link
Oh and don't forget to check your email for an account confirmation email, so far I've had to approve each of your messages since they go straight into the moderation queue.
I received no confirmation email.
When you log in, there should be an option (a pop-up I believe) to resend the confirmation email.
Make sure to also check your spam folder, it might have been sent there by your spam filter.
With can be useful, but if you are using it frequently it probably means there is an opportunity to make your code more object-oriented (meaning turning that code block into a method on the object itself). I know OOP is not fashionable these days, but traditionally you would not want an outside object (or global script) changing an objects parameters as that is what a method is for. Hope that helps.
you can always check if the object has a property and or check the status of that property...if you are familiar with other languages a property is just a variable..
onready var obj = get_tree().get_root().get_node("world").get_children()
#this is just creating a list
#of scene objects..top most node is named "world"
# reading the obj[] list
for i in obj:
# the var "enemy" could be anything or any value
if "enemy" in i and "enemy" == true:
# just decrementing the health of the object
i.hp -= 10
I hope I understood what you are looking for correctly. If this doesn't help at all let me know what your issues are, I may or may not be able to help...but I'll try.
@justinbarrett
Hey thanks for the reply, I'll try this if it fulfills my current circumstances.
No need to respond unless you have issues, but there are a lot more ways to handle this... another option is to assign groups to objects, use raycasting, use area collision and sensors or have the object send out a message...so many different ways to deal with things. this is true of any game engine. The trick is doing it the simplest, fastest and most reliable way for what you are doing specifically.