Name Input system help
Hi, this is my first time posting but I have been learning and looking at this site for a while but I have a problem with a feature I want to implement.
The system would have the player enter a 6 character string. Each letter and number has a value.
Lets say a player enters : "Syous"
I want to take each letter, in this case S, Y, O, U, S and then set them to all have their own value.
S Y O U S
3, 4, 4, 0, 3
Then I want to add them all up. So it would be 14.
Then I want to add the 1 and 4 which equals 5.
From here, i would reference a chart and give that player's hero an item from that chart.
Hi, this is my first time posting but I have been learning and looking at this site for a while but I have a problem with a feature I want to implement.
The system would have the player enter a 6 character string. Each letter and number has a value.
Lets say a player enters : "Syous"
I want to take each letter, in this case S, Y, O, U, S and then set them to all have their own value.
S Y O U S
3, 4, 4, 0, 3
Then I want to add them all up. So it would be 14.
Then I want to add the 1 and 4 which equals 5.
From here, i would reference a chart and give that player's hero an item from that chart.
- Player Name Value 0
- Events
- Player - Player 1 (Red) types a chat message containing a as A substring
- Player - Player 1 (Red) types a chat message containing f as A substring
- Player - Player 1 (Red) types a chat message containing k as A substring
- Player - Player 1 (Red) types a chat message containing p as A substring
- Player - Player 1 (Red) types a chat message containing u as A substring
- Player - Player 1 (Red) types a chat message containing z as A substring
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Length of(Entered chat string)) Less than or equal to 6
- Then - Actions
- Set PlayerNamesCalculate[1] = (PlayerNamesCalculate[1] + 0)
- Set PlayerNameString[1] = (Entered chat string)
- Game - Display to (All players) the text: (String(PlayerNamesCalculate[1]))
- Set PlayerNameEntered[1] = True
- Trigger - Run Name Validated <gen> (checking conditions)
- Else - Actions
- Set PlayerNamesCalculate[1] = 0
- Trigger - Run Enter Name Again <gen> (checking conditions)