• 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] What does this error message say?

Status
Not open for further replies.
Level 7
Joined
Apr 7, 2009
Messages
241
Im trying to use the Power Slam spell from -BerZeKeR-'s Simple Spell Pack v1,2d. I imported it into my map and it worked perfectly (coming to the problem soon). It's a spell that deals damage based on strength to a single enemy target. Here's what the original trigger looks like (there's only one trigger, no JASS):
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Power Slam
  • Actions
    • -------- ------------------------------------------------------------------------------------------------- --------
    • -------- Getting the Spell constants --------
    • -------- ------------------------------------------------------------------------------------------------- --------
    • Set Power_Slam_Caster = (Triggering unit)
    • Set Power_Slam_Target = (Target unit of ability being cast)
    • Set Power_Slam_Location = (Position of Power_Slam_Target)
    • Set Power_Slam_Owner = (Owner of Power_Slam_Caster)
    • Set Power_Slam_Ability_Level = (Level of (Ability being cast) for Power_Slam_Caster)
    • -------- ------------------------------------------------------------------------------------------------- --------
    • -------- Setting the Spell values --------
    • -------- ------------------------------------------------------------------------------------------------- --------
    • Set Power_Slam_Strength = (Strength of Power_Slam_Caster (Include bonuses))
    • Set Power_Slam_Damage_Multiplier = (2 x Power_Slam_Ability_Level)
    • Set Power_Slam_Damage = ((Real(Power_Slam_Strength)) x (Real(Power_Slam_Damage_Multiplier)))
    • Set Power_Slam_Base_Chance = 15.00
    • Set Power_Slam_Total_Chance = (Power_Slam_Base_Chance x (Real(Power_Slam_Ability_Level)))
    • Set Power_Slam_Dummy_Ability = Power Slam(dummy)
    • -------- ------------------------------------------------------------------------------------------------- --------
    • -------- Damaging the Target --------
    • -------- ------------------------------------------------------------------------------------------------- --------
    • Unit - Cause Power_Slam_Caster to damage Power_Slam_Target, dealing Power_Slam_Damage damage of attack type Spells and damage type Unknown
    • -------- ------------------------------------------------------------------------------------------------- --------
    • -------- Creating nice special effect --------
    • -------- ------------------------------------------------------------------------------------------------- --------
    • Special Effect - Create a special effect at Power_Slam_Location using Abilities\Weapons\Bolt\BoltImpact.mdl
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Create a special effect at Power_Slam_Location using Abilities\Spells\Human\StormBolt\StormBoltMissile.mdl
    • Special Effect - Destroy (Last created special effect)
    • -------- ------------------------------------------------------------------------------------------------- --------
    • -------- Giving a chance to trigger the bonus actions --------
    • -------- ------------------------------------------------------------------------------------------------- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random real number between 1.00 and 100.00) Less than or equal to Power_Slam_Total_Chance
      • Then - Actions
        • -------- ------------------------------------------------------------------------------------------------- --------
        • -------- Setting the Dummy, ordering it to cast a spell --------
        • -------- ------------------------------------------------------------------------------------------------- --------
        • Unit - Create 1 Dummy for Power_Slam_Owner at Power_Slam_Location facing Default building facing degrees
        • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
        • Unit - Add Power_Slam_Dummy_Ability to (Last created unit)
        • Unit - Set level of Power_Slam_Dummy_Ability for (Last created unit) to Power_Slam_Ability_Level
        • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt Power_Slam_Target
        • -------- ------------------------------------------------------------------------------------------------- --------
        • -------- Creating nice special effect --------
        • -------- ------------------------------------------------------------------------------------------------- --------
        • Special Effect - Create a special effect at Power_Slam_Location using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
        • Special Effect - Destroy (Last created special effect)
        • -------- ------------------------------------------------------------------------------------------------- --------
      • Else - Actions
    • -------- ------------------------------------------------------------------------------------------------- --------
    • -------- Creating and setting floating text --------
    • -------- ------------------------------------------------------------------------------------------------- --------
    • Floating Text - Create floating text that reads ((String((Integer(Power_Slam_Damage)))) + !) above Power_Slam_Target with Z offset 0.00, using font size 10.00, color (0.00%, 40.00%, 100.00%), and 0.00% transparency
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
    • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
    • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
    • -------- ------------------------------------------------------------------------------------------------- --------
    • -------- Clearing Leaks --------
    • -------- ------------------------------------------------------------------------------------------------- --------
    • Custom script: call RemoveLocation(udg_Power_Slam_Location)
As mentioned the trigger above works perfectly. But I wanted to modify it, right now it starts at 2x strength in damage and then increases by 2x each lvl. I wanted it to start at 1.1x strength and then increase by just 0.1x strength every lvl (dont ask why). So I want like lvl 1 = 1.1x strength, lvl 2 = 1.2x strength, lvl 3 = 1.3x strength etc...

Since I suck with GUI (and jass) I couldnt do it myself so I sent a message to the maker of the spell and he told me to replace
  • Set Power_Slam_Damage_Multiplier = (2 x Power_Slam_Ability_Level)
with
  • Set Power_Slam_Damage_Multiplier = ((0.10 x (Real((Level of Power Slam for Power_Slam_Caster)))) + 1.00)
But now when I try to test my map I get a error message that says:
Line 159: Type mismatch in assignment

Line 159: set udg_Power_Slam_Damage_Multiplier = ( ( 0.10 * I2R(GetUnitAbilityLevelSwapped('A01E', udg_Power_Slam_Caster)) ) + 1 )

I told the maker of the spell that helped me about this error and he didnt have a clue of what's wrong so now I am turning to everybody at this forum instead. Please help me :nw:
 
Level 7
Joined
Apr 7, 2009
Messages
241
I'm guessing Power_Slam_Damage_Multiplier is an INTEGER variable, but you get a REAL value, that would be the most logic reason why this wouldn't work

I think you may be right, gonna check :O

Edit: Now I have changed the variable to real, but still the spell dosnt work as intended. On level one it's supposed to deal 1.1x of the casters strength in damage. Now it deals 0.1x of the casters strength + 1 normal damage :O

I think the problem is that it counts the + 1.00 part in:
  • Set Power_Slam_Damage_Multiplier = (0.10 x ((Real((Level of Power Slam for Power_Slam_Caster))) + 1.00))
As 1 damage and not 1.00x of casters strength. I dont know how to fix it, I am a noob at GUI : /
 
Last edited:
Level 9
Joined
May 22, 2009
Messages
276
it might be that because you changed it to REAL that the other lines the variable is used don't work, just check those again,

  • Set Power_Slam_Damage = ((Real(Power_Slam_Strength)) x (Real(Power_Slam_Damage_Multiplier)))
would become

  • Set Power_Slam_Damage = ((Real(Power_Slam_Strength)) x (Power_Slam_Damage_Multiplier))
you're wrong about that the 1 is=1 damage, it clearly says Multiplier x strenght, and the multiplier = 0.1+1=1.1

Also make sure Power_Slam_Damage is also REAL
 
We tried real/integer almost everything, the strange thing is that it worked for me but not for him, it was the exact same code :eek:

I'm also getting an idea to do this:

Make another real variable name it Power_slam_calculation (or something) and calculate this (0.10 x ((Real((Level of Power Slam for Power_Slam_Caster))

set Power_slam_calculation = (0.10 x ((Real((Level of Power Slam for Power_Slam_Caster))

and then

Set Power_Slam_Damage_Multiplier = ((Power_slam_calculation) + 1)

Try that, if that doesn't work, then you can only try to store every single value into a variable and then put it together.

Now I'm really out of ideas :/
 
Level 9
Joined
May 22, 2009
Messages
276
If you haven't come to a solution, try this:

first make Power_Slam_Damage_Multiplier and Power_Slam_Damage REAL

Then revise these 3 lines:

  • Set Power_Slam_Damage_Multiplier = (2 x Power_Slam_Ability_Level)
  • Set Power_Slam_Damage = ((Real(Power_Slam_Strength)) x (Real(Power_Slam_Damage_Multiplier)))
  • Unit - Cause Power_Slam_Caster to damage Power_Slam_Target, dealing Power_Slam_Damage damage of attack type Spells and damage type Unknown
you can remake them or just check the parts containing the variables
If the spell worked before with integer values, the problem must lie within these 3 lines.
 
Level 7
Joined
Apr 7, 2009
Messages
241
If you haven't come to a solution, try this:

first make Power_Slam_Damage_Multiplier and Power_Slam_Damage REAL

Then revise these 3 lines:

  • Set Power_Slam_Damage_Multiplier = (2 x Power_Slam_Ability_Level)
  • Set Power_Slam_Damage = ((Real(Power_Slam_Strength)) x (Real(Power_Slam_Damage_Multiplier)))
  • Unit - Cause Power_Slam_Caster to damage Power_Slam_Target, dealing Power_Slam_Damage damage of attack type Spells and damage type Unknown
you can remake them or just check the parts containing the variables
If the spell worked before with integer values, the problem must lie within these 3 lines.

It's ok, It's solved now :D
 
Status
Not open for further replies.
Top