HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.
Pages: 1 2 [3]

Author Topic: Simple ability tooltip window  (Read 8667 times)

Lattam

  • World Owners
  • ****
  • Posts: 4
    • View Profile
Re: Simple ability tooltip window
« Reply #30 on: Jun 05, 12, 08:31:38 PM »

I am having troubles with the script as well.   I made it a few times...once with my own engine code M_AbilityTooltipClassMethods,  and the second time I followed the tutorial to the letter.

Both times The tooltip will appear on screen and disappear appropriately,  however the text is not showing up.  Here is the error I receive in the console.



Quote
21:29:31: System:SCRIPT[E_AbilityBarClassMethods]:Ability1: Weapon Strike
21:29:31: !ERROR!HeroScript::HeroMachine::ScriptError:GOM::getVariableReferenceFromNode (10757): requested node ID (0) not found
21:29:31: !ERROR!System:SCRIPT ERROR: GOM::getVariableReferenceFromNode (10757): requested node ID (0) not found
06/05/2012 21:29:26
Call trace:
  Script My_AbilityTooltipClassMethods line 3 me[id=1000003259 class=MY_AbilityTooltip]
  Script E_AbilityBarClassMethods line 131 me[1000001251]
starting method/function ONMOUSEENTER
starting me[id=1000001251 class=E_AbilityBar]

Here is my E_AbilityBarClassMethods

Code: [Select]
method onMouseEnter(args references Class GUIMouseEvent)
  target as NodeRef of Class GUIControl = args.source
  abilityTooltip as NodeRef of Class MY_AbilityTooltip = CreateNodeFromPrototype("MY_AbilityTooltip")
  abilityTooltip.name = "MY_AbilityTooltip" 
  abilityTooltip.build = true
 
  when target.name
    is "Ability1"
      println("Ability1: Weapon Strike")
      abilityTooltip.setAbilityName(abWeaponStrike:GetAbilityName())
      abilityTooltip.setCooldown(abWeaponStrike:GetAbilityCooldown().secondsTotal)
      abilityTooltip.setElement("None")
      abilityTooltip.setRange(abWeaponStrike:GetMaxRange())
      abilityTooltip.setTargetType(abWeaponStrike:GetTargetType())
    .
    is "Ability2"
      println("Ability2: Fireball")
      abilityTooltip.setAbilityName(abFireball:GetAbilityName())
      abilityTooltip.setCooldown(abFireball:GetAbilityCooldown().secondsTotal)
      abilityTooltip.setElement("Fire")
      abilityTooltip.setMinDamage(abFireball:GetMinDamage())
      abilityTooltip.setMaxDamage(abFireball:GetMaxDamage())
      abilityTooltip.setRange(abFireball:GetMaxRange())
      abilityTooltip.setTargetType(abFireball:GetTargetType())
    .
    is "Ability3"
      println("Ability3: Heal Damage")
      abilityTooltip.setAbilityName(abHeal:GetAbilityName())
      abilityTooltip.setCooldown(abHeal:GetAbilityCooldown().secondsTotal)
      abilityTooltip.setElement("Light")
      abilityTooltip.setRange(abHeal:GetMaxRange())
      abilityTooltip.setTargetType(abHeal:GetTargetType())
    .
  .
.


and here is the MY_AbilityTooltipClassMethods

Code: [Select]
method setAbilityName(name as String)
  an as NodeRef of Class GUILabel = FindGUIControlByName(me, "MY_AbilityTooltip.tooltipWindow.background.abilityName")
  an.text = name
.

method setElement(element as String)
  ae as NodeRef of Class GUILabel = FindGUIControlByName(me, "MY_AbilityTooltip.tooltipWindow.background.abilityElement")
  ae.text = "Element: " + element
.

method setMinDamage(mindmg as String)
  amd as NodeRef of Class GUILabel = FindGUIControlByName(me, "MY_AbilityTooltip.tooltipWindow.background.abilityMinDamage")
  amd.text = "Min Damage: " + mindmg
.

method setMaxDamage(maxdmg as String)
  amd as NodeRef of Class GUILabel = FindGUIControlByName(me, "MY_AbilityTooltip.tooltipWindow.background.abilityMaxDamage")
  amd.text = "Max Damage: " + maxdmg
.

method setCooldown(cooldown as String)
  ac as NodeRef of Class GUILabel = FindGUIControlByName(me, "tooltipWindow.background.abilityCooldown")
  ac.text = "Cooldown: " + cooldown + " seconds"
.

method setRange(range as String)
  ar as NodeRef of Class GUILabel = FindGUIControlByName(me, "MY_AbilityTooltip.tooltipWindow.background.abilityRange")
  ar.text = "Range: " + range + " meters"
.

method setTargetType(targettype as String)
  att as NodeRef of Class GUILabel = FindGUIControlByName(me, "MY_AbilityTooltip.tooltipWindow.background.abilityTarget")
  att.text = "Target type: " + targettype
.

I am sure there is something I am overlooking.  Any thoughts?

Lattam
Logged
Pages: 1 2 [3]