HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Attribute System v4

03-28-2007, 03:52 AM#1
emjlr3
Version History:
  • v5 - No longer requires CSSafety, requires LastOrder library, fixed bug where units would lose orders when they leveled if they did not previously have stat points, added in further user functionality, update usage syntax, optimized a bit, is once again fully MUI!!!!
  • v4 - No longer uses gamecache or requires CSCache, fixed a bug where stat points would not update if the learn inventory was open, minor readme updates, minor optimizations, now only works for 1 unit/player, reports an error if the user tries to enable it for more then 1
  • v3 - Fixed some minor grammatical errors in my documentation, as well as added better vJASS syntax to the library
  • v2 - Fixed problem with morphing heroes, and a bug where the system would start for units you did not enable it on
  • v1 - First release


A simple attribute system which enables players the chance to manually choose what attributes to increase when their hero levels up.

Why use this as opposed to other attribute systems?
Well as far as I know there is only one, Weaaddars. I used the same concept he did, however I wrote all these triggers from scratch.
In comparison, this is more optimized, has no leaks(that I am aware of), is far easier to import(far as in a couple hundred miles), and has a far better read me(far as in in few thousand parsecs).

In anycase, download, try it out, you may find it useful, and please comment.

Credits to Dusk for his LastOrder library.

Expand system code:

read me

This is an attribute system, which enables users to allow players the chance to choose which attributes grow after their heroes level.
This system was written from scratch by me, however, I used a similar method to that of Weaaddar, so credits are due.

How to get it to work:
You must first have the LastOrder library set up correctly in your map. This system can be found at wc3c.net in the resource section, or in this map.
Next, copy all the custom items (there are 6) and custom abilities (there are 2) from this map to yours. Make sure that the cancel, agility, strength,
and intelligence items have the Inventory(Attribute System) ability.
Next, copy the Attribute System trigger to your map, and update the rawcodes near the top of the trigger, which are found in the
configuration section.
If it saves, everything should be working, and the system should be setup correctly.
If not, start from scratch and try again.
If it still does not work, make sure you are using a Preprocessor, such as that found in the JASS New Gen Pack at WC3C, and try again :).

How to use it:
Simply call the function:
function AttributeSystem_Register takes unit u, integer i returns boolean
Where u is the unit you want to setup the system for, and i is the number of attribute points to add each level.

Other Options:
functiion AttributeSystem_UnRegister takes unit u returns boolean
Where u is the unit you want to unregister the system for.
function AttributeSystem_SetCurrentPoints takes unit u, integer i returns nothing
Where u is the unit you want changed, and i is the number of stat points you want it to have.
function AttributeSystem_UpdatePointsGain takes unit u, integer i returns nothing
Where u is the unit you want to update, and i is the number of stat points you want it to gain per level.

Known problems:
This system removes all items while learning stat points, so all bonuses will be removed from the hero.
Having other abilities based off replenish will bug the system.



-emjlr3
Attached Images
File type: jpgAS_Pic.JPG (138.6 KB)
Attached Files
File type: w3xAttribute System v5 - emjlr3.w3x (81.6 KB)
03-28-2007, 03:56 AM#2
Vexorian
hmmm you won't get friendly replies for saying your stuff is more optimized than weaaddar's ...

But on a more serious note, I don't see much application on this system unless it actually keeps the item's bonuses, will take a look at it, if it doesn't then it will have to go to samples...
03-28-2007, 04:02 AM#3
emjlr3
take a look at this, then take a look at his system, with the zillion of fluff functions everywhere, and you will see what I mean, however on top of that, i still think this is more optimized, even taking that out of the picture

it does not keep bonuses, impossible with this method IMO, however mentioning that would have been a good idea

systems or samples, who cares, if someone gets use out of it then that is good
03-28-2007, 11:35 AM#4
DurotarLord
Ah, i see what you mean when you say "less clunky". Yours is based on an item style system. nice, although, i still prefer mine for the context its supposed to be used in.
03-29-2007, 02:17 PM#6
blu_da_noob
  • Removes all items (and therefore item bonuses) while adding stat points
  • Must note that preprocessors are required and specify which ones (and preferably where you can get them)

Quote:
Known problems:
This system will bug if used on heroes with abilities such as metamorphisis or chemical rage, if the ability is used while the hero has
attribute points to spend, or if the attribute system inventory is open.

Would this have anything to do with the stat-choosing ability being removed from the unit when morphing? If so, make the ability permanent.
03-29-2007, 03:04 PM#7
Vexorian
Yes, blu. Because of the removal of bonuses this is suitable for samples. So just fix the bug with permanent abilities and the preprocessor stuff then it should go.
03-29-2007, 06:23 PM#8
emjlr3
new version uploaded

fixed the problem of ability permanency, as well as a bug where it would add the ability to the hero even if the system was not setup for that hero, even though you could not learn any abilities

added documentation about items being removed, thus having bonus loss, as well as the need for Preprocessors (however I feel this is unnecessary, since CSCache and CSSafety both require a preprocessor, and your map needs those for this system to work at all)

**btw can someone change the thread title to v2 from v1, thnx
03-29-2007, 06:54 PM#9
moyack
I'll check your system this night.

Title modified.
04-01-2007, 09:36 PM#10
blu_da_noob
Sampilified.
04-17-2007, 01:24 AM#11
dust77
can i ask
how to change attribute gain from 5 per lvl to 2 per lvl
04-23-2007, 01:35 AM#12
emjlr3
did you read the readme?
12-14-2007, 03:49 PM#13
LLoKKo
pass level stop spell casting, just a note ^^
04-15-2008, 11:19 PM#14
marven15
Hi after a long long time... this is my first post :P

Anyway...

I am currently using your Attribute System. I like it alot and somehow I know how to use it. My only problem is when calling the function AS_Enable. As I have read the "read me", you said there that you must call AS_Enable once because it might cause problems when it is called more than once. But it cannot be done in Initialization because the heroes that will use the system are not preplaced or created instantly upon Initialization(I'm using your system in an AoS map btw). The selection system that I'm using is Vexorian's Hero Selection System. To make the system work, the function is called after the hero is created. This works fine if the game is played by only one player. My only concern is that everytime a hero is created, the function is called. I haven't played the game with my friends so I can't tell if it will work fine or will cause problems. So what can I use as an alternative on calling the function once, whereby upon calling it, all heroes that will be created will be able to use the system?

More Info:
This is one of the triggers of Vexorian's Hero Selection System. This is the part where the AS_Enable is called:

Trigger:
Hero is Created
Events
Conditions
Collapse Actions
Set HEROES[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
Custom script: call AS_Enable(udg_HEROES[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))],5)
04-16-2008, 12:54 PM#15
emjlr3
I really need to upload my vJASS version of this.....

enabling this once for all heroes is fine, its sort of the purpose...