String activated Spells.

sylvannis mb

New Member
Reaction score
6
Ok people,
my top secret game i'm making uses typed commands to cast spells, using triggers, but i want to know if there is a way for them to type a spell name, and the trigger will recognies the spell name, and use that spell. I have tried saving the string as a variable, but i cant find a way to find the corresponding spell from there.
I could do this the long way by inputing
Player 1(red) says "spell name"
Event:
Spell occurs
bla bla
but i plan to be making probably over 100 spells, and the time that would take me to set the triggers for all of them is dautning.
any help would be appreciated. Thx
 
you could do it with wc3 order strings, but you'll be limited to melee spells.

such as...

the player would have to type -carrionswarm

and

call IssuePointOrder(u,substring)
 
hmmm... ok
Ill show you my code so far, working the slow way:

Name Here
Events
Player - Player 1 (Red) types a chat message containing Name Here as An exact match
Conditions
Actions
Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)
Loop - Actions
Set redselect1 = (Picked unit)
Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
Loop - Actions
Unit - Add Spell here to (Picked unit)
Unit - Order (Picked unit) to Neutral - Firebolt ---- This is the meelee spell the custom one is based one ---- redselect1
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 10.00) ---- ignore that last line, just my game ----
Unit - Remove Spell here from (Picked unit)

ok so what ive done so far is when the spell is typed, the players hero gains the spell, casts it and then loses the spell again, but i was wanting to know if i can have them type the name of my custom spell, and have that identify as firebolt or the meelee spell, and then still cast my custom spell.

thx for the fast reply
 
your way is the only way to do it, either a trigger per spell or you can make it cleaner by making an array

Spell[1] = Firebolt (Neutral)
SpellName[1] = "Firebolt"

there is no way for Wc3 to convert chat messages into an ability unless you use the method i stated earlier which is ONLY using melee abilities
 
ok, thx

also im trying to make a spell, where i use spirit link, but i want all the damage from the units linked to go to one unit.
is there any way to do this?
 
yes its possible although making it MUI may be difficult in GUI

i do not think you can do it with just object editor modifications however, you will need to fully trigger the spell. If you search this forum, there should be a GUI chain lightning system made by Flare.

you may be able to use the system to your advantage
 
ok well i know your desperate to see how i did it :p

here we go :

Trigger:
  • name
    • Events
      • Player - Player 1 (Red) types a chat message containing name as An exact match
      • Player - Player 2 (Blue) types a chat message containing name as An exact match
      • Player - Player 3 (Teal) types a chat message containing name as An exact match
      • Player - Player 4 (Purple) types a chat message containing name as An exact match
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)
        • Loop - Actions
          • Set redselect1 = (Picked unit)
      • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 50.00)
          • Unit - Add Shield to (Picked unit)
          • Unit - Order (Picked unit) to Orc Spirit Walker - Spirit Link redselect1






second trigger

Trigger:
  • name red
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • ((Triggering unit) has buff Redlink ) Equal to True
    • Actions
      • Set redlink = GDD_Damage
      • Set redlink1 = ((Life of (Attacked unit)) + GDD_Damage)
      • Unit - Set life of (Attacked unit) to redlink1
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - ((redlink / 10.00) + 1.00))



ok so now im working on making it so this shield only blocks one dmg type.

this is fundamental for my game so any help would be appreciated dearly

btw thx for the help cleeez
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top