• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Giving bear form new abilities

Status
Not open for further replies.
Level 3
Joined
Jul 7, 2009
Messages
43
Ok, im using bear form for a hero, i have the main hero and his 5 levels of the bear form...I want to save the levels of 2 of his abilities and give the bear form new ones, problem is it only saves the level of the abilities you have currently into the hashtable, and never updates them....i need an addition to my trigger that updates Tempint3 and 4 to the CURRENT level when they turn into the Tiger, which is Ulti Fix (the tiger model form) Ulti Fix Copy is the Human form...need the level of Tempint3 and 4 to either update when they level the ability...or update every so many seconds while they are in human form (Ulti Fix Copy)


  • Ulti Fix
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tiger Form
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Kevinn Equal to False
        • Then - Actions
          • Set Kevinn = True
          • Hashtable - Create a hashtable
          • Set HashTable2 = (Last created hashtable)
          • Set TempInt = (Level of Dragon Claw for (Triggering unit))
          • Set TempInt2 = (Level of Hatchet Reel for (Triggering unit))
        • Else - Actions
      • Unit - Remove Dragon Claw from (Triggering unit)
      • Unit - Remove Hatchet Reel from (Triggering unit)
      • Player - Disable Hatchet Reel for (Owner of (Triggering unit))
      • Player - Disable Dragon Claw for (Owner of (Triggering unit))
      • Wait 0.10 seconds
      • Unit - Add Rake to (Triggering unit)
      • Unit - Add Prowl to (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Kevinn_Copy Equal to False
        • Then - Actions
          • Unit - Set level of Prowl for (Triggering unit) to TempInt
          • Unit - Set level of Rake for (Triggering unit) to TempInt2
          • Set Kevinn_Copy = True
        • Else - Actions
          • Set TempInt3 = (Load 2 of (Key (Triggering unit)) from HashTable2)
          • Set TempInt4 = (Load 3 of (Key (Triggering unit)) from HashTable2)
          • Unit - Set level of Prowl for (Triggering unit) to TempInt3
          • Unit - Set level of Rake for (Triggering unit) to TempInt4
          • Set TempInt = TempInt3
          • Set TempInt2 = TempInt4
      • Hashtable - Save TempInt as 0 of (Key (Triggering unit)) in HashTable2
      • Hashtable - Save TempInt2 as 1 of (Key (Triggering unit)) in HashTable2
      • Trigger - Turn on Ulti Fix Copy <gen>
      • Trigger - Turn off (This trigger)
  • Ulti Fix Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Tiger Form
    • Actions
      • Player - Enable Dragon Claw for (Owner of (Triggering unit))
      • Player - Enable Hatchet Reel for (Owner of (Triggering unit))
      • Set TempInt = (Load 0 of (Key (Triggering unit)) from HashTable2)
      • Set TempInt2 = (Load 1 of (Key (Triggering unit)) from HashTable2)
      • Unit - Remove Prowl from (Triggering unit)
      • Unit - Remove Rake from (Triggering unit)
      • Wait 0.15 seconds
      • Unit - Add Dragon Claw to (Triggering unit)
      • Unit - Add Hatchet Reel to (Triggering unit)
      • Unit - Set level of Hatchet Reel for (Triggering unit) to TempInt2
      • Unit - Set level of Dragon Claw for (Triggering unit) to TempInt
      • Set TempInt3 = (Level of Dragon Claw for (Triggering unit))
      • Set TempInt4 = (Level of Hatchet Reel for (Triggering unit))
      • Hashtable - Save TempInt3 as 2 of (Key (Triggering unit)) in HashTable2
      • Hashtable - Save TempInt4 as 3 of (Key (Triggering unit)) in HashTable2
      • Trigger - Turn on Ulti Fix <gen>
      • Trigger - Turn off (This trigger)

EDIT: ok i got that to work but now i need my trigger to set the actual level of Hatchet Heel and Dragon Claw to the correct levels, in this trigger it does this

  • Unit - Set level of Hatchet Reel for (Triggering unit) to TempInt2
  • Unit - Set level of Dragon Claw for (Triggering unit) to TempInt
  • Set TempInt3 = (Level of Dragon Claw for (Triggering unit))
  • Set TempInt4 = (Level of Hatchet Reel for (Triggering unit))
Which pretty much means it saves the new ability instantly, is there a trigger that can update those 2 variables if the person levels up the ability while in regular form? right now it just saves the ability levels, then keeps loading the same levels every time, i want the trigger to update it since this is going to be in an AoS, people will be leveling the abilities all the time =(

+rep if you can help me...im really stuck now =(
 
Last edited:
Level 9
Joined
May 27, 2006
Messages
498
Apparently it's impossible to remove hero abilities... But there is a solution. Just disable the abilities you don't want to be visible, and then when the player switches form back, enable them again.
Player -> Enable/Disable ability

Also this way you don't have to set ability levels
 
Level 9
Joined
May 27, 2006
Messages
498
First off, don't remove the abilities, disabling them is enough, they won't be shown, and the hero will get them back at the very same level when you enable them.

Also, you can use the same thing to disable Rake and Prowl too, when he is in his human form.

I think this is what causes your problems, since when abilities are removed, their level is set back to 0, therefore variables always returned same value. Normally they would be updated each time the trigger runs.
 
Level 3
Joined
Jul 7, 2009
Messages
43
First off, don't remove the abilities, disabling them is enough, they won't be shown, and the hero will get them back at the very same level when you enable them.

Also, you can use the same thing to disable Rake and Prowl too, when he is in his human form.

I think this is what causes your problems, since when abilities are removed, their level is set back to 0, therefore variables always returned same value. Normally they would be updated each time the trigger runs.

Hmm, the human form doesnt have the tiger abilities, its the tiger with human, but even if it is me removing the abilities, the fact it is loading the SAME level over and over after the 3rd switch, 1st and 2nd switch work, means that the hashtable is saving wrong, even if i dont need the remove/add, it would still give me the right level if the hashtable was updating properly im pretty sure..
 
Level 9
Joined
May 27, 2006
Messages
498
Just add the tiger abilities and disable them on map initialization, so they become enabled when the player switches form.

According to returning same values over and over again... Look at this.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Kevinn Equal to False
    • Then - Actions
      • Set Kevinn = True
      • Hashtable - Create a hashtable
      • Set HashTable2 = (Last created hashtable)
      • Set TempInt = (Level of Dragon Claw for (Triggering unit))
      • Set TempInt2 = (Level of Hatchet Reel for (Triggering unit))
Contruction of your trigger makes this if block run only once, and thus the variables get updated only once, when the trigger runs for the very first time.

Get rid of this if-block, since it's pointless. Put the hashtable creation part in your map initialization trigger. And those two variables somewhere, where they will do their job.

Edit; ah, damn it.
You don't even need to set the levels of those abilities. Unless i understood you wrong and you wish ability of, say, Rake to be equal to level of Hatchet Reel, etc.


  • Ulti Fix
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tiger Form
    • Actions
      • Player - Disable Hatchet Reel for (Owner of (Triggering unit))
      • Player - Disable Dragon Claw for (Owner of (Triggering unit))
      • Wait 0.10 seconds
      • Player - Enable Rake for (Triggering unit)
      • Player - Enable Prowl for (Triggering unit)
      • Trigger - Turn on Ulti Fix Copy <gen>
      • Trigger - Turn off (This trigger)
  • Ulti Fix Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tiger Form
    • Actions
      • Player - Disable Rake for (Owner of (Triggering unit))
      • Player - Disable Prowl for (Owner of (Triggering unit))
      • Wait 0.15 seconds
      • Player - Enable Dragon Claw for (Owner of (Triggering unit))
      • Player - Enable Hatchet Reel for (Owner of (Triggering unit))
      • Trigger - Turn on Ulti Fix <gen>
      • Trigger - Turn off (This trigger)
 
Level 3
Joined
Jul 7, 2009
Messages
43
Just add the tiger abilities and disable them on map initialization, so they become enabled when the player switches form.



How could i disable the abilities for the owner of the unit on map initialization? disable it for every color or something?

Sorry if i seem kinda noob, first time using hashtables and first time making a bearform trigger lol...

  • Ulti Fix
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tiger Form
    • Actions
      • Set TempInt = (Level of Dragon Claw for (Triggering unit))
      • Set TempInt2 = (Level of Hatchet Reel for (Triggering unit))
      • Player - Disable Hatchet Reel for (Owner of (Triggering unit))
      • Player - Disable Dragon Claw for (Owner of (Triggering unit))
      • Wait 0.10 seconds
      • Unit - Add Rake to (Triggering unit)
      • Unit - Add Prowl to (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Kevinn_Copy Equal to False
        • Then - Actions
          • Unit - Set level of Prowl for (Triggering unit) to TempInt
          • Unit - Set level of Rake for (Triggering unit) to TempInt2
          • Set Kevinn_Copy = True
        • Else - Actions
          • Set TempInt3 = (Load 2 of (Key (Triggering unit)) from Hashtable)
          • Set TempInt4 = (Load 3 of (Key (Triggering unit)) from Hashtable)
          • Unit - Set level of Prowl for (Triggering unit) to TempInt3
          • Unit - Set level of Rake for (Triggering unit) to TempInt4
          • Set TempInt = TempInt3
          • Set TempInt2 = TempInt4
      • Hashtable - Save TempInt as 0 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save TempInt2 as 1 of (Key (Triggering unit)) in Hashtable
      • Trigger - Turn on Ulti Fix Copy <gen>
      • Trigger - Turn off (This trigger)
  • Ulti Fix Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Tiger Form
    • Actions
      • Set TempInt = (Load 0 of (Key (Triggering unit)) from Hashtable)
      • Set TempInt2 = (Load 1 of (Key (Triggering unit)) from Hashtable)
      • Player - Disable Prowl for (Owner of (Triggering unit))
      • Player - Disable Rake for (Owner of (Triggering unit))
      • Player - Enable Hatchet Reel for (Owner of (Triggering unit))
      • Player - Enable Dragon Claw for (Owner of (Triggering unit))
      • Wait 0.15 seconds
      • Unit - Set level of Hatchet Reel for (Triggering unit) to TempInt2
      • Unit - Set level of Dragon Claw for (Triggering unit) to TempInt
      • Set TempInt3 = (Level of Dragon Claw for (Triggering unit))
      • Set TempInt4 = (Level of Hatchet Reel for (Triggering unit))
      • Hashtable - Save TempInt3 as 2 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save TempInt4 as 3 of (Key (Triggering unit)) in Hashtable
      • Trigger - Turn on Ulti Fix <gen>
      • Trigger - Turn off (This trigger)
 
Level 3
Joined
Jul 7, 2009
Messages
43
Just add the tiger abilities and disable them on map initialization, so they become enabled when the player switches form.

According to returning same values over and over again... Look at this.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Kevinn Equal to False
    • Then - Actions
      • Set Kevinn = True
      • Hashtable - Create a hashtable
      • Set HashTable2 = (Last created hashtable)
      • Set TempInt = (Level of Dragon Claw for (Triggering unit))
      • Set TempInt2 = (Level of Hatchet Reel for (Triggering unit))
Contruction of your trigger makes this if block run only once, and thus the variables get updated only once, when the trigger runs for the very first time.

Get rid of this if-block, since it's pointless. Put the hashtable creation part in your map initialization trigger. And those two variables somewhere, where they will do their job.

Edit; ah, damn it.
You don't even need to set the levels of those abilities. Unless i understood you wrong and you wish ability of, say, Rake to be equal to level of Hatchet Reel, etc.


  • Ulti Fix
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tiger Form
    • Actions
      • Player - Disable Hatchet Reel for (Owner of (Triggering unit))
      • Player - Disable Dragon Claw for (Owner of (Triggering unit))
      • Wait 0.10 seconds
      • Player - Enable Rake for (Triggering unit)
      • Player - Enable Prowl for (Triggering unit)
      • Trigger - Turn on Ulti Fix Copy <gen>
      • Trigger - Turn off (This trigger)
  • Ulti Fix Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tiger Form
    • Actions
      • Player - Disable Rake for (Owner of (Triggering unit))
      • Player - Disable Prowl for (Owner of (Triggering unit))
      • Wait 0.15 seconds
      • Player - Enable Dragon Claw for (Owner of (Triggering unit))
      • Player - Enable Hatchet Reel for (Owner of (Triggering unit))
      • Trigger - Turn on Ulti Fix <gen>
      • Trigger - Turn off (This trigger)

Yeah but where in there do i set Rake = to Hatchet? Do i even need hashtables?

Also, rake and prowl are not on the tiger when i swap over, i need to add them to it or they wont be there..
 
Level 9
Joined
May 27, 2006
Messages
498
How could i disable the abilities for the owner of the unit on map initialization? disable it for every color or something?

Sorry if i seem kinda noob, first time using hashtables and first time making a bearform trigger lol...
Yes. Or disable them when the player picks the hero, it doesn't make much of a difference.
And blah, if it's your first time using a hashtable, then you've done it better than i did... I've been clueless when i first saw them :|

Yeah but where in there do i set Rake = to Hatchet? Do i even need hashtables?
That was one thing of which i wasn't sure. Gotta update it.

Also, rake and prowl are not on the tiger when i swap over, i need to add them to it or they wont be there..
Just add them to the hero or his bearform via the Object Editor. It should all be working then.


Edit; this way it should work.
  • Ulti Fix
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tiger Form
    • Actions
      • Hashtable - Save (Level of Hatchet Reel for (Triggering unit)) as 0 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save (Level of Dragon Claw for (Triggering unit)) as 1 of (Key (Triggering unit)) in Hashtable
      • Player - Disable Hatchet Reel for (Owner of (Triggering unit))
      • Player - Disable Dragon Claw for (Owner of (Triggering unit))
      • Wait 0.10 seconds
      • Player - Enable Rake for (Triggering unit)
      • Player - Enable Prowl for (Triggering unit)
      • Unit - Set level of Rake for (Triggering unit) to (Load 0 of (Key (Triggering unit)) from Hashtable)
      • Unit - Set level of Prowl for (Triggering unit) to (Load 1 of (Key (Triggering unit)) from Hashtable)
      • Trigger - Turn on Ulti Fix Copy <gen>
      • Trigger - Turn off (This trigger)
  • Ulti Fix Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tiger Form
    • Actions
      • Hashtable - Save (Level of Rake for (Triggering unit)) as 0 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save (Level of Prowl for (Triggering unit)) as 1 of (Key (Triggering unit)) in Hashtable
      • Player - Disable Rake for (Owner of (Triggering unit))
      • Player - Disable Prowl for (Owner of (Triggering unit))
      • Wait 0.15 seconds
      • Player - Enable Hatchet Reel for (Owner of (Triggering unit))
      • Player - Enable Dragon Claw for (Owner of (Triggering unit))
      • Unit - Set level of Hatchet Reel for (Triggering unit) to (Load 0 of (Key (Triggering unit)) from Hashtable)
      • Unit - Set level of Dragon Claw for (Triggering unit) to (Load 1 of (Key (Triggering unit)) from Hashtable)
      • Trigger - Turn on Ulti Fix <gen>
      • Trigger - Turn off (This trigger)
 
Last edited:
Level 3
Joined
Jul 7, 2009
Messages
43
Gots an issue here.
 

Attachments

  • untitled.jpg
    untitled.jpg
    515 KB · Views: 63
Level 9
Joined
May 27, 2006
Messages
498
Oh snap. Then we're screwed.

Seriously tho... Do all of those abilities have to be learned separately? Ie. can't you, for example, make the Tiger Form level dependant on other learnable skill?
Bah, i guess that's pointless, since that would free up only one slot...

Well, then you have only one solution left, which i wanted to suggest at the beggining, but then i came up with disabling the ability and thought it was a better idea - replacing hero with another unit.
Make a copy of your hero, give him the tiger model/everything you want him to have in cat form. Then by triggers replace the hero with this new unit, as well as items and other stuff.
 
Level 3
Joined
Jul 7, 2009
Messages
43
Oh snap. Then we're screwed.

Seriously tho... Do all of those abilities have to be learned separately? Ie. can't you, for example, make the Tiger Form level dependant on other learnable skill?
Bah, i guess that's pointless, since that would free up only one slot...

Well, then you have only one solution left, which i wanted to suggest at the beggining, but then i came up with disabling the ability and thought it was a better idea - replacing hero with another unit.
Make a copy of your hero, give him the tiger model/everything you want him to have in cat form. Then by triggers replace the hero with this new unit, as well as items and other stuff.

Well the trigger i am using now does this:

1st Cast (To Tiger) - Loads up the ability at the right level (level 2 for both)
2nd Cast (To Rexxar Guy) - Still at level 2, which is what is supposed to happen.
3rd Cast (Back To Tiger) - First 2 skills Dissapear

Is the 3rd cast because he doesnt have any more skill slots so it breaks? or could it be something in my trigger lol

Also in your trigger you have it save first, without loading the value or changing the skill, so wouldnt it just stay at the level is had it set in the first place? it keeps replacing the LOAD with the new SAVE in the trigger..

If you think its the max skill limit ill just make the 2nd unit with the updated exp/level/items and skill levels =P but if you think it could be my trigger then i still have hope, been working on this trigger for about 3-5 hours now lol
 
Level 9
Joined
May 27, 2006
Messages
498
Uhh. I don't know, i'm kind of too tired to think (3 AM here....)
Nonetheless, i'll try

I'm sure the trigger i posted is working correctly, it first saves levels of abilities, because it couldn't do it later, since the unit wouldn't have the abilities anymore. Then it enables the tiger abilities and sets their level, directly loading it from the hashtable, integer variables are not required here

Regarding the skill limit, that's the barrier we can't cross without heavily changing all your other abilities. So i'd say, just make a copy of your hero with all the tiger skills, and replace those two units as neccessary with
  • Unit - Replace your_unit with another_unit using old units life and mana
as well as items and such. That's by far the most straightforward and simple solution out here.


...damn, i really need to get some sleep. In case you couldn't get it working, just post here your progress, i'll answer back in ca. 8 hours.
 
Level 3
Joined
Jul 7, 2009
Messages
43
Alright thanks for the help, ill start working on my trigger, if i run into an issue ill post back here, if not ill post anyways when its done maybe you will have some tips for me on how to compact or make my trigger more effective =D
 
Level 3
Joined
Jul 7, 2009
Messages
43
Ok...tried some crap out...using hashtables and whatnot, and again i run into issues, when i transform is just refunds the ability points, it doesnt set the new ability equal to the level of the old one (Reel = Rake) (Dragon = Prowl) So any help on this would be nice...from anyone =D


  • Ulti Fix
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Test
    • Actions
      • Set Caster = (Triggering unit)
      • Hashtable - Save (Hero experience of Caster) as 0 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 1) as 3 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 2) as 4 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 3) as 5 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 4) as 6 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 5) as 7 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 6) as 8 of (Key (Triggering unit)) in Hashtable
      • Unit - Replace Caster with a Tiger Aspect (Level 1) using The old unit's relative life and mana
      • Wait 0.20 seconds
      • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
      • Hero - Set (Last replaced unit) experience to (Load 0 of (Key (Last replaced unit)) from Hashtable), Hide level-up graphics
      • Unit - Set level of Rake for (Last replaced unit) to (Level of Hatchet Reel for Caster)
      • Unit - Set level of Prowl for (Last replaced unit) to (Level of Dragon Claw for Caster)
      • Unit - Set level of Feline Prowess for (Last replaced unit) to (Level of Feline Prowess for Caster)
      • Unit - Set level of Training for (Last replaced unit) to TempInteger
      • Unit - Set level of Test for (Last replaced unit) to TempInt4
      • Hero - Give (Load 3 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Hero - Give (Load 4 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Hero - Give (Load 5 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Hero - Give (Load 6 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Hero - Give (Load 7 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Hero - Give (Load 8 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Wait 3.00 seconds
      • Trigger - Turn on Ulti Fix Copy <gen>
      • Trigger - Turn off (This trigger)
  • [/HIDDEN]

  • Ulti Fix Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Test
    • Actions
      • Set Caster = (Triggering unit)
      • Hashtable - Save (Hero experience of Caster) as 0 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 1) as 3 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 2) as 4 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 3) as 5 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 4) as 6 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 5) as 7 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by Caster in slot 6) as 8 of (Key (Triggering unit)) in Hashtable
      • Unit - Replace Caster with a Tiger Aspect using The old unit's relative life and mana
      • Wait 0.20 seconds
      • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
      • Hero - Set (Last replaced unit) experience to (Load 0 of (Key (Last replaced unit)) from Hashtable), Hide level-up graphics
      • Unit - Set level of Hatchet Reel for (Last replaced unit) to (Level of Rake for Caster)
      • Unit - Set level of Dragon Claw for (Last replaced unit) to (Level of Prowl for Caster)
      • Unit - Set level of Feline Prowess for (Last replaced unit) to (Level of Feline Prowess for Caster)
      • Unit - Set level of Test for (Last replaced unit) to TempInt4
      • Unit - Set level of Training for (Last replaced unit) to TempInteger
      • Hero - Give (Load 3 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Hero - Give (Load 4 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Hero - Give (Load 5 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Hero - Give (Load 6 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Hero - Give (Load 7 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Hero - Give (Load 8 of (Key (Last replaced unit)) in Hashtable) to (Last replaced unit)
      • Wait 3.00 seconds
      • Trigger - Turn on Ulti Fix <gen>
      • Trigger - Turn off (This trigger)
  • [/HIDDEN]
 
Level 9
Joined
May 27, 2006
Messages
498
Well, setting level doesn't work because the unit doesn't have the ability. Does the tiger form have those abilities? Ie. Rake, Prowl, Feline Prowess and Training? You should add them via the Object Editor

And don't store Triggering unit to a variable, it's not needed, since Triggering unit is not affected by waits or anything. Also, i checked the ReplaceUnit function - you don't have to store hero XP and items, if both units are heroes it does it by default.
So now you only need to store ability levels before replacing the unit, since it will get removed and you won't be able to retrieve this information later.


In case tiger form has those learnable hero abilities, but for some strange reason it still doesn't work, then just use Unit - Add ability to add them.
Oh, and i noticed one possible inconveniece... When you replace the unit, it removes the old one, which means that all cooldowns will be reset. In case this would be a major problem for you, i can write you a jass function that will preserve the old unit so that players wouldn't be able to reset cooldowns by switching forms all the time.

Also, i didn't notice that before, in case skill points are still here, you can subtract them with
  • Hero - Modify unspent skill points of your_unit: subtract ((Level of Rake for your_unit) + (Level of Prowl for your_unit) + ...and other trainable hero abilities))
 
Last edited:
Level 3
Joined
Jul 7, 2009
Messages
43
That would be great, but im letting u know now i cant edit or even know where to place jass, i tried learning it but i just dont have the time. So im gonna need specifics on where to put it and how to use it =P
 
Level 9
Joined
May 27, 2006
Messages
498
Oh, whoops, seems like I overestimated warcraft's mechanics. The replacement function works perfectly, but i just can't get rid of the hero icon, it persists on the interface even when I hide the unit, pause it, give it locust ability...
Unless there is some Jass function of which I dont know, the only way to fix this is to disable the hero icon via Object Editor. You could disable the icon for your tiger unit, so that it would look less weird to the player.
It's called Statistics - Hero - Hide hero icon, or something like that. Right beneath movement section.


Edit: Facepalm, nevermind, i solved it by simply giving ownership over the unit to neutral player. Attaching map.
 

Attachments

  • UnitReplace.w3x
    18.3 KB · Views: 34
Level 3
Joined
Jul 7, 2009
Messages
43
i have a tree revival script in my map header, do i just go to the bottom and paste yours in?
 
Level 3
Joined
Jul 7, 2009
Messages
43
Yes, they won't affect each other in any way.

b. write: call UnitReplace(udg_name_of_your_unit_variable, 'rawcode_unit_type_of_your_new_unit', udg_name_of_your_hashtable, number_of_key_used_to_save_the_unit_in_the_hashtable)

Is this the only way i can replace my units now? i tried using my old trigger i had that replaces upon casting ability and it doesnt seem to be working now..

And why is that saving to a hashtable? im not using a hashtable anymore in my trigger lol

EDIT: Nvm, i had it set to "Replace Caster" when i removed the variable caster earlier...my bad =D
 
Level 9
Joined
May 27, 2006
Messages
498
Is this the only way i can replace my units now?
You can still replace the units using the normal action (Unit - Replace unit). It's impossible to alter the way actions work using Jass functions

And why is that saving to a hashtable? im not using a hashtable anymore in my trigger lol
Hashtable is used inside the function to swap between the two units without the need to remove them/create new ones. Im sure you're using a hashtable in some other trigger, so i guess it doesn't make that much of a difference.

So anyway, i hope everything's working as intended? :)
 
Level 3
Joined
Jul 7, 2009
Messages
43
What is wrong with this...it doesnt give me a unit or unhide anything =( im trying to fix my own trigger.

  • Ulti Fix Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Test
    • Actions
      • Set UnitVarCaster4 = (Triggering unit)
      • Set Caster = (Load 7 of (Key (Triggering unit)) in Hashtable)
      • Hashtable - Save Handle Of(Item carried by (Triggering unit) in slot 1) as 0 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by (Triggering unit) in slot 2) as 1 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by (Triggering unit) in slot 3) as 2 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by (Triggering unit) in slot 4) as 3 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by (Triggering unit) in slot 5) as 4 of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Item carried by (Triggering unit) in slot 6) as 5 of (Key (Triggering unit)) in Hashtable
      • Unit - Change ownership of Caster to (Owner of UnitVarCaster4) and Change color
      • Unit - Move Caster instantly to (Position of UnitVarCaster4)
      • Unit - Unhide Caster
      • Unit - Change ownership of UnitVarCaster4 to Neutral Passive and Change color
      • Unit - Hide UnitVarCaster4
      • Hero - Set Caster experience to (Hero experience of Target), Hide level-up graphics
      • Unit - Set level of Hatchet Reel for Caster to (Level of Rake for UnitVarCaster4)
      • Unit - Set level of Dragon Claw for Caster to (Level of Prowl for UnitVarCaster4)
      • Unit - Set level of Feline Prowess for Caster to (Level of Feline Prowess for UnitVarCaster4)
      • Unit - Set level of Training for Caster to (Level of Training for UnitVarCaster4)
      • Unit - Set level of Test for Caster to (Level of Test for UnitVarCaster4)
      • Hero - Give (Load 0 of (Key (Triggering unit)) in Hashtable) to Caster
      • Hero - Give (Load 1 of (Key (Triggering unit)) in Hashtable) to Caster
      • Hero - Give (Load 2 of (Key (Triggering unit)) in Hashtable) to Caster
      • Hero - Give (Load 3 of (Key (Triggering unit)) in Hashtable) to Caster
      • Hero - Give (Load 4 of (Key (Triggering unit)) in Hashtable) to Caster
      • Hero - Give (Load 5 of (Key (Triggering unit)) in Hashtable) to Caster
      • Hero - Modify unspent skill points of Caster: Subtract ((Level of Training for Caster) + ((Level of Hatchet Reel for Caster) + ((Level of Test for Caster) + ((Level of Feline Prowess for Caster) + (Level of Dragon Claw for Caster))))) points
      • Selection - Select Caster for (Owner of Caster)
      • Player - Disable Test for (Owner of Caster)
      • Wait 6.00 seconds
      • Player - Enable Test for (Owner of Caster)
      • Trigger - Turn on Ulti Fix <gen>
      • Trigger - Turn off (This trigger)
 
Level 3
Joined
Jul 7, 2009
Messages
43
Does the casting unit get hidden?
And did you create the unit in the first place?

Also... Am i wrong or did you just re-do my function in GUI? ;p If you have any problems using it, just ask


It did get hidden, and i saved it before i replaced him in my first trigger into hash, it just doesnt show up and doesnt give me control..it was working before and i forgot what i did -_-

and yeah, i took ur ideas and rewrote it kinda...im trying to learn how to do these things not have them done for me =P
 
Level 9
Joined
May 27, 2006
Messages
498
Everything seems to be correct... There is no other reason left other than unit being saved in a wrong/different handle/not saved at all.
You should save the unit that gets hidden to a handle of unit that is shown, and vice versa. I'd place it at the end of your trigger (before the wait), just to be sure it refreshes and saves the correct unit.

To see ingame whether the handle has anything saved, use
  • Game - Display to (All players) the text: (Unit saved: ) + (Name of (Load 7 of (Key (Triggering unit)) in Hashtable))
Also, you no longer have to store items in a hashtable, since you don't remove the unit. You can simply give them to the shown unit
  • For each (Integer A) from 1 to 6, do (Actions)
    • Loop - Actions
      • Hero - Give (Item carried by (Triggering unit) in slot (Integer A)) to Caster
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
Please correct me if im wrong but, cant you control what abilties a unit has through bear form with object editor? like it says Orignal unit and Alternate unit, just give the alternate unit the abilities u want that form to have, abilities dont transfer over through bear form, they have to be issued through object editor that the alternate unit has those same abilities.
 
Level 3
Joined
Jul 7, 2009
Messages
43
  • Ulti Fix
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Test
    • Actions
      • Set Target = (Triggering unit)
      • Hashtable - Save Handle OfTarget as 0 of (Key (Triggering unit)) in Hashtable
      • Unit - Change ownership of Tiger Aspect (Level 1) 0246 <gen> to (Owner of (Triggering unit)) and Change color
      • Unit - Move Tiger Aspect (Level 1) 0246 <gen> instantly to (Position of Target)
      • Unit - Change ownership of Target to Neutral Passive and Change color
      • Unit - Hide Target
      • Hero - Set Tiger Aspect (Level 1) 0246 <gen> experience to (Hero experience of Target), Hide level-up graphics
      • Unit - Unhide Tiger Aspect (Level 1) 0246 <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Hatchet Reel for Target) Greater than 0
        • Then - Actions
          • Unit - Add Rake to Tiger Aspect (Level 1) 0246 <gen>
          • Unit - Set level of Rake for Tiger Aspect (Level 1) 0246 <gen> to (Level of Hatchet Reel for Target)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Dragon Claw for Target) Greater than 0
        • Then - Actions
          • Unit - Add Prowl to Tiger Aspect (Level 1) 0246 <gen>
          • Unit - Set level of Prowl for Tiger Aspect (Level 1) 0246 <gen> to (Level of Dragon Claw for Target)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Feline Prowess for Target) Greater than 0
        • Then - Actions
          • Unit - Add Feline Prowess to Tiger Aspect (Level 1) 0246 <gen>
          • Unit - Set level of Feline Prowess for Tiger Aspect (Level 1) 0246 <gen> to (Level of Feline Prowess for Target)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Training for Target) Greater than 0
        • Then - Actions
          • Unit - Add Training to Tiger Aspect (Level 1) 0246 <gen>
          • Unit - Set level of Training for Tiger Aspect (Level 1) 0246 <gen> to (Level of Training for Target)
        • Else - Actions
      • Unit - Add Test to Tiger Aspect (Level 1) 0246 <gen>
      • Unit - Set level of Test for Tiger Aspect (Level 1) 0246 <gen> to (Level of Test for Target)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Give (Item carried by (Triggering unit) in slot (Integer A)) to Tiger Aspect (Level 1) 0246 <gen>
      • Hero - Modify unspent skill points of Tiger Aspect (Level 1) 0246 <gen>: Subtract ((Level of Training for Tiger Aspect (Level 1) 0246 <gen>) + ((Level of Rake for Tiger Aspect (Level 1) 0246 <gen>) + ((Level of Test for Tiger Aspect (Level 1) 0246 <gen>) + ((Level of Feline Prowess for Tiger Aspect (Level 1) 0246 <gen>) + (Level of Pro points
      • Selection - Select Tiger Aspect (Level 1) 0246 <gen> for (Owner of Tiger Aspect (Level 1) 0246 <gen>)
      • Player - Disable Test for (Owner of Tiger Aspect (Level 1) 0246 <gen>)
      • Wait 6.00 seconds
      • Player - Enable Test for (Owner of Tiger Aspect (Level 1) 0246 <gen>)
      • Trigger - Turn on Ulti Fix Copy <gen>
      • Trigger - Turn off (This trigger)
  • Ulti Fix Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Test
    • Actions
      • Set UnitVarCaster4 = (Triggering unit)
      • Set Target = (Load 0 of (Key (Triggering unit)) in Hashtable)
      • Unit - Unhide Target
      • Unit - Change ownership of Target to (Owner of (Triggering unit)) and Change color
      • Unit - Move Target instantly to (Position of (Triggering unit))
      • Unit - Hide UnitVarCaster4
      • Unit - Change ownership of UnitVarCaster4 to Neutral Passive and Change color
      • Hero - Set Target experience to (Hero experience of UnitVarCaster4), Hide level-up graphics
      • Unit - Set level of Hatchet Reel for Target to (Level of Rake for UnitVarCaster4)
      • Unit - Set level of Dragon Claw for Target to (Level of Prowl for UnitVarCaster4)
      • Unit - Set level of Feline Prowess for Target to (Level of Feline Prowess for UnitVarCaster4)
      • Unit - Set level of Training for Target to (Level of Training for UnitVarCaster4)
      • Unit - Set level of Test for Target to (Level of Test for UnitVarCaster4)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Give (Item carried by (Triggering unit) in slot (Integer A)) to Target
      • Hero - Modify unspent skill points of Target: Subtract ((Level of Training for Target) + ((Level of Hatchet Reel for Target) + ((Level of Test for Target) + ((Level of Feline Prowess for Target) + (Level of Dragon Claw for Target))))) points
      • Selection - Select Caster for (Owner of Target)
      • Player - Disable Test for (Owner of Target)
      • Wait 6.00 seconds
      • Player - Enable Test for (Owner of Target)
      • Trigger - Turn on Ulti Fix <gen>
      • Trigger - Turn off (This trigger)
 
Level 9
Joined
May 27, 2006
Messages
498
Please correct me if im wrong but, cant you control what abilties a unit has through bear form with object editor? like it says Orignal unit and Alternate unit, just give the alternate unit the abilities u want that form to have, abilities dont transfer over through bear form, they have to be issued through object editor that the alternate unit has those same abilities.
As far as i've tested, hero abilities (of the alternate form) are not retained after shapeshifting. And he, as far as i understood, wants the player to be able to attain level and learn hero skills in both forms.
Theoretically you could use the bear form ability to switch models and abilities etc., but it would require some more triggers and workarounds. It's simplier to just replace the two units and set level of abilities appropriately.

@Kevinn
  • Hashtable - Save Handle Of Target as 0 of (Key (Triggering unit)) in Hashtable
That's the problem. You're saving it as 0 of (Key (Triggering unit)). You should save it as Key of Tiger Aspect.
But you need to save the Tiger Aspect as well:
  • Hashtable - Save Handle of Tiger Aspect as 0 of (Key (Triggering unit)) in Hashtable
 
Status
Not open for further replies.
Top