ID:149568
 
Ok, I made it so Icons take control of the statpanel,
Like a round sphere stands for Love, and when your love goes up, more gets colored in, so at 100 it is full, problem is, one pet, (+5 love) and it goes full! Here is my code!

obj/Love
icon = 'Love.dmi'
icon_state = "1"
//Icon state 1, already have 10 love out of 100.
mob/proc/All()
if(usr.Love <= 9)
usr.Hart:icon_state = "0"
else
if(usr.Love >= 10 && usr.Love <= 19)
usr.Hart:icon_state = "1"
else
if(usr.Love >= 20 && usr.Love <= 29)
usr.Hart:icon_state = "2"
else
if(usr.Love >= 30 && usr.Love <= 39)
usr.Hart:icon_state = "3"
else
if(usr.Love >= 40 && usr.Love <= 49)
usr.Hart:icon_state = "4"
else
if(usr.Love >= 50 && usr.Love <= 59)
usr.Hart:icon_state = "5"
else
if(usr.Love >= 60 && usr.Love <= 69)
usr.Hart:icon_state = "6"
else
if(usr.Love >= 70 && usr.Love <= 79)
usr.Hart:icon_state = "7"
else
if(usr.Love >= 80 && usr.Love <= 89)
usr.Hart:icon_state = "8"
else
if(usr.Love >= 90 && usr.Love <= 99)
usr.Hart:icon_state = "8"
else
if(usr.Love == 100)
usr.Hart:icon_state = "9"

Ok Please help
FireEmblem wrote:
Ok, I made it so Icons take control of the statpanel,
Like a round sphere stands for Love, and when your love goes up, more gets colored in, so at 100 it is full, problem is, one pet, (+5 love) and it goes full! Here is my code!

obj/Love
icon = 'Love.dmi'
icon_state = "1"
//Icon state 1, already have 10 love out of 100.
mob/proc/All()
if(usr.Love <= 9)
usr.Hart:icon_state = "0"
else
if(usr.Love >= 10 && usr.Love <= 19)
usr.Hart:icon_state = "1"
else
if(usr.Love >= 20 && usr.Love <= 29)
usr.Hart:icon_state = "2"
else
if(usr.Love >= 30 && usr.Love <= 39)
usr.Hart:icon_state = "3"
else
if(usr.Love >= 40 && usr.Love <= 49)
usr.Hart:icon_state = "4"
else
if(usr.Love >= 50 && usr.Love <= 59)
usr.Hart:icon_state = "5"
else
if(usr.Love >= 60 && usr.Love <= 69)
usr.Hart:icon_state = "6"
else
if(usr.Love >= 70 && usr.Love <= 79)
usr.Hart:icon_state = "7"
else
if(usr.Love >= 80 && usr.Love <= 89)
usr.Hart:icon_state = "8"
else
if(usr.Love >= 90 && usr.Love <= 99)
usr.Hart:icon_state = "8"
else
if(usr.Love == 100)
usr.Hart:icon_state = "9"

Ok Please help

I can simplify this:

//You should type your Heart variable to
// be an obj if you want to use the icon_state var.
// Try not to use the colon ":".

mob/var/obj/Heart

mob/proc/All()
switch(round(usr.love))
if(0 to 9) usr.Heart.icon_state = "0"
if(10 to 19) usr.Heart.icon_state = "1"
if(20 to 29) usr.Heart.icon_state = "2"
if(30 to 39) usr.Heart.icon_state = "3"
if(40 to 49) usr.Heart.icon_state = "4"
if(50 to 59) usr.Heart.icon_state = "5"
if(60 to 69) usr.Heart.icon_state = "6"
if(70 to 79) usr.Heart.icon_state = "7"
if(80 to 89) usr.Heart.icon_state = "8"
if(90 to 99) usr.Heart.icon_state = "9"
if(100) usr.Heart.icon_state = "10"
In response to Spuzzum
Wow! I had no idea you could use "to" like that...I learned something that will be really helpful. Thanks, Spuzzum.
In response to Nadrew
Same thing with me!Wait....I saw that in the Blue Book.Im gonna go double check.

-Kappa the Imp
In response to Kappa the Imp
I need to buy the Blue Book..
In response to Spuzzum
Ok
In response to Kappa the Imp
Nope that code is:

proc/Constellation()
//day should be 1 to 365
if(day > 354) return "Capricorn"
if(day > 325) return "Sagittarius"
if(day > 295) return "Scorpito"
if(day > 265) return "Libra"
if(day > 234) return "Vigro"
if(day > 203) return "Leo"
if(day > 172) return "Cancer"
if(day > 141) return "Gemini"
if(day > 110) return "Taurus"
if(day > 79) return "Aries"
if(day > 50) return "Pisces"
if(day > 20) return "Aquarius"
return "Capricorn"

Thats the code I saw.Weird.

-Kappa the Imp
In response to FireEmblem
It worked fine in my test. That was an example you have to edit it to fit your needs.
In response to Nadrew
You've must off messed it up,because it works fine.

-Kappa the Imp
In response to Kappa the Imp
^_^;; end of topic,

=D You are the weakest link, Goodbye!
In response to Nadrew
Nadrew wrote:
Wow! I had no idea you could use "to" like that...I learned something that will be really helpful. Thanks, Spuzzum.


Yes, that will help me a lot with something *has evil grin on face* *realizes he has an evil grin and makes it go away* *forgets why he had an evil grin* *remembers why he had an evil grin* *evil grin returns*