ID:264195
 
Code:
mob
var
MaxHealth=0
MaxExp=0
MaxLvl=0
MaxAttack=0



mob/Bulbasaur
icon = 'Kanto Pokemon.dmi'
icon_state = "Bulbasaur"
density = 1
var
src.Health=5
src.Exp=0
src.Lvl=1
src.Attack=5
proc/Evolve()
lvl=16
if(lvl < 16)
usr << "Do you wish to evolve Bulbasaur to Ivysaur?","evolve") in list("Yes","No")
if("Yes")
del src
src.icon/I = new('Kanto Pokemon.dmi',icon_state = "Ivysaur",)
src.icon = I
return
if("No")
return


Problem description:
im trying to do a evolving code on my own not working out so good cause i got 2 errors can someone help please

Errors are:
Pokemon.dm:22:error: ,: expected }
Pokemon.dm:20:error: location of top-most unmatched {
Try changing
 usr << "Do you wish to evolve Bulbasaur to Ivysaur?","evolve") in list("Yes","No")


to

 usr << ("Do you wish to evolve Bulbasaur to Ivysaur?","evolve") in list("Yes","No")


and your if("No") isn't indented properly.

And in the future, show us which lines have the errors. We can't read minds - and it's harder over the internet anyways.
In response to Demon_F0rce
Once i move the if("No") to right place it comes up with more inconsistent indentations.


this is what i got so far.


mob
var
MaxHealth=0
MaxExp=0
MaxLvl=0
MaxAttack=0



mob/Bulbasaur
icon = 'Kanto Pokemon.dmi'
icon_state = "Bulbasaur"
density = 1
var
src.Health=5
src.Exp=0
src.Lvl=1
src.Attack=5
proc/Evolve()
lvl=16
if(lvl < 16)
usr << ("Do you wish to evolve Bulbasaur to Ivysaur?","evolve") in list("Yes","No")
if("Yes")
del src
src.icon/I = new('Kanto Pokemon.dmi',icon_state = "Ivysaur",)
src.icon = I
return
if("No")
return


Lines 25,27,29
In response to Active romio
OK, so far your code doesn't really make sense. Try this:

mob
var
MaxHealth=0
MaxExp=0
MaxLvl=0
MaxAttack=0



mob/Bulbasaur
icon = 'Kanto Pokemon.dmi'
icon_state = "Bulbasaur"
density = 1
var
Health=5
Exp=0
Lvl=1
Attack=5
lvl=16
proc/Evolve()
if(lvl < 16)
switch(input("Do you wish to evolve Bulbasaur to Ivysaur?","evolve") in list("Yes","No"))
if("Yes")
del src
src.icon/I = new('Kanto Pokemon.dmi',icon_state = "Ivysaur",)
src.icon = I
return
if("No") //Don't really need this, by the way
return
In response to Hazman
thanks but now it says

Pokemon.dm:26:error:I:undefined var
Pokemon.dm:25:error:src.icon/I:undefined var

In response to Active romio
mob
var
MaxHealth=0
MaxExp=0
MaxLvl=0
MaxAttack=0



mob/Bulbasaur
icon = 'Kanto Pokemon.dmi'
icon_state = "Bulbasaur"
density = 1
var
Health=5
Exp=0
Lvl=1
Attack=5
lvl=16
proc/Evolve()
if(lvl < 16)
switch(input("Do you wish to evolve Bulbasaur to Ivysaur?","evolve") in list("Yes","No"))
if("Yes")
del src
icon = icon('Kanto Pokemon.dmi',icon_state = "Ivysaur",)
return
if("No") //Don't really need this, by the way
return


Try that
In response to Hazman
    proc/Evolve()
// if(lvl < 16)
if(lvl >= 16)
switch(input(src,"Do you wish to evolve Bulbasaur to Ivysaur?","evolve") in list("Yes","No")) // src instead of usr

if("Yes")
// del src
// deleting src will terminate all running procs of src
// icon = icon('Kanto Pokemon.dmi',icon_state = "Ivysaur",)
// You don't need to change the icon
icon_state = "Ivysaur" // just change the icon_state
// if("No")
// Yea, this is not needed
In response to Hazman
That will not work anyhow, after you use del(src) it stops reading the proc and if it keeps reading the proc it won't either because you proclaimed src after it got deleted :/.




src.icon/I=
,

hah I will be be a undefined var there, it had to be.


var/I =



if(level <16)


That's wrong either, people will evolve even when they are not level 16.



It should be like this.
if(level >= 16)


So, people will evolve when they are level 16 or higher.



Also, the return isn't acutally needed there.



-Kenobi.
In response to Jemai1
i got one more question

Where would i be able to put the attacks in like Tackle this is what i got so far but keep getting Inconsistent indentation. i only need to learn what and where and how it goes for one attack and i will get the rest please and thank you.

mob/Bulbasaur
icon = 'Kanto Pokemon.dmi'
icon_state = "Bulbasaur"
density = 1
var
Health=5
Exp=0
Lvl=1
Attack=5
lvl=16
proc/Attacks()
if(lvl < 1)
switch(input("Your Bublasaur has learned Tackle"))
proc/Evolve()
if(lvl < 16)
switch(input(src,"Do you wish to evolve Bulbasaur to Ivysaur?","evolve") in list("Yes","No"))
if("Yes")
icon_state = "Ivysaur"

In response to Active romio