ID:142228
 
Note:
I am aware of the "//" since I got the Text code from RaeKwon, and I'm not done coding this Mob.
Code:
mob/Kikuruno/Kirox
name = "Kirox"
icon = 'Icons/base_m1.dmi'
verb/Z()
set hidden = 1
usr.Frozen = 1
textonscreenbackground(1,1,13,5)//Sets up hwo big you want the background to be.
textonscreenTEXT(1.5,12,5,1.5,"????: Hey. ")// Sets up where the text will go, from which x to y and how far down.
sleep(5)
usr.close_menu()
textonscreenbackground(1,1,13,5)//Sets up hwo big you want the background to be.
textonscreenTEXT(1.5,12,5,1.5,"[usr]: (Who's this guy? o.o)")// Sets up where the text will go, from which x to y and how far down.
sleep(5)
usr.close_menu()
switch(input("What should I say?", "[usr]") in list ("Hey, I'm [usr]","You are?","Get out of my way!","(Ignore)"))
if("Hey, I'm [usr]")
textonscreenbackground(1,1,13,5)//Sets up hwo big you want the background to be.
textonscreenTEXT(1.5,12,5,1.5,"[usr]: Hey, I'm [usr]")// Sets up where the text will go, from which x to y and how far down.
sleep(5)
usr.close_menu()
textonscreenbackground(1,1,13,5)//Sets up hwo big you want the background to be.
textonscreenTEXT(1.5,12,5,1.5,"????: Hi [usr] I'm Kirox. Nice to meet you!")// Sets up where the text will go, from which x to y and how far down.
sleep(5)
usr.close_menu()
textonscreenbackground(1,1,13,5)//Sets up hwo big you want the background to be.
textonscreenTEXT(1.5,12,5,1.5,"Kirox: Anyways, I'm gonna be your guide for now.")// Sets up where the text will go, from which x to y and how far down.
sleep(5)
usr.close_menu()
textonscreenbackground(1,1,13,5)//Sets up hwo big you want the background to be.
textonscreenTEXT(1.5,12,5,1.5,"Kirox: I'm gonna introduce you to this place.. Right now you're at Kikuruno Island")// Sets up where the text will go, from which x to y and how far down.
sleep(5)
usr.close_menu()
textonscreenbackground(1,1,13,5)//Sets up hwo big you want the background to be.
textonscreenTEXT(1.5,12,5,1.5,"AznTeriyaki: Kikuruno?")// Sets up where the text will go, from which x to y and how far down.
sleep(5)
usr.close_menu()

else
return


Problem description:
Mobs.dm:44:error::expected a constant expression
I get this error from.
if("Hey, I'm [usr]")

Help pls :[

You can't have variables in a switch() proc.(IE: if("Hi I'm [E]") In cases where you NEED to use variables, use an if() else chain instead. Atleast that's what I do. I'm sure there's a less complex way to do it.
In response to Mechana2412
Mechana2412 wrote:
Atleast that's what I do. I'm sure there's a less complex way to do it.

Nah, looks like that's basically it (and it's not quite complex at all, now is it). About switch(),it just doesn't seem to support any kind of non-hardcoded value. But at least else-ifs are definitely much better than a silly series of if()s.