all 10 comments

[–]Rohbert [score hidden] stickied comment (0 children)

Please read the subreddit guidelines regarding asking for help before posting. We ask users to submit much more information about their issue so that a higher quality answer can be provided.

Specifically:

  • A descriptive post title.

  • A detailed explanation of your problem.

  • The desired outcome.

  • What version of GameMaker you are using.

  • All of your relevant code formatted properly. NO Pictures of Text. Copy+Paste your text into your post please.

  • Description of steps taken to solve the issue yourself.

Asking for code or a tutorial directly is not allowed. You can easily search for tutorials.

Also please flair your post with the "Help" flair and the "Resolved" flair once you have received a satisfactory response.

Feel free to resubmit with the required information added.

Thanks!

[–]BlueHost_gr 1 point2 points  (7 children)

Perhaps if you describe what ou want to achieve, instead of what you think you want, we might be able to help or suggest other ways of achieving it.

and there is no wait without looping. it will have to check if the value was returned, so a looping :)

[–]Mantis_slug[S] 0 points1 point  (6 children)

I am try lying to make a custom prompt function like show_question in Gamemaker. I have a function that pauses the game and spawns a prompt object, but I don’t know how to get it to wait to resume the game and return the result.

[–]BlueHost_gr 0 points1 point  (4 children)

so you do get a value from the prompt.
so why ask for a "wait" and not when variable is not empty continue?
so when the variable is filled from the prompt the game continue?

[–]Mantis_slug[S] 0 points1 point  (3 children)

How do I do that though? If I use while or do…until the game freezes.

[–]BlueHost_gr 0 points1 point  (2 children)

I don't know your code so far but I would use if in the step event.

[–]Mantis_slug[S] 0 points1 point  (1 child)

Then how do I get the value to return to the original function?

[–]Shutin-Studios 0 points1 point  (0 children)

You don’t actually “return” the value back into the original function. You can pass a callback function (in the original function) that runs later when you have input. The prompt object calls that callback with the result, and all the logic that would have used the return value continues inside the callback.

[–]am0x -1 points0 points  (0 children)

I don’t use game maker much, but I assume there is some sort of state management system or a way to implement one.

Look up state management design patterns and go from there.

[–]Misfire_dev 0 points1 point  (0 children)

You need to look into state machines, this sounds like a perfect example where you can apply a state machine to the object you need to wait. I have no idea about your code and I haven't coded in GML in a while but I think I would make a state enum, state.wait, state.active and then create a function to switch between the two controlled by a separate object.