SC2Mapster Forums

Development > Triggers

Saving Veterancy

  • 7 posts
    #1 Feb 25, 2012 at 23:28 UTC - 0 likes

    Hey guys,

    I've recently started making a hero / rpg map and you have been a great resource so far. I've been trying to save veterancy levels for units that I have to despawn and later respawn at that veterancy. The only help I've found is this thread, but when I try to implement this with triggers, nothing happens; the spawned unit has level 1.

    My approach was to set variables for every player and every kind of hero, ie player 1 hero 1 level and so on. I'd set these ints via an Any Unit gains an Experience Level trigger. Then I added a while loop into my creation cycle that runs until last created unit has the experience level of player 1 hero 1 level. Obviously for this to work, I set the level saver triggers to off.

    What am I doing wrong?


    Last edited Feb 25, 2012 by MrLidenbrock
    #2 Feb 25, 2012 at 23:54 UTC - 0 likes

    @MrLidenbrock: Go

    doing it with triggers makes it a whole lot harder... i hope drsuperevil will help ya ps this might be doable if you know how to make auras.

    Last edited Feb 25, 2012 by XenoYoxa

    Extremism is never the solution. but then again neither is insanity.

    #3 Feb 25, 2012 at 23:57 UTC - 0 likes

    @XenoYoxa: Go

    Harder with triggers? Then how is the standard procedure for this kind of problem? And how will an aura save the level of my hero?

    #4 Feb 26, 2012 at 01:37 UTC - 0 likes

    I am not sure, if I understand, what you want: You want to remove some units and respawn them later, correct?
    Any reason, why you not just hide them, move them to the edge of the map, give them to a neutral player, disable them for some time or do whatever you want without actually removing the unit?

    Last edited Feb 26, 2012 by Kueken531

    #5 Feb 26, 2012 at 09:05 UTC - 0 likes

    @Kueken531: Go

    Hm... I guess hiding / showing them is a pretty functional workaround to my problem. No, there's no reason I can't do that and I think I will now, thank you very much ^^

    I was just stuck in my way of thinking, I guess.

    #6 Feb 26, 2012 at 23:07 UTC - 0 likes

    @MrLidenbrock: Go

    Hm... ok actually, there might be a problem. What if I want to save the levels / xp / possibly items too for players through a bank and make it recoverable if a player plays the map again some time? Then I'll have to be able to level up units when they spawn for a player who's played the map already. What to do?

    #7 Feb 27, 2012 at 02:13 UTC - 0 likes

    Thats another story. You should be able to track the amount of experience a unit has, and you can add experience with the Unit Property functions afaik, or you can use Modify Unit effects. You can make them spend skill points by issuing the order to learn the skills. You can get all items a unit has as a unit group.

    You could also try to save the entire unit in the bank, but that is usually not the best option and might not include all the experience, ability levels or items.

    Last edited Feb 27, 2012 by Kueken531
  • 7 posts

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