ID:268555
 
Dang it, I can't figure this out!
I'm trying to make a system where you have to click the stat to raise it, but you I can't get it so you can click the stat... because a process can't be inside of a process. x_X
Well, here's what I have so far...
mob
var
BP == 4
exp == 0
MEXP == 100
HP == MHP
MHP == Vit*4
MP == MMP
MMP == Int*3
Str = Pwr*3
Spd == Agi*2

Pwr == 8
Agi == 5
Vit == 3
Int == 6

Stat()
statpanel("[usr]")
stat("Name","[src]")
stat("Experience Points","[exp]/[MEXP]")
stat("Health:","[HP]/[MHP]")
stat("MP:","[MP]/[MMP]")
stat("Agility:","[Speed]")
stat("Strength:","Strength")
statpanel("Battle Stats")

stat("Dexterity:","[Agi]")
Click()
if(src.BP <= 0)
src << "You don't have enough Battle Points!"
else
src.Agi += 1
src.Spd += Agi*1.3(round,1)
src.BP -= 1

stat("Vitality:","[Vit]")
Click()
if(src.BP <= 0)
src << "You don't have enough Battle Points!"
else
src.BP -= 1
src.Vit += 1
src.MHP += Vit*1.2(round,1)

stat("Intelligence:","[Int]")
Click()
if(src.BP <= 0)
src << "You don't have enough Battle Points!"
else
src.BP -= 1
src.Int += 1
src.MMP += Int*1.3(round,1)
stat("Power:","[Pwr]")
Click()
if(src.BP <= 0)
src << "You don't have enough Battle Points!"
else
src.BP -= 1
src.Pwr += 1
src.Str += Pwr*1.4(round,1)

stat("Battle Points:","[BP]")

And, one MEASLY error, and here it is...
loading Level-Up Test.dme
Level-Up Test.dm:29:error: proc definition not allowed inside another proc

Level-Up Test.dmb - 1 error, 0 warnings (double-click on an error to jump to it)

Thanks for your help...
I'm just stateing out gibberish, but maybe try making it call a proc when you click...
In response to Metroid
Erm, Click is the process... x_x
So, I can't make it call a process when you click...
Hmm...
Thanks for trying to help.
In response to Hell Ramen
You have to display objs on the statpanel, then use their Click() proc.

They don't have to have icons.
In response to Garthor
Now I've got tons of undefined variables. X_X
In response to Hell Ramen
Show us what you're doing, you're probably mixing up the mob's var with the obj's var.
In response to DeathAwaitsU
obj
stats
Power
name = "Power: [Pwr]"
Click()
if(BP <= 0)
src << "You don't have enough Battle Points!"
else
BP -= 1
Pwr += 1
Str += Pwr*1.4(round,1)

_>
Yep... I don't know how to fix that. =/
Make a mob/proc?
In response to Hell Ramen
No, in Click() and DblClick() it's safe to use usr, which you should be using.
In response to Garthor
Thanks Garthor. :)
But, a problem...
How would I go about about making a formula? Like...
Str += Pwr *= 1.2
It doesn't seem to like that. =/
In response to Hell Ramen
Pwr += Pwr * 1.2
Str += Pwr

like that i guess
In response to Dark_samurai
Yes, but wouldn't that mess up power? I want power to only go up once each time you click it... thus meaning, that would times power by 1.2, making it a different number...
Maybe making a completely new variable with the same value of power.
Meh.
I'll get on it tomorrow.
In response to Hell Ramen
make a seperate varaiable to do it if you want, then add. like
var/pwradd = power + power *1.2
In response to Metroid
Yep, that was what I was thinking, but thanks Metroid. :D
Anyways, how would I go about adding the Objects to the "Battle Stats" panel?
In response to Hell Ramen
My friend showed me a while back let me recall...

This would be a Health bar of some type, I'll have two types, an extra if you want it to be on the HUD (Heads Up Display AKA: Your screen)
obj
stat_panel_hp
layer = MOB_LAYER + 1
icon = 'HPPanel.dmi'
icon_state = "100HP"
name = "HP Bar"

obj
stat_panel_hp
layer = MOB_LAYER + 1
icon = 'HPPanel.dmi'
icon_state = "100HP"
name = "HP Bar"
New(client/C)
if(C)
screen_loc="1,3"
C.screen+=src

/*second one is the HUD one, first is if you didnt want/need a HUD for it and just wanted it in ur statpanel

Okay now, I will show how to add it to your statpanel*/


mob
var/obj/stat_panel_hp/stat_panel_hp
Stat()
statpanel("Stats")
stat(stat_panel_hp)


There you have it. Easy as 1 2 3. Of course you will need to change the names, and icons and stuff, but that's just an example I would do if I was adding a HP Statbar. Now, remember, the first one is if you don't want it to appear on the HUD, second one is if you do.
In response to Metroid
No, I mean, like, adding the objects there. Like...
Usr.contents, it has objects in it, I want to add an object to usr.skills, uppon log in.
How would I go about doing that?
Thanks for trying to help. :P
Sorry for being not explanitory enough.
In response to Hell Ramen
I think what you need is


stat(contents)

That should work if i understand...
In response to N1ghtW1ng
Eh...?
Could you please explain that more?
In response to Hell Ramen
Thats what that would do! By adding stat(that obj) it adds the obj to your statpanel!
In response to Metroid
Ahh, thanks. :P
But, I tried it... and nothing happened, I did it just like you said...
        var/obj/stats/Power
var/obj/stats/Intelligence
var/obj/stats/Vitality
var/obj/stats/Dexterity
Stat()
statpanel("[usr]")
stat("Name","[src]")
stat("Experience Points","[exp]/[MEXP]")
stat("Health:","[HP]/[MHP]")
stat("MP:","[MP]/[MMP]")
stat("Agility:","[Spd]")
stat("Strength:","[Str]")
statpanel("Battle Stats","Click on a stat to raise it.",src.battle)
stat("Battle Points:","[BP]")
stat(Power)
stat(Intelligence)
stat(Vitality)
stat(Dexterity)


obj
stats
Power
Click()
if(usr.BP <= 0)
usr << "You don't have enough Battle Points!"
else
usr.Power()


Intelligence
Click()
if(usr.BP <= 0)
src << "You don't have enough Battle Points!"
else
usr.Intelligence()
Vitality
Click()
if(usr.BP <= 0)
src << "You don't have enough Battle Points!"
else
usr.Vitality()
Dexterity
Click()
if(usr.BP <= 0)
src << "You don't have enough Battle Points!"
else
usr.Dexterity()

=/
It doesn't appear, anywhere on the stat panel...
In response to Hell Ramen
Because they dont have icons.
Page: 1 2