giving scopes to units

TheLegend

New Member
Reaction score
10
I'm trying to make a new status system using vjass and i bumped into some serious problems. i made structures (databases) containing the info of a unit (skill,strength,constitution,charisma,inteligence and agility) but I find it hard to attach the database to the units on the map. EVERY unit should have its own database (thats easy to make) but its hard to call that database for another unit (eg. the attacked)
Its like this: when you attack the unit it compares the two databases and does the following skill/10 = critical strike chance, agility/10 - chance to avoid critical strike, (skill of attacker)/(agility of defender + skill of defender) = hit chance and so on... How can I call the unit's database (its created as soon as the unit enters the map and its values are changable)
 

keychup

Active Member
Reaction score
34
Idea1:
Hmmm, try passive abilities with no icons like item abilities (Blades of Attack, Gloves of Haste and Boots of Speed should be fine) or use that hero ability: Attribute Bonus and hide the icon. You could take 6 of those abilities and add them to those units. Name each item ability: skill, strength, constitution, charisma, intelligence and agility; respectively. When the unit enters, set the level of each of the unit's structures to what it's supposed to be
Then if you ever need to refer to those structures, refer to the ability and the level of that ability.

Drawback: If your structures reach a massive amount (like 100 skill for example) you're gonna have to make sure that the abilities are at least 100 levels.

Idea2: (This one just popped into my head while i was contemplating the drawbacks of idea1)
Give the unit a unit inventory. The inventory has 6 slots maximum so you can give 6 items to that unit when it enters the game: named skill, strength, constitution, charisma, intelligence and agility respectively. Set the charges for each item to what their values are supposed to be. Then refer to the item and how many charges it has. This method also gives you a visual on their structure.

Drawback: The unit won't be able to use items.

Idea3:
There's always the possibility of hashtables
 

TheLegend

New Member
Reaction score
10
i could use that :) but it wouldn't be what I imagined it to be. When i say vJass system i mean a library that operates alone, you just copy it to your map and it works - you don't need buffs or spells just either to ad the unit using a call public function or automatic adding at map init. or when a unit enters the map. i'm looking for a way to array the databases to units but to be able to pick up the database for one specific unit... something like data u is the unit's code... id
 
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