Saturday, April 21, 2012

mount/dismount as hero ability

Hello guys.

I've been working for a while on a long campaign, and decided, at one point, to give the hero an ability to shapeshift. Now, said hero uses the model of the human Archmage, so I felt right to use a customized Mount Hippogryph to make the hero shift, as well as keep the horse (Riderless Horse) around.

Only that the ability multiplies the hero every time it is used. (multiple ressurectable heroes appear). I've solved said problem by destroying the dead hero every time the spell is cast, which works perfectly.

However, when i use the reverse, the hero is reset to level one. I've tried setting his stuff as variables, him as variable, replacing, restoring from game cache saved before the shift, and none work.

Anyone has any idea what I could use to make him the same? Thanks in advance.|||I had a similar problem where the hero had to be replaced with an other hero. I used the noob method by just placing a hero on the field for Neutral - Passive and then this trigger:


Code:
RHeroLevel
Events
Unit - A unit Gains a level
Conditions
(Leveling Hero) Equal to HeroVariableRed[1]
Actions
Hero - Set HeroVariableRed[2] experience to HeroVariableRed[1], Hide level-up graphics

These are issues with this technique which I found out:

You need to repick the abilities for the hero (Does not need to be a bad thing)

If the hero does not level, the experience is not transferred.

(Example: Your mounted hero has 199 experience, and needs 1 experience for level 2, then you use the ability, your new hero will have 0 experience.)|||Thanks, I'll try it out and see how it works, and let you know.

As to the level, i'm not really interested into keeping all the experience (anyway, he gains said ability at higher level), but I'm trying to keep the chosen skills and items, which didn't work.

But I'll try now :)|||I forgot to add the trigger I used to replace the unit.


Code:
    Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Mount Hippogryph
Actions
Unit - Set life of HeroVariableRed[2] to (Percentage life of HeroVariableRed[1])%
Unit - Set mana of HeroVariableRed[2] to (Percentage mana of HeroVariableRed[1])%
Unit - Turn collision for HeroVariableRed[1] Off
Unit - Turn collision for HeroVariableRed[2] Off
Unit - Move HeroVariableRed[2] instantly to (Position of HeroVariableRed[1])
Unit - Hide HeroVariableRed[1]
Unit - Unhide HeroVariableRed[2]
Unit - Change ownership of HeroVariableRed[1] to Neutral Passive and Change color
Unit - Turn collision for HeroVariableRed[1] On
Unit - Turn collision for HeroVariableRed[2] On
Unit - Change ownership of HeroVariableRed[2] to Player 1 (Red) and Change color
Selection - Select HeroVariableRed[2] for Player 1 (Red)

Note: My trigger also lets you get the other unit back if you reverse the variables.

No comments:

Post a Comment