ID:262425
 
Code:
Form/Example
form_reusable = 0
var
name
name_size = 30
race
race_values = list("Green Spartan","Blue Spartan","Red Spartan","Yellow Spartan","White Spartan","Brown Spartan","Purple Spartan","Tan Spartan")
if("Green Spartan")
usr.icon = 'Master Chief.dmi'
usr.icon_state = "Green"


Problem description:
Hi I am making a Halo game and I am using Dantom's FormDemo. The demo had it so when you click the race name in the browser a whole list of other options of races comes down. I am trying to make it so you can make it so when u click a name that the users icon will be what ever icon it is. But it doesnt seem to work errors come up thats says:
loading Halo Combat Mission.dme
loading My Script.dms
Main.dm:70:error:list:undefined proc
Main.dm:70:error:= :expected a constant expression
Main.dm:72:error:usr.icon:undefined var
Main.dm:73:error:usr.icon_state:undefined var

Halo Combat Mission.dmb - 4 errors, 0 warnings (double-click on an error to jump to it)

How can I fix this so the icons will work. Thanks.

->Calus CoRPS<-
It should look like:

Form/Example
form_reusable = 0
var
name
name_size = 30
race
race_values = input("Choose a race", "RACE") in list ("Green Spartan","Blue Spartan","Red Spartan","Yellow Spartan","White Spartan","Brown Spartan","Purple Spartan","Tan Spartan")
if("Green Spartan")
usr.icon = 'Master Chief.dmi'
usr.icon_state = "Green"


if this is at the Login() part, you should remove the 'usr.' on the vars. It will be a problem if you don't.

--Vito
In response to Vito Stolidus
Code:
Form/Example
form_reusable = 0
var
name
name_size = 30
race
race_values = input("Choose a race", "RACE") in list ("Green Spartan","Blue Spartan","Red Spartan","Yellow Spartan","White Spartan","Brown Spartan","Purple Spartan","Tan Spartan")
if("Green Spartan")
usr.icon = 'Master Chief.dmi'
usr.icon_state = "Green"


ProcessForm()
usr.name = name
usr.race = race
usr << browse("<Body bgcolor = green><center><font color = black><font size = 7>R<font size = 5>anks you can earn {Note if you get to Spartan you will get Admin}<font size = 3><br>*Trainee = At start<br>*Rookie = 20kills<br>*Recruit = 60kills<br>*Master =180kills<br>*Expert =220kills<br>*General = 280kills<br>*Chief = 350kills<br>*Legendary = 500kills<br>*Spartan = 650kills")
world<<"[name] has just entered Halo Combat Mission"
usr.loc=locate(6,12,2)




HtmlLayout()
return \
{"<Body bgcolor = green>

Name:
[name] <br>
Suit Color:
[race] <br>

[submit]
"}

Ok I dont know if i am missiong something or what but now it says:
loading Halo Combat Mission.dme
Main.dm:76: Inconsistent indentation.
Main.dm:86: Inconsistent indentation.

Halo Combat Mission.dmb - 6 errors, 0 warnings (double-click on an error to jump to it)

->Calus CoRPS<-
In response to Calus CoRPS
Read the tutorial that came along with that. If you actually READ it, you'll find the answer is quite simple.

-Ryan
Why are you placing something that belongs in a proc in a /datum? Badboy!

Ol' Yeller
In response to Calus CoRPS
That if("Green Spartan") line belongs in a proc. In fact it also belongs in a switch() block. Putting it where you did, outside of any proc, will always give you an error.

Lummox JR