Waiting for a player to respond

Started by Purple19842 on

Topic category: Advanced modding

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Waiting for a player to respond

I am making a procedure that will ask the player a question and they will answer with 1, 2, 3.

i have a procedure that will detect and return the answers from chat, but now when i try to test it, i have this procedure:

set a local variable for the response to the return of the other procedure, and use if statements to determine what to do.

now, the procedure that checks the response is triggered by a player typing anything into chat, and that will give me a "text" dependency to work with, but if i try to call this procedure from another procedure, i no longer have access to the text as a dependency.

so not only do i need a way to return the value while still having the "text" dependency, but i also need it to stop executing the procedure until an answer is given, then it should resume

i could try using a while loop with a wait block in it, and have the condition only return false after the response has returned, with the setting it to true before asking the question, and setting it to false in the other procedure, right before the return blocks

 

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Interesting. Can you send me…
Fri, 06/30/2023 - 11:51

Interesting. Can you send me a photo of your procedure?

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Get rid of custom code…
Fri, 06/30/2023 - 16:32

Get rid of custom code snippet, and add a different block

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i dont think that that is…
Fri, 06/30/2023 - 17:56

i dont think that that is the problem, i just put that there to make it not throw an error with an empty wait loop.

i need to find a way to get the text dependency while triggering it from the other procedure, and to have the procedure wait until it gets a return value to continue executing