ID:264278
 
Code:
mob/proc/evolve()

if(usr.Level<=1)
src.icon = 'pokemon.dmi'
src.icon_state = "bulba"
if(usr.Level>=16)
src.icon_state = "enrage"
src.icon_state = ""
src.icon = 'pokemon.dmi'
src.icon = "ivy"


Problem description:
Is this code wrong, the compile saids its good?


NO 'usr' in procs, use 'src' instead. >_>
What is that supposed to do?

        src.icon_state = "enrage"
src.icon_state = ""
src.icon = 'pokemon.dmi'
src.icon = "ivy"

In response to Schnitzelnagler
I just tried..

so this:

mob/proc/evolve()

if(usr.Level<=1)
usr.icon = 'pokemon.dmi'
usr.icon_state = "bulba"
if(usr.Level>=16)
usr.icon = 'pokemon.dmi'
usr.icon = "ivy"
In response to B-Blast
I think you misunderstood me.
I wasn't trying to "diss" your work in any way, I was asking what you had in mind when writing the code, so maybe someone could give you a hint or two.
That is not meant negative, but without knowing what should happen, it is hard to comment code.
In response to Schnitzelnagler
I want to code a evolving script for pokemon.
But i dont know how
In response to B-Blast
B-Blast wrote:
But i dont know how

Have you tried to work your way through the DM guide, by first reading and then writing and compiling the simple snippets it is providing?
Whenever you're not sure about the use of something, you can have a quick look at the reference to help you out.
In response to Schnitzelnagler
I'l tried the DM, but i'm stuck at Chapter 2:
The previous chapter was a quick introduction to give you a taste for DM programming. This and the next few chapters will cover the same basic ideas in greater detail.

A DM program begins at the root of the tree and descends along multiple branches. Each branching point (or node) is given a name to distinguish it from the other branches at the same level. Names are case-sensitive (so apple and Apple are different). They may be any length and may contain any combination of letters, numbers, and underscores as long as they do not start with a number.

Consider the following code:

turf trap pit quicksand glue

I dont understand this part.
In response to B-Blast
        usr.icon = 'pokemon.dmi'
usr.icon = "ivy"


Why do you want to set the icon twice?
And if you set the icon, you most likely want it to be a file, wouldn't you?

Asides, using "usr" in a procedure is a tricky business you most likely want to avoid.
In response to B-Blast
src, not usr he said.
In response to Schnitzelnagler
Schnitzelnagler wrote:
>       usr.icon = 'pokemon.dmi'
> usr.icon = "ivy"
>

Why do you want to set the icon twice?
And if you set the icon, you most likely want it to be a file, wouldn't you?

Asides, using "usr" in a procedure is a tricky business you most likely want to avoid.

How you going to then...?
In response to B-Blast
Look up icon and icon_state in the DM Guide or DM Reference.
In response to Mizukouken Ketsu
mob/proc/evolve()

if(src.Level<=1)
src.icon = 'pokemon.dmi'
src.icon_state = "bulba"
if(src.Level>=16)
src.icon = 'pokemon.dmi'
src.icon_state = "ivy"


I think i'm stupid
//Original Content:
mob/proc/evolve()

if(src.Level<=1)
src.icon = 'pokemon.dmi'
src.icon_state = "bulba"
if(src.Level>=16)
src.icon = 'pokemon.dmi'
src.icon_state = "ivy"
//Fixed:
mob/proc/evolve()

if(src.Level<=15) //As long as they are under level 16, they will stay that type
src.icon = 'pokemon.dmi'//the icon to change into
src.icon_state = "bulba"//the iconstate to be
if(src.Level>=16)//As long as they are over level 15
src.icon = 'pokemon.dmi'//the icon to change into
src.icon_state = "ivy"//the iconstate to be
In response to Ssj4justdale
As far as what I know about Pokemon, that evolve proc is very bad.

Ssj4justdale wrote:
> //Original Content:
> mob/proc/evolve()
>
> if(src.Level<=1)
> src.icon = 'pokemon.dmi'
> src.icon_state = "bulba"
> if(src.Level>=16)
> src.icon = 'pokemon.dmi'
> src.icon_state = "ivy"
> //Fixed:
> mob/proc/evolve()
>
> if(src.Level<=15) //As long as they are under level 16, they will stay that type
> src.icon = 'pokemon.dmi'//the icon to change into
> src.icon_state = "bulba"//the iconstate to be
> if(src.Level>=16)//As long as they are over level 15
> src.icon = 'pokemon.dmi'//the icon to change into
> src.icon_state = "ivy"//the iconstate to be
>


You'd want one that would actually execute change upon calling if the src's level is high enough. Also, the original icon_state can be defined within the mob or obj definition for that particular pokemon.

mob/Pokemon/Bulbasaur
icon = 'pokemon.dmi'
icon_state = "bulba"

type/proc/Evolve //replace "type" with "mob" or "obj" depending on the definition type on the pokemon
if(src.level<=15) return
else if(src.level>15 && src.level<16)
src.icon = 'pokemon.dmi'
src.icon_state = "ivy"
else if(src.level>=16)
src.icon = 'pokemon.dmi'
src.icon_state = "veno"
In response to Mizukouken Ketsu
doesnt really matter if its bad because he wanted his thing fixed.

And I fixed his 1st stage evolution not 2nd, so it doesnt rly matter, the way ur doing it, might as well do all the damn pokemon
In response to Ssj4justdale
No need to get angry? I was just making the already established code a little better and safer; with him being new and all.
In response to Mizukouken Ketsu
Not getting angry, xD, thought i was bein funny :D