WarToast
Active Member
- Reaction score
- 3
Solved
Solved
Solved
Hey,
So I'm trying to make this function that lets a player type in a message, and the camera will then zoom in or out depending on what the player wrote.
The way I wanted this is that you can type "-cam 200", and the camera will zoom to a distance of 200. You can also type "-cam 201", and it will zoom to 201, and so on. That means I won't work with fixed values.
So this is the way I made it so far. I have the player type in a message that contains "-cam", and then I want my trigger to pick the second word in the string (which would be 200 in the above example), convert it to a real and then use it in my action.
Now the problem is that, in the local variables section, I want to use my String zoomLevelInput in the real convertedOutput. Since I convert from string to real, I figured I could use my String variable, but no. (Right now there is just the (Entered chat string) because I couldn't pick my own variable)
So basically, my question is: How would I pick the second word in the chat string, convert it to real so I can use it in my camera options?
Bonus question: Does the "partial match" of my event also trigger if a user types "Hello -cam"? In that case, the "Word of String" wouldn't work, and I would be looking for a new solution.
Thanks
Edit: I just answered by own bonus question; it does trigger even if -cam isn't the first word.
Solved
Solved
Hey,
So I'm trying to make this function that lets a player type in a message, and the camera will then zoom in or out depending on what the player wrote.
The way I wanted this is that you can type "-cam 200", and the camera will zoom to a distance of 200. You can also type "-cam 201", and it will zoom to 201, and so on. That means I won't work with fixed values.
So this is the way I made it so far. I have the player type in a message that contains "-cam", and then I want my trigger to pick the second word in the string (which would be 200 in the above example), convert it to a real and then use it in my action.
Now the problem is that, in the local variables section, I want to use my String zoomLevelInput in the real convertedOutput. Since I convert from string to real, I figured I could use my String variable, but no. (Right now there is just the (Entered chat string) because I couldn't pick my own variable)
So basically, my question is: How would I pick the second word in the chat string, convert it to real so I can use it in my camera options?
Bonus question: Does the "partial match" of my event also trigger if a user types "Hello -cam"? In that case, the "Word of String" wouldn't work, and I would be looking for a new solution.
Thanks
Edit: I just answered by own bonus question; it does trigger even if -cam isn't the first word.