• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

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,239
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