HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

how do u give a hero 3 skill points for 1 level with no triggers

01-17-2005, 01:43 PM#1
Mothmann
how do u give a hero 3 skill points for 1 level with no triggers?
is it possible? is there a gameplay constant im passing up somewhere? because theres problems with just using triggers such as

event - hero gains a level

action - give triggering unit 2 skill points
(this isn't the exact code wording but its gets the point across)

now the problem with this is. if a hero gains 5 levels at once then the trigger will only give the hero 2 extra skill points instead of 10.

i have found ways of getting around this using a custom xp gain system. but it bugs out if i try to give it all players in a area instead of just the killing unit.

so is there a way to give hero's 3 skill points per level without using triggers?
01-17-2005, 04:42 PM#2
Panto
Nope. Use triggers. You're on the right track.
01-17-2005, 04:58 PM#3
Mothmann
Quote:
Originally Posted by Panto
Nope. Use triggers. You're on the right track.

thanks for answering that. it would be nice if u could just set it in gameplay constants but triggers will work since i fixed the xp gain.

im using point values to determine the amount of xp the unit will gain and heres my code if anybody wants it. this wont work with more than 1 hero PER PLAYER. but it could easily be modified to work with 2 or more.

it also has a add gold factor in there that takes the point value and divides it by a random number. i used to have the random set to 1 to (point value of (dying unit)) but that gave WAY to little gold so i set it to 1 to 6

XP is a integer variable with an array. instead of actually giving the xp directly to the unit. you give it to the XP integer (to the array of the owner of the unit) then it feeds it out of the XP integer to the character 1 xp at a time. This causes the unit to actually gain its levels 1 at a time. instead of all at once. therefor if u have a code that gives it 2 skill points at a level it will get all the skill points even if it gains 5 levels at once. altho im guessing this will have a bug that if 2 units die at the same time then it will give you double xp for both.


Code:
XP Gain
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Unit Group - Pick every unit in (Units within 2000.00 of (Position of (Dying unit)) matching (((Matching unit) belongs to an ally of (Owner of (Killing unit))) Equal to True)) and do (Actions)
            Loop - Actions
                Player - Add ((Point-value of (Triggering unit)) / (Random integer number between 1 and 6)) to (Owner of (Picked unit)) Current gold
                Set XP[(Player number of (Owner of (Picked unit)))] = (XP[(Player number of (Owner of (Picked unit)))] + (Point-value of (Triggering unit)))
                For each (Integer A) from 1 to XP[(Player number of (Owner of (Picked unit)))], do (Actions)
                    Loop - Actions
                        Hero - Add 1 experience to (Picked unit), Hide level-up graphics
                        Set XP[(Player number of (Owner of (Picked unit)))] = (XP[(Player number of (Owner of (Picked unit)))] - 1)
01-17-2005, 09:26 PM#4
Shark
how can u level up a hero 5lvls in one moment ?
you can go with that trigger u made up, but i would recomend one of the following:

- make units give less XP

- make heros need more XP to level up

cuz leveling 5lvls at once just.... isnt natural .....
01-17-2005, 09:45 PM#5
ZhadowAzzazzin
I'm Probably Wrong here, but with that trigger you have above wouldnt it loop the giving of experience over and over leveling the units indefinatly? Wouldnt it be more effective to use the Pick Units in Unit Group and do Action rather thatn Actions so that it happens every time a unit is killed, but only happens once. Onec again I may be wrong.
01-20-2005, 11:34 PM#6
Mothmann
Quote:
Originally Posted by Shark
how can u level up a hero 5lvls in one moment ?
you can go with that trigger u made up, but i would recomend one of the following:

- make units give less XP

- make heros need more XP to level up

cuz leveling 5lvls at once just.... isnt natural .....

its a orpg type deal im working on and some bosses may have a point value set all the way up to 100,000. so if you are following a higher level and they kill that guy then you would get a butt load of level's off it. you couldn't get that many levels by yourself. but someone else could kill something for you and there you go. the max level is 1,000 anyways.


Quote:
Originally Posted by ZhadowAzzazzin
I'm Probably Wrong here, but with that trigger you have above wouldnt it loop the giving of experience over and over leveling the units indefinatly? Wouldnt it be more effective to use the Pick Units in Unit Group and do Action rather thatn Actions so that it happens every time a unit is killed, but only happens once. Onec again I may be wrong.


yea you are wrong there because the 2nd number in the loop is set to the integer varible "XP". so the loop will only happen the exact amount of times of the XP variables size. so if you just killed someone with a point value of 100 then the point value is given to you the XP variable. so XP=100. then it runs this trigger which causes the loop to happen 100 times. it gives the picked unit 100 xp. hopefully i helped out some if you need me to be more descriptive i will.

Quote:
Originally Posted by Lord Vexorian
you can just add some hero skill points to the hero and done

no my friend you cant. did you not read anything??? did you even read the first post??????? because if a hero gains 5 levels all at once. and you have a trigger set up like that one that gives him 2 points everytime he gains a level. and he gains those 5 levels all at once. he only get 2 extra points. not 10. i said the same exact thing above. start reading before posting smart elic remarks and makin yourself look stupid.

what my trigger does is makes sure the hero only gains 1 level at a time. this way even if he technically gains 10 levels all at once. he will still get all 20 extra points.

so far this trigger has worked perfectly except for one thing. the max amoung of xp that can be gained is 4665, give or take a few. you will still get the leftover xp on the next gain because its still stored in the integer. but why would it cap it at 4665? is the max number a integer can be 4665 ??
01-21-2005, 12:39 AM#7
Guest
Quote:
Originally Posted by Shark
how can u level up a hero 5lvls in one moment ?
you can go with that trigger u made up, but i would recomend one of the following:

- make units give less XP

- make heros need more XP to level up

cuz leveling 5lvls at once just.... isnt natural .....


why isn't it natural...? DBZ and stuff isn't natural if he want's to then let him do it and besides begining triggerers like me need to know how to do things and then when they learn oh man he was right he does have too much health then they can fix
01-21-2005, 06:05 AM#8
Panto
Quote:
start reading before posting smart elic remarks and makin yourself look stupid.

I would like to point out that insulting an influential member of the forum is also not the smartest thing to do. Granted, it seems like what he said isn't useful. Saying so is not inappropriate. What you said may be a little too far.

Out of curiousity, would you tell us what sort of tests you've run to make sure that the level gained doesn't fire for each level, even when earning multiple?
01-21-2005, 11:58 AM#9
imwithsstupids
if you gain like 5 levels with a quest or something lkie that. have it give like 500 exp wait ten more 500 exp then wait and more exp and so on. then it will hit every level in the couple seconds :)
01-21-2005, 01:52 PM#10
Mothmann
Quote:
Originally Posted by Panto
I would like to point out that insulting an influential member of the forum is also not the smartest thing to do. Granted, it seems like what he said isn't useful. Saying so is not inappropriate. What you said may be a little too far.

Out of curiousity, would you tell us what sort of tests you've run to make sure that the level gained doesn't fire for each level, even when earning multiple?


gave a unit with only 1 health 100,000 point value. killed it. gained 8 levels. gained 16 extra points worked almost perfect. but it stopped there. only giving him a total of 4665 xp. thats my only problem right now. why it stops at 4665 i dont know. you dont actually loose your xp that you should have gained tho. it will stay stored in the XP variable. so the next time you kill a unit that has a point value of say 20 you still gain another 4665 xp because it feeds itout of that variable. this willl suck for later on in the game when almost every enemy will have over 5000 point value. i think i'll just add multiple loops for the xp gain this way if the first loop doesn't feed him all his xp the 2nd one will give him the rest. or the 3rd or 4th. this is a stupid way of getting around it tho so if anybody has a better idea please post.

also i would like to say that gaining multiple levels isn't something that happens every 2 seconds. but it can happen. and when it does happen i would like it to happen right and not be buggy.

try this code out for yourself. goto your gameplay constants and set all the hero xp tables to 0 and such. then implement this code in. heck i could even make a sample map if you wanted and post it.


sorry for being mean about him posting a completly pointless post but someone who is such a common member should know more than anybody not to post pointless posts like that. being a influential member doesn't justify what he done it only makes it worse on him because he should know better.
01-21-2005, 02:14 PM#11
Mothmann
here it is. just 4 heros for 4 players. 2 computer controlled. and some creeps with different point values.
01-21-2005, 03:37 PM#12
Vexorian
Actually what I said is right, only that the implementation is not which you pretended to have.

You can just use custom values or handle variables, or an array if a player only has a hero, to keep track of the latest level of the hero, then when the 'get level' event fires, substract the current level of the hero with the latest one saved, there you have how much the level increased, you add skill points to the hero based on that and at the end, you set the variable or whatever you are using to the new level of the hero

edit: rep spam! - so mature...
01-21-2005, 07:07 PM#13
Mothmann
Quote:
Originally Posted by Lord Vexorian
Actually what I said is right, only that the implementation is not which you pretended to have.

You can just use custom values or handle variables, or an array if a player only has a hero, to keep track of the latest level of the hero, then when the 'get level' event fires, substract the current level of the hero with the latest one saved, there you have how much the level increased, you add skill points to the hero based on that and at the end, you set the variable or whatever you are using to the new level of the hero

edit: rep spam! - so mature...

haha rep spam??? you deserved it. what you said didn't help ANYTHING and you know it. you knew it enough that you deleted it. but heres what you said before.
just because you get negative rep doesn't mean its rep spam. you deserved it for posting such a pointless and smart elic post.

Quote:
Originally Posted by Lord Vexorian
you can just add some hero skill points to the hero and done

considering you said ADD SOME HERO SKILL POINTS TO THE HERO "AND DONE" means you in no way meant anything about what you said above. yes it would have been helpful if you posted what you said just now before but you didn't. you just came in here probably just reading the title of the thread and not reading any of the post's and said JUST ADD SOME POINTS AND YOUR DONE. which didn't help a thing. any idiot could just add some points and he's done.

Quote:
Originally Posted by Lord Vexorian
Actually what I said is right, only that the implementation is not which you pretended to have.

nope not true. you said "AND DONE" which meant you was saying all you have to do is add the points and you have to do alot more then that. so what you said is wrong. stop bein a ass about it and take your deserved negative points like a man.



edit = isn't spam when someone keeps doing something over and over like email spam when someone sends message after message. i only repped you once.