ID:146809
 
(by the way, I like the new inteface :D)
Code:
turf/Battle
var/Occupied
//icon='Whatever.dmi''
Area1
Grass_Battle
var/Encounter = rand(2,7)
//icon_state="Grass"
Entered(mob/M)
if(istype(M,/mob))
if(Encounter == 3)
usr<<"You have run into a Battle!"


Problem description:
Battle.dm:19:error: icon_state: expected end of statement

-Whats wrong with the rand()? I loked it up in the Help/Manual (F1) and I've got ir correct. Is it possible to set a variable like that?
You can't set variables like that at compile time. Procedures like rand() only get executed at runtime(). Try calling it in New() or somewhere else, instead.
In response to Jon88 (#1)
No usr in proc. Ungh.
In response to Jon88 (#1)
Thanks. :D
so if I defined it under Entered() it would work?
(I'm at my school comp so i can't write it right now.)
turf/Entered(mob/M)
var/Encounter = rand(1,&)
if(istype(M,/mob))
if(Encounter == 2)
..() //blah blah blah
In response to Mechanios (#3)
That'll work, sure, if it's where you want the variable to be used.
In response to Jon88 (#4)
Awesome :D
I'm getting better ^.^