View Full Version : MAxHealth
ricer
April 8th, 2006, 11:17 AM
heya i need to know a small thing,
i have a rpg game with level and exp system but, i would like to add something extra,
like:
if u get lvl 2 u gain health and attackrate
if (_root.exp>100){
level = 2;
"Maxhealth = 200;"
stop();
^ <== thats what im trying nomal max healh = 150 and when u lvl up maxhealth gets 200
so if u use a potion or a healing field or spell u need maxhealth else u go over the health limit
can anyone make a maxhealth system for me?
im noob in that kind of stuff
thnx :D
regards,
Ricer
bombsledder
April 8th, 2006, 12:16 PM
well from what i see you don't know syntax :P
if (_root.exp>=100){
level++;
Maxhealth = 200
//if its a textbox MaxHealth.Text=200
//also you exp leveling script isn't good unless you reset the _root.exp variable back to o
stop();
ricer
April 8th, 2006, 01:26 PM
i allready get that but i need a variable from maxhealth
the function of maxhealth must be to make the health stop at the value of maxhealth
woad
April 8th, 2006, 04:55 PM
if (health >= Maxhealth)
{
health = Maxhealth;
}
ricer
April 8th, 2006, 06:02 PM
it doesnt work =(
it still goes higher that 150 on lvl 1 when i got maxhealth on 150
Joppe
April 8th, 2006, 06:18 PM
if(health > maxhealth){
health = maxhealth
}
if (_root.exp>100){
level = 2;
maxhealth = 200;
}
if(_root.exp<100){
level = 1;
maxhealth = 150;
}
if(_root.exp>300){
level = 3;
maxhealth = 250
}
//etc etc etc...
ricer
April 8th, 2006, 06:21 PM
are u sure thats stops the health from healing?
like im lvl 1 and i stand on a healing place it cannot go further that 150
but @ lvl 2 not higher that 200 ?
Joppe
April 8th, 2006, 06:24 PM
should be so. Try it.
Sooo im so incredlibly bored so I just had to edit this and tell you, yes it works :)
ricer
April 9th, 2006, 03:53 AM
doesnt work for me =(
but thanks anyway for trying to help me
rpgfanatic
April 20th, 2006, 10:39 AM
could be made smaller though but oh well,it gives you an idea,
as the base put in=
@first key frame:@
---------------------
maxhp = 150;
hp = 150
exp = 0;
attackrate = 20;
lvl = 1;
------------------------------------------------
@on 2nd keyframe:@
note!1:
the roots should be placed on frame 1,and where you actually play the game is: frame 2 (or another frame if you made an intro and/or start screen,where the battle begins)
note!3:
if it's a game based on frames and not on mc's,ALWAYS instead of going to frame 1, let it go back to frame 2(note!4 if you have frame 2(and maybe more)filled with an intro or startscreen or etc. don't change a darn thing)
-------------------------------------------------
if(_root.exp>99){
if(_root.lvl==1){
_root.maxp=_root.maxhp+50;
_root.attackrate=_root.attackrate+5;
_root.exp=0;
_root.lvl=_root.lvl+1
}
}
// it can be changed to a smaller version,but let's keep it nice and big so it's easier to understand;-)
if(_root.exp>149){
if(_root.lvl==2){
_root.maxp=_root.maxhp+50;
_root.attackrate=_root.attackrate+5;
_root.exp=0;
_root.lvl=_root.lvl +1;
}
}
if(_root.exp>199){
if(_root.lvl==3){
_root.maxp=_root.maxhp+50;
_root.attackrate=_root.attackrate+5;
_root.exp=0;
_root.lvl=_root.lvl +1;
}
}
stop()
//and on and and on.till your guy can reach the maxlvl you like him to :-)
-----------------------------------------------------------------------
be sure to read the notes! first before you just squat in the codes.
hope it was helpfull,if you don't understand something of it ask me and i will make an in-depth explenation.
if it isn't working or it has a bug tell me,
the problem will probably be the scripting of the heal spot.
bombsledder
April 20th, 2006, 08:21 PM
you should probably make a formula for exp since its alot easier then writing if(exp >200){//blah blah } check my posts i remember posting one before it was a whole tile based thing i think
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.