#20 Feb 25 2012, 8:15 am
|
|
You would need to add another if() statement, except using the experience variables instead of health.
| |
#21 Feb 25 2012, 1:22 pm
|
|
i dont understand what you mean example please,
why would i need another if statement for? | |
#22 Feb 25 2012, 1:22 pm
|
|
To update your experience bar?
| |
#23 Feb 25 2012, 1:26 pm
|
|
mm well you know more can i please have an example?
| |
#24 Feb 25 2012, 1:27 pm
|
|
this is what i have
var hp=10 maxhp=10 mp=10 maxmp=10 str=5 def=2 attackspeed=100 dead=0 level=1 exp=0 max_exp=10 mob/proc LevelCheck() if(usr.exp>=usr.max_exp) usr.exp=0 usr.max_exp=usr.max_exp*2 usr.level+=1 src<<"Level Up!" mob/Stat() if(previousxp != usr.exp) // disables constant winset() updates previousxp = usr.exp winset(src, "ExpBar", "value = [round((usr.exp / usr.max_exp) * 100)]") ..() | |
#25 Feb 25 2012, 1:27 pm
|
|
I know more because you are not trying to learn more, add the if() to the mob/Stat() proc just as I did for health, except use experience.
| |
#26 Feb 25 2012, 1:27 pm
|
|
but it just stays at 100% and doesnt move at all :(
| |
#27 Feb 25 2012, 1:28 pm
|
|
its tehre already cant you see it
if(previousxp != usr.exp) its there | |
#28 Feb 25 2012, 1:29 pm
|
|
unless you mean something else
| |
#29 Feb 25 2012, 1:32 pm
|
|
k i got it working just had to update couple things
| |
#30 Feb 25 2012, 1:39 pm
|
|
omg now my bug doesnt die lol everytime something good happens to me there's always something bad
| |
#31 Feb 25 2012, 1:40 pm
|
|
any ideas why this wouldnt work?
mob var bug_def=0 bugdead=FALSE BBhp=35 mob verb Attack(mob/M as mob in oview(1)) flick("regA",usr) var/damage = usr.str - bug_def if(damage <=0) usr << "[M] easily dodges your attack!" M << "You easily dodge [usr]'s attack." else if(damage>=1) M.hp -= damage M.deathcheck() view() << "[usr] attacks [M] for [damage] HP!" mob proc deathcheck() if(usr.hp <= 0) dead=1 view() << "[usr] dies!" sleep(2) usr.icon_state="spr_dead" sleep(10) usr.loc=locate(1,1,1) usr.hp=usr.maxhp usr.mp=usr.maxmp usr.exp=0 usr.icon_state="normal" sleep(1) usr.hp=usr.maxhp var/mob/BB BB = new/mob/bug() if(istype(BB) && src.hp<=0) //this will be true usr << "[M] is ugly!" exp+=50 winset(src, "ExpBar", "value = [round((usr.exp / usr.max_exp) * 100)]") LevelCheck() src.icon_state="dead" src.density=0 bugdead=TRUE del(src) | |
#32 Feb 25 2012, 1:44 pm
|
|
my problem is that the bug doesnt die?
| |
#33 Feb 25 2012, 1:53 pm
|
|
runtime error: bad client
proc name: deathcheck | |
#34 Feb 25 2012, 1:53 pm
|
|
thats the error that shows up inside the output when im playing my game
| |
#35 Feb 25 2012, 2:12 pm
|
|
is there a way i can make a private var so that there is no duplicate definitions?
| |
#36 Feb 25 2012, 3:11 pm
|
|
k i figured it out it works but now my experience bar doesnt move at all because i get the error i posted up there when i use
winset(src, "ExpBar", "value = [round((usr.exp / usr.max_exp) * 100)]") help? | |
#37 Feb 25 2012, 3:42 pm
|
|
anyone know how to make a expbar without interface use?
| |
#38 Feb 25 2012, 5:52 pm
|
|
POST A NEW THREAD PLEASE! (your original issue has been solved)
Caps intended! | |