User input in chat function
Any suggestions on getting user input via the on_chat functions?
For example, to have a builder or agent place a number of blocks based on the number input by the user via chat?
-
Never mind, did some research. For those looking, it's a little ambiguous to the user, but you need to enter variables that don't necessarily have a prompt.
def moveByInput(r, c): #the r and c parameter are not explicity asked foragent.teleport_to_player()agent.move(FORWARD, r)agent.move(UP, c)
player.on_chat("move", moveByInput)#in chat, enter "move 2 5" to move forward 2 then up 5, for example0 -
Hi, Michael Reilly - pleased to meet you! Sounds like your problem solving is right on track! I know I have been unable to use text as input to chat functions. So let me spare you the grief. =D Unless something was upgraded, you can't pass a string (like what kind of block or what direction.)
Let us know what you create ~ glad to have you here!0
Please sign in to leave a comment.
Comments
2 comments