• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Items for Faux Heroes

Status
Not open for further replies.
Level 5
Joined
May 20, 2013
Messages
162
A kick i've been on lately ...well i take that back -it's a kick i've been on ever since WC2 is Faux Heroes. What i mean by that, is just regular units that are dressed up as heroes. Why exactly... i have no idea. In WC3 i tended to just like a lot of the regular units better than the hero units. Maybe it is because they die & decay, & don't revive at an altar! ;) I don't know.

Anyway. Lately i've been on this thing of making real plain heroes who can summon a much more interesting unit sidekick that advances in power as the hero does.

But i would like to take this further. Units with a hero inventory can already do many of the same things that real heroes can. One frustration though is their incompatibility with items that increase hero stats, since regular units lack these. But... they DO have the other regular stats that the hero stats build in turn.

Namely

STR = health, health regen, & also damage for tank heroes

INT = Mana, mana regen, & damage for mage heroes.

AGI = Armor, attack spd, movement spd, & damage for assassin heroes.

So, what do i want to do?


I would like to do a trigger "system" that converts items with hero attributes into the secondary bonus.

For example, it would be very easy to do an item specific trigger that gives a Faux Hero a +150 health & +6 damage for the Belt of Giant Strength in his inventory. Even i can do that.

But would it be feasible to make a trigger set that would do this for any random item or power-up that your Faux Hero happened to interact with? One that would automatically know what to convert STR, INT, AGI, & Experience buffs into when interacted on by a non-hero unit?

& speaking of Experience: i was thinking that the Experience Bonus power-ups would instead provide a mana/health replenishment, & perhaps a temporary beneficial buff or aura when popped by a Faux Hero unit. Perhaps make it Random, for a little fun. Its all on the table.


Again, not sure why i ever got started down this path but does this sound interesting at all to any one else? :)
 
Last edited:
Level 9
Joined
Apr 23, 2011
Messages
527
Pretty complicated.

You would have to index each hero, its sidekick and the hero's attributes. Create custom abilities that give each stat (1 ability for health, 1 for damage, etc.). If hero attribute = x, set level of each ability to x. Or you could use BonusMod library for the stats, but it is finicky to use (edit: or this one, I looked around the Spells section, there might be more).
 
Last edited:
Level 12
Joined
Mar 24, 2011
Messages
1,082
Tbh, it is not that complicated, rather than annoying and time consuming to make.
You have to register all items and the bonuses they provide.
Then when a unit acquires/loses item you check what is in it's inventory and adjust bonuses for the unit.

Btw, @Light says 1 ability for each, but rather do a binary bonuses because you'd end up having 1000+ lvl abilities and you will have to adjust the value for EVERY SINGLE LEVEL.

What I mean by binary bonus? You have 10 abilities:
1st one gives 1atk,
2nd one gives 2atk,
3rd gives 4atk,
4th gives 8atk,
5th gives 16atk,
6th gives 32atk
7th gives 64atk
8th gives 128atk
9th gives 256atk
10th gives 512atk

Combining those, you can achieve a bit above 1000 bonus. Add 11th, you get around 2k, with 12th you have 4k.
Then you check the bonus from items and then loop backwards. This is the idea:
Code:
Loop N from 10 to 1
  If bonus > bonus of Ability N
    Add Ability N to unit
    bonus = bonus - bonus of Ability N

If binary confuses you, you could do Decimal.
You would have 10 abilities with 10 levels.
1st - has bonuses 0 to 9 = 0, 1, 2 ,3 ,4 ,5, 6, 7, 8, 9
2nd has bonuses 0, 10, 20, 30, 40, 50, 60, 70, 80, 90
3rd has bonuses 0, 100, 200, 300, 400, 500, 600, 700, 800, 900
4th has bonuses 0, 1000, 2000, 4000, 5000, 6000 ,7000, 8000, 9000

You would again check the bonus from items and then loop backwards to add the appropriate levels.
This should be a bit more handy and obvious to use if you are not used to binary.

Hope this helps

regards
-Ned
 
Level 3
Joined
May 12, 2015
Messages
32
You can use a little trick for STR/AGI/INT items to avoid registering every single item bonuses :
Whenever a sidekick hero unit aquires an item, you give that item to a dummy hero (actual hero that is invisible) and calculate the difference in stats and it equals the stats given by the item, then you give the item back to the sidekick hero unit and give the needed bonuses (binary way recommended) based on the amount of stats.

I think units with hero inventory work well with runes? However, the problem is gonna be with stats/EXP tomes. You can try making these tomes give 0 stats and give actual tomes if aquiring unit is hero, else give the needed bonuses based on amount of stats.
 
Level 5
Joined
May 20, 2013
Messages
162
@david200923 yes! Simplifying it yet further! This sounds easy to do without a bunch of editor rework. But this is still a trigger that would be challenging for me to make because i am going to guess that it involves either a "For each integer A" function, or a Hashtable -both of which i always screw up (though i really would like to learn better). So i am guessing that this dummy hero you suggested, Before & then again after recieving the item, you are going to want to count

Life (each STR is 25 life)
Life Regen (each STR is .05 regen)
Mana (each INT is 15 mana)
Mana Regen (Each INT is .05 Regen)
Armor (Each AGI is .30 Armor)
Attack spd (Each AGI is .02 Attack spd)
Move spd (Hero move speed is tied to Agility in the Constants, but the factor is set at zero by default).
Damage (to make this accurate the Faux Hero & Dummy Hero need same designation as Assassin, Mage, or Tank).

Subtract Coumt 1 from Count 2 then assign the difference to the Faux Hero.

Am i understanding you correctly? This sounds very doable.

Very exciting!

As for Stat/Exp tomes. In the past, my faux hero could tap any power up just fine -as in he spent them & nothing happened if he didn't possess the applicable stat. Last night, after i started importing all these new "systems" into my map, when my Faux Hero touched the wrong powerup, the game crashed. BUT... i agree, we have alternative options to work with.

Very cool, man!
 
Last edited:
Level 3
Joined
May 12, 2015
Messages
32
  • Faux Hero Stat Gain
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) is in FauxHeroes_Group) Equal to True
      • (Item-class of (Item being manipulated)) Not equal to Powerup
    • Actions
      • -------- We turn off both triggers then turn it on to avoid infinite loop crash --------
      • Trigger - Turn off (This trigger)
      • Trigger - Turn off Faux Hero Stat Lose <gen>
      • Hero - Give (Item being manipulated) to Faux_DummyHero
      • -------- The Dummy Hero has 1 base stats so the -1 is needed --------
      • Set Faux_ItemStrength = ((Strength of Faux_DummyHero (Include bonuses)) - 1)
      • Set Faux_ItemAgility = ((Agility of Faux_DummyHero (Include bonuses)) - 1)
      • Set Faux_ItemIntelligence = ((Intelligence of Faux_DummyHero (Include bonuses)) - 1)
      • Hero - Give (Item being manipulated) to (Triggering unit)
      • Trigger - Turn on (This trigger)
      • Trigger - Turn on Faux Hero Stat Lose <gen>
      • -------- Modify bonuses based on numbers of Stats here --------
      • -------- --------------------- --------
      • -------- --------------------- --------
      • -------- --------------------- --------
This is the trigger in case you are confused. Also you should have all Faux Heroes in the global group FauxHeroes_Group.

  • Faux Hero Stat Lose
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • ((Triggering unit) is in FauxHeroes_Group) Equal to True
      • (Item-class of (Item being manipulated)) Not equal to Powerup
    • Actions
      • -------- We turn off both triggers then turn it on to avoid infinite loop crash --------
      • Trigger - Turn off (This trigger)
      • Trigger - Turn off Faux Hero Stat Lose <gen>
      • Set Faux_ItemPosition = (Position of (Item being manipulated))
      • Hero - Give (Item being manipulated) to Faux_DummyHero
      • -------- The Dummy Hero has 1 base stats so the -1 is needed --------
      • Set Faux_ItemStrength = ((Strength of Faux_DummyHero (Include bonuses)) - 1)
      • Set Faux_ItemAgility = ((Agility of Faux_DummyHero (Include bonuses)) - 1)
      • Set Faux_ItemIntelligence = ((Intelligence of Faux_DummyHero (Include bonuses)) - 1)
      • Item - Move (Item being manipulated) to Faux_ItemPosition
      • Trigger - Turn on (This trigger)
      • Trigger - Turn on Faux Hero Stat Lose <gen>
      • -------- Modify bonuses based on numbers of Stats lost here --------
      • -------- --------------------- --------
      • -------- --------------------- --------
      • -------- --------------------- --------
This Trigger is also needed to decrease bonuses the Faux Hero had when he had the item when he loses it.


The things which are left to do is applying the bonuses and everything about EXP/Stats tomes.

For tomes, it seems that even tomes with 0 stats given still crash the game if picked by a non-hero unit, so what you can do is use other power up items(ex. manual of health) and have them all have the same ability that gives 0 hp and when a Faux Hero picks it up you give the needed bonuses based on the stats that should be given to the unit (you have to register all tomes though), there is a little neat trick which would be useful only if you have a large amount of tomes and it is naming all Stats tomes to "n Tome of Strength/Agility/Strength", where n is number of stats given and you check for which stat is given.

For actually applying the bonuses, the above methods by @Light and @nedio95 work pretty well.

I am up to making you the full system but don't expect me to finish it soon enough, but i think you should be able to make it as it is not really complicated.

EDIT: just wanted to point out that you probably need a unit indexer (otherwise knowledge in using hashtables or dynamic indexing) to have multiple Faux Heroes.
 
Last edited:
Level 5
Joined
May 20, 2013
Messages
162
@david200923

This is a fair proposition. I am at the limit i think of what i can learn just dinking around. I need to try new stuff to become more able with the editor. And i am obsessive compulsive enough to do the gopher work. That is not a problem. Over a course of time i will post what i am coming up with on this. But this is not my only project, so it will not have undivided attention. If i am absent for days or a few weeks, i'm just working on something else.

But the odds are good i am going to tackle this one early! ;)

FAUX HEROES FOREVER!!!
 
Last edited:
Status
Not open for further replies.
Top