Unit upgrade and Miss chance

hopy

Active Member
Reaction score
64
Got 2 questions so far today, one of them I already asked befor but doesnt work yet so I thought I'd ask again. :)

Question one: Fixed, Thank you.
The simple question about hit chance ...

Take for example:
Unit one: has the standart ability evasion wich gives him 30% chance to evade an attack.
Unit two: Has a buff from a custom curse ability wich gives him a -100% chance to miss (aka: gives him 100% bonus chance to hit).

If Unit two were to attack unit one ... how much chance of hitting would unit two have?
Would the negative curse cancel out the evasion of wont it matter and still have 30% chance of missing?

Awnser: The Curse will be calculated first and the evasion afther. so at first WIII would say: -100% chance to miss is a hit (always) and afther that it would calculate the evasion with: -30% chance to hit wich would still be only 70% chance to hit with or without the custom curse.

Question two: Fixed, Thank you. (I think? xD)
A bit more complicated question.
I want to have a unit that can upgrade to another unit like a building.
(Like in a "Scout Tower -> Guard Tower" or a Town Hall Upgrade)

It should have a gold cost, lumber cost and building time. (so beserk and stuff wont work).

Would I have to trigger this or is there a simpeler way of achieving this?
My idea was that maybe if I made the unit a building but give it normal attack and movement speed ... would it work?

The whole ability would have to be triggered. can post a trigger tomorow if I get it working.

Thank you for help in advance and +rep if you help solve a problem. Thank you.
Added awnser to the question incase someone else needs it too ... would save em time :p
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Question Two:

Under object editor, find the Techtree - Upgrades to: And insert whatever building you want to upgrade it to. Also, to change the cost of that, I think it'll be in the unit you want to upgrade to's stats. E.g.

Tower 1 upgrades to Tower 2.
Tower 1 should have Techtree - upgrades to: Tower 2
Tower 2 should have the cost you want to be in Stats - Gold cost and Stats - Lumber cost
 

hopy

Active Member
Reaction score
64
Yea but that option doesnt exist for Units ... only for buildings.
And I ain't sure if using a building as a unit would work... since it should 100% like a unit only upgradable
 

hopy

Active Member
Reaction score
64
>< BUMP ><
Sorry for double post, but 24 hours have past since the last reply ...

Please dont kill me D:
 

Nexor

...
Reaction score
74
Q #1:

I think first it "rolls" for the attacking unit: 100% chance miss will everytime miss

Then it "rolls" again for the evasion: if the attacker's hit goes through on the first chance (in this case, it won't) then it calculates the chances for the miss.

so lets say, there is a curse with a 20% chance to miss and the evasion with 30%.
from 100 attacks there will go through only 80 attacks and from the 80 will go through 70% of it, it will be then 56 from 100 attacks aka. 56% chance to hit.
 

hopy

Active Member
Reaction score
64
Alright, thank you.

Although the curse gave a -100% chance to miss (Negative value) ... so it will always hit ...

But if it calculates the curse first and the evasion afther it wont matter cause the evasion will hit either way.

Thank you +rep
 

Tyman2007

Ya Rly >.
Reaction score
74
To answer your second question, if the unit is not a building, yes you have to trigger it.

Make a dummy spell that does nothing.. And make SURE it does nothing.

Trigger it to replace the unit, and add in the tooltip how much it costs.

Inside the tooltip, you can use |n whenever you want the text to continue to another line. You can put |n|n if you want to double space it and get it out of the way of the other information.

It doesn't have to be instant. If you know jass, you can give it a wait time.
But just use unit - replace
and it's made the same way as a trigger enhanced spell.

If you feel you want to delete the unit and create a new one in its place, that works too, but it's a little harder seeing how you have to fix the leak inside of it.
 

hopy

Active Member
Reaction score
64
oh I see, not 100% chance to miss, its minus 100 :D then it will always hit

So ... if it's (minus) -100% chance to hit it will always hit even if the eneme unit has a 30% evasion? or will the curse buff be calculated first still and the curse actualy still doesnt realy matter?


To answer your second question, if the unit is not a building, yes you have to trigger it.

Make a dummy spell that does nothing.. And make SURE it does nothing.

Trigger it to replace the unit, and add in the tooltip how much it costs.

Inside the tooltip, you can use |n whenever you want the text to continue to another line. You can put |n|n if you want to double space it and get it out of the way of the other information.

It doesn't have to be instant. If you know jass, you can give it a wait time.
But just use unit - replace
and it's made the same way as a trigger enhanced spell.

If you feel you want to delete the unit and create a new one in its place, that works too, but it's a little harder seeing how you have to fix the leak inside of it.

No, I am sorry I dont know how to wor with Jass.
I could make it with GUI but I aint sure if I would be able to make the wait timer in GUI without having bug and leak trouble. :p

And without the timer it would be quite hard to balance ... oh well I'll see if I can get it to work. :)
 

Tyman2007

Ya Rly >.
Reaction score
74
You can make it in GUI also, but it's much harder. It's easier using Jass locals because they can never be overwritten, while global variables via GUI can be overwritten.

Overall, Jass is quicker. I can help you out on how, but send me a map with the GUI trigger. Don't bother with arrays.

Just do unit starts the effect of an ability

The condition with the ability

the actions saying wait and unit replace or wait and unit remove then create.
 

Nexor

...
Reaction score
74
I did not test it, but I think the percentage can move between 0 and 100% in this case the curse and the evasion calculations should be seperate from each other.
 

hopy

Active Member
Reaction score
64
Alright, I will do that tomorow... just heared I need to wake up at about 7 tomrow ... so I'd better go sleep now or else I'll have to do alot of stuff with a headache again xD

Thank you all for the help and I'll make that trigger tomorow first thing when I have some time.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top