wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Samples
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 03-28-2007, 03:52 AM   #1
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default Attribute System v4

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: jpg AS_Pic.JPG (138.6 KB, 2262 views)
Attached Files
File Type: w3x Attribute System v5 - emjlr3.w3x (81.6 KB, 276 views)
__________________

Last edited by emjlr3 : 02-27-2009 at 01:12 AM.
emjlr3 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 03-28-2007, 03:56 AM   #2
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

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...
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 03-28-2007, 04:02 AM   #3
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

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
__________________

Last edited by emjlr3 : 03-28-2007 at 04:04 AM.
emjlr3 is offline   Reply With Quote
Old 03-28-2007, 11:35 AM   #4
DurotarLord
User
 
DurotarLord's Avatar
 
Join Date: Feb 2006
Posts: 128

Submissions (2)

DurotarLord has little to show at this moment (6)

Default

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.
__________________
An open mind is like an open fortress; its wall unbarred and unguarded.
DurotarLord is offline   Reply With Quote
Old 03-29-2007, 02:17 PM   #6
blu_da_noob
Nonchalant
 
blu_da_noob's Avatar


Respected User
 
Join Date: Mar 2006
Posts: 1,933

Submissions (2)

blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)

[Quicksilver #2] - 2nd Place[Quicksilver#1] 1st place

Send a message via MSN to blu_da_noob
Default

  • 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.
blu_da_noob is offline   Reply With Quote
Old 03-29-2007, 03:04 PM   #7
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

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.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 03-29-2007, 06:23 PM   #8
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

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
__________________

Last edited by emjlr3 : 03-29-2007 at 06:33 PM.
emjlr3 is offline   Reply With Quote
Old 03-29-2007, 06:54 PM   #9
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

I'll check your system this night.

Title modified.
moyack is offline   Reply With Quote
Old 04-01-2007, 09:36 PM   #10
blu_da_noob
Nonchalant
 
blu_da_noob's Avatar


Respected User
 
Join Date: Mar 2006
Posts: 1,933

Submissions (2)

blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)

[Quicksilver #2] - 2nd Place[Quicksilver#1] 1st place

Send a message via MSN to blu_da_noob
Default

Sampilified.
__________________
blu_da_noob is offline   Reply With Quote
Old 04-17-2007, 01:24 AM   #11
dust77
User
 
Join Date: Apr 2007
Posts: 1

dust77 has little to show at this moment (0)

Default

can i ask
how to change attribute gain from 5 per lvl to 2 per lvl
dust77 is offline   Reply With Quote
Old 04-23-2007, 01:35 AM   #12
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

did you read the readme?
__________________
emjlr3 is offline   Reply With Quote
Old 12-14-2007, 03:49 PM   #13
LLoKKo
User
 
Join Date: Oct 2007
Posts: 4

LLoKKo has little to show at this moment (0)

Default

pass level stop spell casting, just a note ^^
LLoKKo is offline   Reply With Quote
Old 04-15-2008, 11:19 PM   #14
marven15
User
 
marven15's Avatar
 
Join Date: Oct 2007
Posts: 36

marven15 has little to show at this moment (4)

Send a message via Yahoo to marven15
Question

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)
marven15 is offline   Reply With Quote
Old 04-16-2008, 12:54 PM   #15
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

I really need to upload my vJASS version of this.....

enabling this once for all heroes is fine, its sort of the purpose...
__________________
emjlr3 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 02:09 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2020, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services