• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] hashtable for strings

Status
Not open for further replies.
Level 3
Joined
Sep 16, 2016
Messages
28
I wonder if somebody else is active here, but I want to create a trigger for code strings, which can be stored and used in the same map.

example:
-code BW Z4Z
-code BWX nT6

I'll appreciate your help in advance if you are willing ☺
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
yeah
store the codes and use them
As I said, is easy, you don't need to save them, just create a trigger for each one (Unless you are not using GUI):
  • Code
    • Events
      • Player - Player 1 (Red) types a chat message containing - as A substring
      • Player - Player 2 (Blue) types a chat message containing - as A substring
      • Player - Player 3 (Teal) types a chat message containing - as A substring
      • Player - Player 4 (Purple) types a chat message containing - as A substring
      • Player - Player 5 (Yellow) types a chat message containing - as A substring
      • Player - ...
    • Conditions
      • (Substring((Entered chat string), 1, 6)) Equal to -code // This has a space at the end
      • (Substring((Entered chat string), 7, (Length of (Entered chat string)))) Equal to <Your code>
    • Actions
      • -------- Do actions --------
 
Level 3
Joined
Sep 16, 2016
Messages
28
As I said, is easy, you don't need to save them, just create a trigger for each one (Unless you are not using GUI):
  • Code
    • Events
      • Player - Player 1 (Red) types a chat message containing - as A substring
      • Player - Player 2 (Blue) types a chat message containing - as A substring
      • Player - Player 3 (Teal) types a chat message containing - as A substring
      • Player - Player 4 (Purple) types a chat message containing - as A substring
      • Player - Player 5 (Yellow) types a chat message containing - as A substring
      • Player - ...
    • Conditions
      • (Substring((Entered chat string), 1, 6)) Equal to -code // This has a space at the end
      • (Substring((Entered chat string), 7, (Length of (Entered chat string)))) Equal to <Your code>
    • Actions
      • -------- Do actions --------
incredibly this works 😄
I hope that there's a way to store the code for the use while playing on the same map next time
 
Last edited:
incredibly this works 😄
I hope that there's a way to store the code for the use while playing on the same map next time
There are 2 ways:
  • either the player have to get the code and "remember it" until next play session and enter it again to load
  • or you save it locally on the players computer and load it (if it exists) on map start.
Either way, you need to setup what needs to be saved and how to load it.
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
incredibly this works 😄
I hope that there's a way to store the code for the use while playing on the same map next time
That is what did you want? I asked if you wanted "Store specific codes to use? or an Encoder and Decoder?" and you told me the first option instead of the second, because in that case I also would recommend you that Codeless Save and Load system.
 
Level 3
Joined
Sep 16, 2016
Messages
28
sorry for late reply
if somebody else can teach me how to save the string (example: Z4e) and load it in the same map for another time by using this Save & Load trigger?
thanks in advance
 
Status
Not open for further replies.
Top