SC2Mapster Forums

Resources > Trigger Libraries & Scripts

[Library] Add Experience To Unit

  • 16 posts
    #1 Jul 22, 2010 at 06:27 UTC - 0 likes

    Hello everyone.

    I wrote a library that allows via action to give an any number of experience points to unit (from 1 to 99999). You can increase this number to how many you want, you only work a little over the library(or say me if it's need).

    How to use:

    1. You need to import the library in your map. Open Trigger Editor(press F6), then press view->show libraries. Right click on library field->library->import library->choose my library Add Experience To Unit
    2. You need to copy from my map five effects (Add Exp 1 point, Add Exp 10 points, Add Exp 100 points, Add Exp 1000 points, Add Exp 10000 points). Select them all, click ctrl + c, open your map and click + v.

    Then you can call action Add Experience To Unit(Experience Points, Unit) which will give to Unit Experience Points. In addition, in map, I realized the command -give experience points, when experience points - number of experience points which you want to give your unit. I think all this will be useful for people who are developing maps with the heroes.

    Last edited Jul 22, 2010 by KorvinGump
    Name Description Size MD5
    Add_Experience_To_Unit.SC2Lib Add Experience To Unit(Library) 91.1 KiB ee3bea45422f...
    Add_Experience_To_Unit.SC2Map Add Experience To Unit(Map) 39.3 KiB eac0d7c48866...

    Galaxy Vampirism

    #2 Jul 23, 2010 at 16:39 UTC - 0 likes

    How does it work behind the scenes?

    #3 Jul 24, 2010 at 03:32 UTC - 0 likes

    @vjeux: Go

    Add Experience To Unit

    Or you mean something else?

    Last edited Jul 24, 2010 by KorvinGump
    #4 Jul 24, 2010 at 04:58 UTC - 0 likes

    This is great Korvin! All the other methods of doing what should be a simple task were so clunky.

    Sc2Mapster Data Assets for your map
    (Abilities, units, weapons, you name it!)

    #5 Jul 24, 2010 at 21:56 UTC - 0 likes

    @vjeux: Go

    I've had to do this in my RPG for loading a hero and getting his exp back to the right number... I would guess he applies the 1000 XP effect in a loop until 100 XP needed until 10 XP until down to the last XP. It's the best we can do atm :/

    SC2 video tutorials: http://www.youtube.com/onetwosc

    #6 Jul 25, 2010 at 02:56 UTC - 0 likes

    So people didn't know how to do this? It's simple catalog function using a dummy effect. O_O

    http://www.sc2mapster.com/maps/aos-template/files/ ^Mine was made May This wasn't uncommon either

    #7 Jul 25, 2010 at 03:54 UTC - 0 likes

    @zifoon: Go

    I just found in your map solution through set catalog value. I'm shocked. Give Experience

    I do not understand how you knew all this so early. And in your map used such functions and chips, which I began to understand for example only after several months of studying the editor. You did this map http://www.sc2mapster.com/maps/aos-hero-revive-example/ after several days of release of the editor. I do not understand, or you're a genius, or?? oO

    You have worked in Warcraft 3 World Editor? Why do you always write that it's easy? And why do you have a map of everywhere [zifoon]? :D . You love yourself so much?

    #8 Jul 25, 2010 at 05:49 UTC - 0 likes
    Quote from KorvinGump: Go

    @zifoon: Go

    I just found in your map solution through set catalog value. I'm shocked.

    I do not understand how you knew all this so early. And in your map used such functions and chips, which I began to understand for example only after several months of studying the editor. You did this map http://www.sc2mapster.com/maps/aos-hero-revive-example/ after several days of release of the editor. I do not understand, or you're a genius, or?? oO

    You have worked in Warcraft 3 World Editor? Why do you always write that it's easy? And why do you have a map of everywhere [zifoon]? :D . You love yourself so much?

    Na I was using xml before editor was release. So I was using [zifoon] as identifier so I can search quicker through xml editor. It was few days after release of the editor but I played around with xml and native functions a lot so I pretty much knew every function. In addition to that, I do have a casual job designing interface for softwares and that helps too. Though very casual since I still have to finish university.
    Not a genius just knew stuff before other people did.
    Yeah, I used world editor for couple of years but I wasn't really fan of making maps. I just like challenging the limitation of world editor but that was it. Also I don't love myself per say but healthy dose of narcissism never hurt anybody ^.^

    Last edited Jul 25, 2010 by zifoon
    #9 Jul 25, 2010 at 06:14 UTC - 0 likes

    @zifoon: Go

    Interesting solution.

    #11 Jul 26, 2010 at 14:00 UTC - 0 likes

    @zifoon: Go

    Guess you got an admirer :)

    Anyway, good solution. SetCatalog will help us circumvent these binary additions most of the time.

    #12 Aug 09, 2010 at 13:58 UTC - 0 likes

    Thanks all! Been looking all over the place for something like this.

    #13 Aug 10, 2010 at 07:50 UTC - 0 likes

    @KorvinGump: Go

    Very nice library. Didn't realize how useful something like this would be until I saw this thread! :D

    #14 Aug 19, 2010 at 00:46 UTC - 0 likes

    I was quite interested in your function, so I took it apart and rewrote it. It's still using base 10 multiples (so no new effects needed), it just uses arrays and loops to spit out the right experience. There are also 2 versions,1 that takes reals and 1 that takes ints (since it not showing up sucks). So a new Add_Experience_to_Unit.SCLib is attached. Also, I wrote a small javascript script that will spit out the xml for setting up level requirements. You can specify a function and it will spit out a bunch of veterancyLevelArray tags with the appropriate values. Because editing 40 levels worth of experience requirements sucks.

    Edit: I re read the post about using set catalog, and nevermind, thats so much easier. Check out the vererancy levels generator though.

    Last edited Aug 19, 2010 by cbaker118
    Name Size MD5
    Level_script.js 1.6 KiB 0321d5ef4ebc...
    Add_Experience_To_Unit.SC2Lib 47.7 KiB 31adf70ed58d...
    #15 Aug 29, 2010 at 09:06 UTC - 0 likes

    i have a question. currently in my ORPG map every time a hero dies, there is a brief lag spike, before they are instantly revived. Im not sure what the problem is, but i asssume it's becuase of the trigger i have that returns the heroes EXP to him. i have a behavior that applies a EXP effect that gives 1 exp point, and i stack the buff x number of times to equal the heroes EXP before he died. once the hero reaches a level higher than 10 the lag increases exponentially when they die and respawn, taking up to 5 seconds or more for the lag to clear, and the hero to respawn. i also get a trigger error for a random trigger every time the hero respawns, (ive tried turning off the triggers that return the error, but then it just picks a different one) will this method help solve either of these problems? thanks in advance!

    Current Project: MangledMind's Impossible Bosses

    8 Heroes, 4 abilties each

    1 Boss (Normal/Impossible Mode)

    PvP Arena - All skill shots

    #16 Aug 29, 2010 at 09:36 UTC - 0 likes

    This is what I call, quest rewards made easy. Thanks and awesome job.

    #17 Aug 29, 2010 at 09:56 UTC - 0 likes

    @MangledMind: Go

    the lag is caused by the loop to add 1 point of experience a lot of times.
    I don't know if the asset supplied here uses the catalog one which is lag free since it is no loop at all just 2 actions, but at least it will cause less lag then the way you have it now.

    Helral's Lair
    Meow meoow meeow. I'm ze evil SC2MapsterKitten.

    UI Tutorials listing

    current projects:

  • 16 posts

You must login to post a comment. Don't have an account? Register to get one!