You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commands are "the lines that start with #. Currently commands are "interpreted" by the convertListStringToObj function. This function transforms a command string into an array of strings (checking for double spaces, double quotes, single quotes, etc.), and then from the array makes a set of if statements to understand the command.
duration 3 name "C J" surname Smith position "{ x: 2, y 3 }"
the developer should be given the possibility to insert his own commands or modify the existing ones.
to do this you need to add the possibility to set a function that takes as input an array of strings (duration 3 name "C J" surname Smith position "{ x: 2, y 3 }") and returns a boolean (if it is true then it means that the command is known)
this function should be run in convertListStringToObj if it returns true then it will not check the array otherwise it will continue
The text was updated successfully, but these errors were encountered:
BlackRam-oss
changed the title
Interpreting commands (#) from outside
Interpreting commands (#) from outside (game developer)
Oct 17, 2024
Commands are "the lines that start with #. Currently commands are "interpreted" by the
convertListStringToObj
function. This function transforms a command string into an array of strings (checking for double spaces, double quotes, single quotes, etc.), and then from the array makes a set of if statements to understand the command.duration 3 name "C J" surname Smith position "{ x: 2, y 3 }"
["duration", "3", "x", "2", "y", "3", "name", "C J", "surname", "Smith", "position", "{ x: 2, y 3 }"]
if it is not a known command it ignores it.
the developer should be given the possibility to insert his own commands or modify the existing ones.
to do this you need to add the possibility to set a function that takes as input an array of strings (
duration 3 name "C J" surname Smith position "{ x: 2, y 3 }"
) and returns a boolean (if it is true then it means that the command is known)this function should be run in
convertListStringToObj
if it returns true then it will not check the array otherwise it will continueThe text was updated successfully, but these errors were encountered: