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

Disable learning

Status
Not open for further replies.
Level 1
Joined
Jul 29, 2011
Messages
2
Hi, i made a map which skills has 8 levels.But i dont want to players improve their skills after 5 level. I made a trigger that does it but there's problems.

  • DisableLearning
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned skill level) Greater than 5
    • Actions
      • Unit - Decrease level of Thunder Clap for (Learning Hero)
      • Hero - Modify unspent skill points of (Learning Hero): Add 1 points
      • Game - Display to (All players) the text: You can't improve your skill.
In actions i want to decrease level of LEARNED SKILL.But there is only "Ability being cast". Also i want to show text to only owner of unit, but it displays to Player Group so i can't show this to single player. Can someone help me?
 
  • t
  • Events
    • Unit - A unit learns a skill
  • Conditions
  • Actions
    • Custom script: local integer i = GetLearnedSkill()
    • Custom script: local unit u = GetTriggerUnit()
    • Custom script: if GetUnitAbilityLevel (u, i) > 5 then
    • Custom script: call SetUnitAbilityLevel (u, i, GetUnitAbilityLevel (u, i) - 1)
    • Custom script: endif
    • Custom script: set u = null
Use a custom player group variable to display text to a single player:
  • Set TempGroup = (Player Group(Owner of (Triggering unit)))
  • Game - Display to TempGroup ...
  • Custom script: call DestroyForce (udg_TempGroup)
Use "Convert player group to player" to make this happen.
 
Level 1
Joined
Jul 29, 2011
Messages
2
It work when the ability is 5.But when ability is 6 or 7 (i improve abilities other ways) then it decreases the level of ability.I want to only block.Not decrease.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Instead of setting variable for "showing text to single player only", why not you use the simple action of GetLocalPlayer() ?
Because that shows the text to every player then? I agree it is the ultimate optimization for displaying syncronized text to all players at once though as it saves redundant calls that do not effect the player.

JASS:
native DisplayTimedTextToPlayer takes player toPlayer,real x,real y,real duration,string message returns nothing
 
Status
Not open for further replies.
Top