Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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!
I had an idea for a summoning system for my rpg that I'm making but can't figure out how to create this trigger. I'm not very good at triggering. My idea is that a player types a message similar to "Summon Demon" as a substring. What I think I need is a hastable or game cache to store a list of units that can be saved as a substring and called up when a message similar to the example are typed. If I didn't explain good enough or this was too confusing feel free to reply or send me a message. Any help at all would be greatly appreciated.
From the sounds of it, you want players to be able to summon (and presumably Return) units during play, and they summon them via text commands?
It doesn't necessarily require a hashtable or game cache.
When a player types a chat message, you check for the substring of Summon. You take the rest of the player's message as how you find What to summon. So I'd have it loop through a String array until it finds a match. It will then summon the unit, in the case of a specific unit, it takes it from a Unit array and moves it into play, in the case of a unit-type, it takes it from a Unit-Type array and creates a new unit.
Got that?
Summon Unit
Events
Player - Player 1 (Red) types a chat message containing Summon as A substring
Conditions
(Substring((Entered chat string), 1, 6)) Equal to Summon
Actions
-------- The condition will prevent it trying to summon things whenever someone just happens to say "Summon" --------
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 8, (Length of (Entered chat string)))) Equal to (UnitStringArray[(Integer A)])
Then - Actions
-------- // Create or move the unit --------
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer A) Equal to 10
Then - Actions
-------- // Display error to player --------
Game - Display to (All players) the text: No such unit
This will work easily (Matched Chat String worked when I wanted players to type radio-1, radio-2, radio-3 and each identified a different song to play):
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.