HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Level Scaling >?<

04-26-2008, 01:24 AM#1
Zero
So, I'm trying to figure out how to devise a system that spawns units based on the level of your hero.

I've been going over the available choices in triggers for the past few hours and am stumped.

Anyone know how to make it so when a unit is spawned it's life % is based on the level of your hero. Like lets say your hero is lv 3 then maybe the monsters life will be 30% of maximum? Something like this?

I tried the set life % trigger and the arithmetic action looks right but I can't find a way of picking the hero's level.

I mean I could always do a trigger that states:

If hero lv is X
Then set life/create unit with % of max life.

But this becomes a pain due to lets say I have like over 100 levels or so. That's alot of triggers >.>
There's gotta be a better way to do this
04-26-2008, 01:50 AM#2
Salbrismind
Have you never heard of a variable? If your using gui, you will have to create a real-variable. To do it use the yellow x at the top of the trigger editor. Then set the variable to the level of the hero and do some math to convert it to a perfect health or w/e you want and set the units health to that number. Look for the set variable action and the function to use a variable to set the units hp.

You seem like a smart person so try a bit of searching around in the actions if you can't find it at first. If your really stuck just ask again.
04-26-2008, 02:12 AM#3
TEC_Ghost
Trigger:
Spawn_Units
Collapse Events
Unit - A unit owned by Player 1 (Red) Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to <Whatever Spell Summons>
Collapse Actions
Unit - Create 1<Summoned Unit> for Player 1 (Red) at (Position of (Triggering unit)) facing 0.00 degrees
Unit - Set life of (Last created unit) to ((Real((Hero level of (Triggering unit)))) x 10.00)%

That'll spawn a unit with 10% per hero level, it wont work past level 10 cause well, you can't get over 100% life :P So you'll have to adjust it for your liking, but that's the jist of it.
04-26-2008, 02:37 AM#4
Zero
Ya that makes sense. Thanks for the info and as for knowing about what a variable is, of course I do. It's been like 3 years or so since I've touched the editor and have forgot a lot of things >.>