HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Two questions.

08-03-2007, 12:39 AM#1
Kilcannon
I have two, questions. One is a lil unimportant, and the other a little more crucial. I think I'll get the little one out of the way first.

I'm making a map where there are computer controled heroes lying around that you temporarily take control of through a computer player you have shared units with. My problem is the lil box thing that displays the player you're controlling's resource. Is there any way to remove this? I've looked all over game constants and whatnot, and can't find a thing. It's not a big thing, I just find it really annoying...

Second, I'm looking for a way to give a unit an ability which will randomly morph the unit into 1 of several other units, but I have no idea how to work this out. I'm not too skilled at triggers right now, but I can follow directions fairly well.

Any help you could offer would be greatly appreciated.
08-03-2007, 02:36 AM#2
PenguinEmperor
Dosen't Hex do that morph thing?
08-03-2007, 03:18 AM#3
Castlemaster
To answer #2, I'm guessing you're referring to a morph ability, like storm crow or bear form. The beast way to do that would be to make several abilities that morph the unit into one type. Like one for a bear, one for a crow, one for a demon, etc. Then when you want to morph, choose one of these abilities at random, add it to the unit and order the unit to cast it.

The difficulty of that would be making all the spells for that ability.
08-03-2007, 12:46 PM#4
Kilcannon
@ PenguinEmperor: I guess I should have been a bit more clear. Sorry about that.

@ CastleMaster: I took your advise and started making some morphing abilities, but I ran into a few problems. I think I should clarify what it is I'm aiming for first though. I'm trying to make a hero who, in his original form, is weaker than the normal hero, but still has skills of his own to defend himself. The morphing abilities, I intended to have as his ultimate, as it would be granting him greater power and different skills. Seeing as how it would be a hero ability, I thought metamorphosis would be ideal. Turns out it isn't. The alternate unit retains the original unit's spells, no matter what you set em to. And so I sought out different morphing skills. Bear form and raven form were the only ones I could think of, and unfortunately they have the same problem.

Thus, I humbly request an answer to this question: Is there another morph ability, one that does not retain skills, or am I doomed to build this ability completely from triggers?
08-03-2007, 01:10 PM#5
CommanderZ
Ithink you can make the ability not permanent by setting UnitMakeAbilityPermanent() to false
Collapse JASS:
native    UnitMakeAbilityPermanent    unit whichUnit, boolean permanent, integer abilityId    

Then it should be lost when morphing

PS: Its gui counterpart doesn't seem to exist
08-03-2007, 01:33 PM#6
Anitarf
I don't think you can change the learnable hero skills with morph abilities. You could try engineering upgrade but that doesn't work right on already learned skills (as far as I know it retains the old skill's way of working and only updates the stat/data fields), unless all your skills were passive dummy abilities and you added actual abilities with triggers, then you could add and remove them freely as well as swap hero skills with engineering upgrade. Would take a bit of triggering though.

An alternative would be to simply swap the hero with the alternate version of itself which you would otherwise keep hidden in a corner of the map and update the hp/mana/exp on the new form to match those of the original which you again hide for the time being.
08-03-2007, 06:54 PM#7
Kilcannon
Well, I tried what you said Anitarf, and the morphing works well enough, but the icons for the hidden heroes still appear in the upper left corner.

Anyway here is what I came up with. It seems to work well enough.
Trigger:
Morph
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Morph
Collapse Actions
Set Randomizer = (Random integer number between 1 and 20)
Set CasterLoc = (Position of Blood Mage 0000 <gen>)
Set CasterLevel = (Hero level of Blood Mage 0000 <gen>)
Unit - Hide Blood Mage 0000 <gen>
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Randomizer Less than or equal to 10
Collapse Then - Actions
Hero - Set Paladin 0001 <gen> Hero-level to CasterLevel, Hide level-up graphics
Unit - Move Paladin 0001 <gen> instantly to CasterLoc
Unit - Unhide Paladin 0001 <gen>
Collapse Else - Actions
Hero - Set Mountain King 0002 <gen> Hero-level to CasterLevel, Hide level-up graphics
Unit - Move Mountain King 0002 <gen> instantly to CasterLoc
Unit - Unhide Mountain King 0002 <gen>
Wait 10.00 seconds
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Randomizer Less than or equal to 10
Collapse Then - Actions
Set AltLoc1 = (Position of Paladin 0001 <gen>)
Set CasterLevel = (Hero level of Paladin 0001 <gen>)
Unit - Hide Paladin 0001 <gen>
Hero - Set Blood Mage 0000 <gen> Hero-level to CasterLevel, Hide level-up graphics
Unit - Move Blood Mage 0000 <gen> instantly to AltLoc1
Unit - Unhide Blood Mage 0000 <gen>
Collapse Else - Actions
Set AltLoc2 = (Position of Mountain King 0002 <gen>)
Set CasterLevel = (Hero level of Mountain King 0002 <gen>)
Unit - Hide Mountain King 0002 <gen>
Hero - Set Blood Mage 0000 <gen> Hero-level to CasterLevel, Hide level-up graphics
Unit - Move Blood Mage 0000 <gen> instantly to AltLoc2
Unit - Unhide Blood Mage 0000 <gen>
Custom script: call RemoveLocation(udg_CasterLoc)
Custom script: call RemoveLocation(udg_AltLoc2)
Custom script: call RemoveLocation(udg_AltLoc1)

How does it look?