• 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.

[Trigger] Player max 4 spells

Status
Not open for further replies.
Level 5
Joined
Jan 5, 2019
Messages
108
Can someone help me make a Trigger that only allows all Players to carry 4 spell each, it will be a great help Thanks ! :)
 
Level 5
Joined
Jan 5, 2019
Messages
108
What are this spells? Sounds like items used as spells but better tell us.

Yes sorry they are items manipulated to being spells. i tried fixing it with make some invisible spells so the player cant buy more then 4 but its like all passive spells have a secret slot, so even if you had 7 spells they keep getting applied
 
Level 5
Joined
Jan 5, 2019
Messages
108
Here is my map if anyone wants to check the Triggers they are named Q, E, W, R, Spells.
 

Attachments

  • Test Map.w3x
    335.8 KB · Views: 29
k, in your maps there are powerup items and this items teach abilities. Also such an powerup Item improves the level when gaining the same item again. You want to limit an unit to have 4 different abilities only.

If you map is 1 hero per player you could add an integer array "Abilities_Learned".
When gaining an new ability increase it by 1 for that player. Abilities_Learned[player number of trigger Player] + 1
if an hero gains an powerup but the Abilities_Learned for that player is already 4 you don't add a new ability instead you give back the gold costs or recreate it whatever you like.
 
Last edited:
Level 5
Joined
Jan 5, 2019
Messages
108
k, in your maps there are powerup items and this items teach abilities. Also such an powerup Item improves the level when gaining the same item again. You want to limit an unit to have 4 different abilities only.

If you map is 1 hero per player you could add an integer array "Abilities_Learned".
When gaining an new ability increase it by 1 for that player. Abilities_Learned[player number of trigger Player] + 1
if an hero gains an powerup but the Abilities_Learned for that player is already 4 you don't add a new ability instead you give back the gold costs or recreate it whatever you like.

Omg you a genius thanks alot :) i was so stuck
 
Level 5
Joined
Jan 5, 2019
Messages
108
Can i quickly ask if its a condition or a action

When gaining an new ability increase it by 1 for that player. Abilities_Learned[player number of trigger Player] + 1 ?
 
Level 5
Joined
Jan 5, 2019
Messages
108
i gotta be honest i am not really sure if i am good enough for this. does this look right ?
or am i totally off
 

Attachments

  • Untitled.png
    Untitled.png
    49.7 KB · Views: 54
it looks wrong.
The goal is to add a counter to the unit, it counts the amount of new unique abilities learned. When the counter is 4 and you would gain a new ability you prevent the ability gaining.

  • Blizzard
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Blizzard
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Sørn Blizzard for (Triggering unit)) Equal to 10
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) the text: You have maxed out ...
          • Set TempLoc = (Position of (Triggering unit))
          • Item - Create Blizzard at TempLoc
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Item - Remove (Item being manipulated)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Sørn Blizzard for (Triggering unit)) Equal to 0
            • Then - Actions
              • -------- Already got 4 spells?--------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Abilities_Learned[(Player number of (Triggering player))] Less than 4
                • Then - Actions
                  • Set Abilities_Learned[(Player number of (Triggering player))] = (Abilities_Learned[(Player number of (Triggering player))] + 1)
                  • Unit - Add Sørn Blizzard to (Triggering unit)
                  • Item - Remove (Item being manipulated)
                  • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIam\AIamTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • -------- Already got 4 spells, regain tome or whaterver you like --------
            • Else - Actions
              • Unit - Increase level of Sørn Blizzard for (Triggering unit)
              • Item - Remove (Item being manipulated)
              • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIam\AIamTarget.mdl
              • Special Effect - Destroy (Last created special effect)
 
Level 5
Joined
Jan 5, 2019
Messages
108
it looks wrong.
The goal is to add a counter to the unit, it counts the amount of new unique abilities learned. When the counter is 4 and you would gain a new ability you prevent the ability gaining.

  • Blizzard
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Blizzard
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Sørn Blizzard for (Triggering unit)) Equal to 10
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) the text: You have maxed out ...
          • Set TempLoc = (Position of (Triggering unit))
          • Item - Create Blizzard at TempLoc
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Item - Remove (Item being manipulated)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Sørn Blizzard for (Triggering unit)) Equal to 0
            • Then - Actions
              • -------- Already got 4 spells?--------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Abilities_Learned[(Player number of (Triggering player))] Less than 4
                • Then - Actions
                  • Set Abilities_Learned[(Player number of (Triggering player))] = (Abilities_Learned[(Player number of (Triggering player))] + 1)
                  • Unit - Add Sørn Blizzard to (Triggering unit)
                  • Item - Remove (Item being manipulated)
                  • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIam\AIamTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • -------- Already got 4 spells, regain tome or whaterver you like --------
            • Else - Actions
              • Unit - Increase level of Sørn Blizzard for (Triggering unit)
              • Item - Remove (Item being manipulated)
              • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIam\AIamTarget.mdl
              • Special Effect - Destroy (Last created special effect)

It works ! but now i can only level up the ability to 1, so do you know if its possible to set the ability inside the red plus level'ing up sign, so the player can increase the ability by killing units, instead of buying it up in level's ? or is there a way to increase it in level's by keep buying it. both will work
 
Level 5
Joined
Jan 5, 2019
Messages
108
Sorry haven't been able to write back this weekend, but i deleted some actions that i think was making some errors. but this is how it looks so far
 

Attachments

  • Untitled.png
    Untitled.png
    76.4 KB · Views: 48
Level 5
Joined
Jan 5, 2019
Messages
108
you have to increase ability_Learned, if the ability is picked the first time.
->
Set Abilities_Learned[(Player number of (Triggering player))] = (Abilities_Learned[(Player number of (Triggering player))] + 1)

I tired that but i can't get the + 1 to get last hmmm...
 
Level 5
Joined
Jan 5, 2019
Messages
108
That sound very usefull Thanks !!!

I have been looking on the Multiboard to create a counter with a variable for the last " Already got 4 spells Trigger " but i am not sure if i am following a lost clue here. if you could guide me on the right direction i will be really thankful :)
 
Level 5
Joined
Jan 5, 2019
Messages
108
multiboards display strings (Text), warcraft 3 has inbuilt integer/real to String conversation functions, use them to convert your abilities learned counter to be displayed inside the multiboard.

Does that mean if i set.

For each (Integer B) from 1 to 4, do (Actions)
Loop - Actions
Hero - Drop the item from slot (Integer B) of Unit
Item - Remove (Last dropped item)

into a multiboard i can make a counter ?
 
Level 5
Joined
Jan 5, 2019
Messages
108
Also do you think if i do it this, that i could make it so you only have to buy a spell once so when every time the hero level's up it could upgrade the spells level ? without having to buy it ofc...
 
Also do you think if i do it this, that i could make it so you only have to buy a spell once so when every time the hero level's up it could upgrade the spells level ? without having to buy it ofc...
sure you can make it auto update on Level up, but that requiers to save the abilities learned for each hero/Player depends, if an player has more than 1 hero, if an player has only 1 hero then you can simply use the player number with 4 ability variables. If there are more than 1 hero a player you need either unit indexer or hashtable but saving abilities into an hash in GUI is not supported. Therefore you should either use player Index or an unit indexer system.

Could look somehow like this:
  • Learn Blizzard
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Blizzard
    • Actions
      • Set PlayerNumber = (Player number of (Owner of (Triggering unit)))
      • -------- NoAbility is an ability variable you never write onto --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Ability_Learned1[PlayerNumber] Equal to NoAbility
        • Then - Actions
          • -------- Abilty Learned1 for that hero is empty, use it to learn Blizzard --------
          • Set Ability_Learned1[PlayerNumber] = Blizzard
          • Unit - Add Blizzard to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Ability_Learned2[PlayerNumber] Equal to NoAbility
            • Then - Actions
              • Set Ability_Learned2[PlayerNumber] = Blizzard
              • Unit - Add Blizzard to (Triggering unit)
            • Else - Actions
              • -------- Inser Ability_Learned3 & Ability Learned4 this is only for showing purpose --------
  • Level up
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • Set PlayerNumber = (Player number of (Owner of (Triggering unit)))
      • Unit - Set level of Ability_Learned1[PlayerNumber] for (Triggering unit) to (Hero level of (Triggering unit))
      • Unit - Set level of Ability_Learned2[PlayerNumber] for (Triggering unit) to (Hero level of (Triggering unit))
      • Unit - Set level of Ability_Learned3[PlayerNumber] for (Triggering unit) to (Hero level of (Triggering unit))
      • Unit - Set level of Ability_Learned4[PlayerNumber] for (Triggering unit) to (Hero level of (Triggering unit))
It would also be smart to disallow learning the same ability multiple Times.
 
Last edited:
Level 5
Joined
Jan 5, 2019
Messages
108
sure you can make it auto update on Level up, but that requiers to save the abilities learned for each hero/Player depends, if an player has more than 1 hero, if an player has only 1 hero then you can simply use the player number with 4 ability variables. If there are more than 1 hero a player you need either unit indexer or hashtable but saving abilities into an hash in GUI is not supported. Therefore you should either use player Index or an unit indexer system.

Could look somehow like this:
  • Learn Blizzard
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Blizzard
    • Actions
      • Set PlayerNumber = (Player number of (Owner of (Triggering unit)))
      • -------- NoAbility is an ability variable you never write onto --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Ability_Learned1[PlayerNumber] Equal to NoAbility
        • Then - Actions
          • -------- Abilty Learned1 for that hero is empty, use it to learn Blizzard --------
          • Set Ability_Learned1[PlayerNumber] = Blizzard
          • Unit - Add Blizzard to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Ability_Learned2[PlayerNumber] Equal to NoAbility
            • Then - Actions
              • Set Ability_Learned2[PlayerNumber] = Blizzard
              • Unit - Add Blizzard to (Triggering unit)
            • Else - Actions
              • -------- Inser Ability_Learned3 & Ability Learned4 this is only for showing purpose --------
  • Level up
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • Set PlayerNumber = (Player number of (Owner of (Triggering unit)))
      • Unit - Set level of Ability_Learned1[PlayerNumber] for (Triggering unit) to (Hero level of (Triggering unit))
      • Unit - Set level of Ability_Learned2[PlayerNumber] for (Triggering unit) to (Hero level of (Triggering unit))
      • Unit - Set level of Ability_Learned3[PlayerNumber] for (Triggering unit) to (Hero level of (Triggering unit))
      • Unit - Set level of Ability_Learned4[PlayerNumber] for (Triggering unit) to (Hero level of (Triggering unit))
It would also be smart to disallow learning the same ability multiple Times.


Hmm was more thinking about the player could choose manually which ability to learn in the red plus sign after buying the ability once, just to prevent the tomes getting drop after being bought. but i actually just fixed that the tomes don't drop anymore :) so now i just need to set a max 4 spell cap on each hero / player.
 
Hmm was more thinking about the player could choose manually which ability to learn in the red plus sign after buying the ability once, just to prevent the tomes getting drop after being bought.
Learnable custom skills: Dat takes alot of extra abilities.

This is done by giving each hero 4 learnable dummie skills which are disabled for all players, when learning an ability by tome you morph one of the dummy abilities by using Engineering Upgrade the goblin tinker passive. You need 1 for each dummy skill <> real spell transformation. Means 4 x learnable Spells in your case.

Since warcraft 3 1.29+ there is also an option with dynamic buttons (change icon text manacost cooldown with triggers also you need extra levels depeding on aoe and range and casting type selfcast, target, point), but that takes alot of trigger data.
 
Level 5
Joined
Jan 5, 2019
Messages
108
Yeah okay that seems to hard, for now i think i just stick with this Trigger

  • Frost Nova
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Frost Nova
    • Actions
      • Set Units = (Triggering unit)
      • Set Ability[(Player number of (Owner of Units))] = Frost Nova
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Ability[(Player number of (Owner of Units))] for Units) Less than 1
        • Then - Actions
          • Unit - Add Ability[(Player number of (Owner of Units))] to Units
          • Game - Display to (Player group((Owner of Units))) for 5.00 seconds the text: |c0000FFFF Frost No...
          • Special Effect - Create a special effect attached to the origin of Units using Abilities\Spells\Items\AIem\AIemTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Ability[(Player number of (Owner of Units))] for Units) Less than 10
            • Then - Actions
              • Unit - Increase level of Ability[(Player number of (Owner of Units))] for Units
              • Game - Display to (Player group((Owner of Units))) for 5.00 seconds the text: (|c0000FFFF Frost Nova's |r Level + ( is + ( + (String((Level of Frost Nova for Units))))))
              • Special Effect - Create a special effect attached to the origin of Units using Abilities\Spells\Items\AIem\AIemTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Game - Display to (Player group((Owner of Units))) for 5.00 seconds the text: This spell is alrea...
              • Player - Add 400 to (Owner of Units) Current gold
But im still not sure how to set a max counter for how many spells a Hero can have
 
Inside the gain new ability then - Actions: ask if an counter ( be it integer array, be it an hidden abilty, be it food or whatever you like) is below the max amount of spells learnable.
If the upper limit is reached do not allow to add an new ability.
If the limit is not reached, add the ability and increase the counter.​
 
Status
Not open for further replies.
Top