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 > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 08-31-2009, 09:12 PM   #1
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default UnitMaxState

Zoom (requires log in)
Version 2.1
Introduction
UnitMaxState is written in vJass and requires the NewGen editor, or Jass Helper with PitzerMike's Object Merger configured for it. UnitMaxState requires the latest version of Jass Helper.

UnitMaxState is a library which allows you to modify a unit's maximum life, or maximum mana. To achieve this, the library abuses a bug with the AIlf and AImz abilities, explained by PitzerMike in his ability guide. I do believe it was indeed Blade.dk who initially found this bug. If not, it's still his system I stole and rewrote. Further, let me thank Deaod for writing up his version of this system, which inspired both the reality of this rewrite, and the method abilities are handled within it.

This library provides two functions for modifying a unit's maximum states:
function SetUnitMaxState takes unit target, unitstate state, real targetValue returns nothing
function AddUnitMaxState takes unit target, unitstate state, real additionalValue returns nothing
More information on the API is available in the libraries documentation.
Credits
The UnitMaxState Library
Requirements:
To add UnitMaxState to your map, copy and paste the below library in to a custom-text trigger in your map.

You will want to close your map after the first time you save it with UnitMaxState in it, reopen it, and disable ability (re)generation in the configuration section. If you fail to do that, a small delay will be added every time you save your map.

UnitMaxState Test Map 2.1.0.w3x
Expand UnitMaxState:

Change Log

Change Log

  • 2.1:
    • Switched ability creation to lua
    • Switched to optionally using external preload libraries
  • 2.0:
    • Complete rewrite
  • 1.0:
    • Ancient version


Last edited by Earth-Fury : 11-06-2009 at 03:37 AM.
Earth-Fury is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 08-31-2009, 10:08 PM   #2
Karawasa
Element Tower Defense
 
Karawasa's Avatar
 
Join Date: Feb 2006
Posts: 1,094

Submissions (2)

Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)

Approved Map: Tropical TagApproved Map: Element TD

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

Could you be kind enough to explain the differences between the systems? Why should I use your system over his, and vice versa? I notice the difference in the base, perhaps you could elaborate on that too.

I also think that you should give more credit to Deaod. Let's face it, your system didn't handle the abilities the way it does now. It used one giant dummy ability, and it's only this new version that has this change (in response to Deaod doing it). Please correct me if I am wrong...
__________________

Element Tower Defense - Premier WC3 Custom Game

Last edited by Karawasa : 08-31-2009 at 10:09 PM.
Karawasa is offline   Reply With Quote
Old 08-31-2009, 11:10 PM   #3
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

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

EF's system not being submitted here was the reason Deaod submitted his. I have a funny feeling that Deaod would not feel hurt at all if his was graveyarded in light of this being submitted.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-01-2009, 01:00 AM   #4
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default

Quote:
Originally Posted by Rising_Dusk
EF's system not being submitted here was the reason Deaod submitted his. I have a funny feeling that Deaod would not feel hurt at all if his was graveyarded in light of this being submitted.
I certainly hope I've created no animosity with this submission. I simply got thinking about better ways to do it, and ended up with a full implementation.

Quote:
Originally Posted by Karawasa
I also think that you should give more credit to Deaod. Let's face it, your system didn't handle the abilities the way it does now. It used one giant dummy ability, and it's only this new version that has this change (in response to Deaod doing it). Please correct me if I am wrong...
I did try to give Deaod a good measure of credit. You'll note that his name is the 3rd mentioned, and is mentioned separately from the list of much more indirect contributors. If he himself feels he deserves more credit than is currently given to him in this post and library, I will be more than happy to oblige. :) Though, I will add a mention for him in the first post of this thread right now, as opposed to just in the documentation for the library.

For the record, you are not wrong.

Quote:
Originally Posted by Karawasa
Could you be kind enough to explain the differences between the systems? Why should I use your system over his, and vice versa? I notice the difference in the base, perhaps you could elaborate on that too.
They are functionally identical, except in a few border-cases. (Eg: Handling unitstates other than max ones.) I would imagine most of those border cases are irrelevant to 99.9% of users.

As for which is superior... I've not examined the matter closely enough. I'll get on to doing a benchmark and such in a while. (Mayhaps later today)

Further comments welcome! :)
__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils

Earth-Fury is offline   Reply With Quote
Old 09-01-2009, 03:06 AM   #5
Karawasa
Element Tower Defense
 
Karawasa's Avatar
 
Join Date: Feb 2006
Posts: 1,094

Submissions (2)

Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)

Approved Map: Tropical TagApproved Map: Element TD

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

Quote:
Originally Posted by Earth-Fury
Though, I will add a mention for him in the first post of this thread right now, as opposed to just in the documentation for the library.

I'm a nitpick for these type of things, so thank you for doing it.

Quote:
Originally Posted by Earth-Fury
I certainly hope I've created no animosity with this submission. I simply got thinking about better ways to do it, and ended up with a full implementation.

I can't speak for Deaod, but my experiences with the guy tell me there is probably no animosity at all. As a mapper, I like the competition :). I hope nothing gets graveyarded until we get benchmarks though.

Quote:
Originally Posted by Earth-Fury
As for which is superior... I've not examined the matter closely enough. I'll get on to doing a benchmark and such in a while. (Mayhaps later today)

That would be very much welcomed. I've been wondering about this ever since he posted his version (I was using your old version previous to that).
__________________

Element Tower Defense - Premier WC3 Custom Game

Last edited by Karawasa : 09-01-2009 at 03:09 AM.
Karawasa is offline   Reply With Quote
Old 09-01-2009, 02:47 PM   #6
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

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

Is there any particular reason you went against all indentation standards and made the globals and englobals keywords at the beginning of your script right-justified?
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-01-2009, 03:21 PM   #7
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default

Quote:
Originally Posted by Rising_Dusk
Is there any particular reason you went against all indentation standards and made the globals and englobals keywords at the beginning of your script right-justified?

Yes. It fit the layout of the configuration block better. (In my opinion, of course.)
__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils

Earth-Fury is offline   Reply With Quote
Old 09-01-2009, 07:35 PM   #8
Karawasa
Element Tower Defense
 
Karawasa's Avatar
 
Join Date: Feb 2006
Posts: 1,094

Submissions (2)

Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)

Approved Map: Tropical TagApproved Map: Element TD

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

Quote:
Originally Posted by Earth-Fury
Yes. It fit the layout of the configuration block better. (In my opinion, of course.)

Meh, I'd prefer to see it follow convention but I'm just one guy. Your constants also aren't indented correctly.
__________________

Element Tower Defense - Premier WC3 Custom Game

Last edited by Karawasa : 09-01-2009 at 07:36 PM.
Karawasa is offline   Reply With Quote
Old 09-01-2009, 07:48 PM   #9
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

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

Other than weird indentation in spots, I don't see anything wrong with the code. I will wait until Ani has a look at it, though, and if after that no problems are spotted then this will be approved.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-01-2009, 10:30 PM   #10
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default

Quote:
Originally Posted by Rising_Dusk
Other than weird indentation in spots, I don't see anything wrong with the code. I will wait until Ani has a look at it, though, and if after that no problems are spotted then this will be approved.
I'd like to hold off on approval/rejection until benchmarks are done. Of course, I can't seem to find working stopwatch natives anywhere... If anyone has a combination of stopwatch natives + war3.exe that work together, send em my way.

(If I can't get stopwatch for benchmarks in a few days, and if no one else does benchmarks, then I guess my request to hold off becomes a bit of a moot point...)
__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils

Earth-Fury is offline   Reply With Quote
Old 09-02-2009, 10:41 AM   #11
Karawasa
Element Tower Defense
 
Karawasa's Avatar
 
Join Date: Feb 2006
Posts: 1,094

Submissions (2)

Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)

Approved Map: Tropical TagApproved Map: Element TD

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

Quote:
Originally Posted by Rising_Dusk
Other than weird indentation in spots, I don't see anything wrong with the code. I will wait until Ani has a look at it, though, and if after that no problems are spotted then this will be approved.

Since we have two submissions that accomplish the same thing but via different methods, don't you think it's a bit unwise to rush into approval?

Quote:
Originally Posted by Earth-Fury
I'd like to hold off on approval/rejection until benchmarks are done. Of course, I can't seem to find working stopwatch natives anywhere... If anyone has a combination of stopwatch natives + war3.exe that work together, send em my way.

Thank you for being reasonable. I hope you find what you're looking for soon.
__________________

Element Tower Defense - Premier WC3 Custom Game
Karawasa is offline   Reply With Quote
Old 09-02-2009, 02:17 PM   #12
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

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

These are the best that we have at current, and I've no clue if they still apply to the most recent 1.24b patch.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-04-2009, 07:12 PM   #13
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

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

I tested this library and like it very much. I have only a few concerns.
  • Your preload libraries suck. What you should do is in the main library's initializer, create a dummy footman and add the abilities, then remove the footman. This would eliminate the whole overwhelming-ness of having the preload libraries.
  • call InitializeAbilitiesArray() is useless. Simply do everything in the Initializer and comment it to tell users what is going on.
  • You shouldn't make your error messages configurable. If a user screws up, you as the library author know where he screwed up, so you will tell him how he screwed up. If he plays with that configuration error function and is some terribad noob, he may confuse himself. It is our job as library authors to protect users from themselves.

    I say inline your ErrorMsg function and remove it from configuration entirely.
If you fix these things, this will be ready for approval.
__________________

Last edited by Rising_Dusk : 09-04-2009 at 08:06 PM.
Rising_Dusk is offline   Reply With Quote
Old 09-05-2009, 08:37 AM   #14
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default

Quote:
Originally Posted by Rising_Dusk
  • Your preload libraries suck. What you should do is in the main library's initializer, create a dummy footman and add the abilities, then remove the footman. This would eliminate the whole overwhelming-ness of having the preload libraries.
Is it so overwhelming to add a second library to a map if you want preloading, with the option to use the xe library in the event you aren't a crazy ass NIHilist?

I'm perfectly willing to concede this point if you are not willing to concede it. It's a rather trivial matter.

Quote:
Originally Posted by Rising_Dusk
  • call InitializeAbilitiesArray() is useless. Simply do everything in the Initializer and comment it to tell users what is going on.

Yes. A relic from the way I initially wrote the system. (A whole lot of variable initialization...)

Quote:
Originally Posted by Rising_Dusk
  • You shouldn't make your error messages configurable. If a user screws up, you as the library author know where he screwed up, so you will tell him how he screwed up. If he plays with that configuration error function and is some terribad noob, he may confuse himself. It is our job as library authors to protect users from themselves.

    I say inline your ErrorMsg function and remove it from configuration entirely.

You've spent time in the acrid halls of the eternally vile Hive Workshop. You have seen the horrors stupidity can do to a man. One minute he's just sitting there, drinking an energy drink, coding a spell. Then, the idiocy comes. His guts laid bare. Flesh sundered from bone and soul to rot in the stench of the perverted den know as "The world editor help zone".

You can fight it as hard as your body will allow. Rend your arms through the almost solid wall of stupidity. Fight with every ounce of strength, until your body lies bruised and beaten; broken and defeated on the shores of some distant land of horror. Barely beyond the wet of the ocean before the idiocy has won.

We can't win against it. No one can. We can, however, lose. We lose by removing useful functionality which can only be abused by true stupidity. We lose by diminishing the works of the great, for the sake of those too tiny to even grasp the magnitude of the creation, let alone use it in the fabrication of the awe-inspiring. We lose by destroying ourselves for fear that we are of no use to those that would doom us to a fate no better than the eternal fires of hell!

TL;DR: It is out job to protect users from crazy unexpected border cases, by preventing undefined behaviour in every way possible. It is not our job to protect users from utter stupidity.
__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils

Earth-Fury is offline   Reply With Quote
Old 09-05-2009, 10:48 AM   #15
Karawasa
Element Tower Defense
 
Karawasa's Avatar
 
Join Date: Feb 2006
Posts: 1,094

Submissions (2)

Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)

Approved Map: Tropical TagApproved Map: Element TD

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

Quote:
Originally Posted by Earth-Fury
You've spent time in the acrid halls of the eternally vile Hive Workshop. You have seen the horrors stupidity can do to a man. One minute he's just sitting there, drinking an energy drink, coding a spell. Then, the idiocy comes. His guts laid bare. Flesh sundered from bone and soul to rot in the stench of the perverted den know as "The world editor help zone".

Best description of THW I've seen.

Any luck with benchmarking? I only persist because I am dealing with insanely high health bonuses so...
__________________

Element Tower Defense - Premier WC3 Custom Game

Last edited by Karawasa : 09-05-2009 at 10:50 AM.
Karawasa 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 08:42 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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