ID:148510
 
From this code:

mob/var/specific // What the particular race is
mob/var/health // Mostly so as to put little need for that in the actual code, this is for combat
mob/var/focus // What the race's focus is (Warrior, etc.)

mob // mob
proc // proc
CharacterSel(M,L,P)
switch(alert("What is thy race, Sir [src.name]?",,"Name","[M]","[L]","[P]"))
if("[M])"


I get the following errors:

loading megalib.dme
megalib.dme:18:error: }: missing comma ',' or right-paren ')'
megalib.dm:15:error: list started here

megalib.dmb - 3 errors, 0 warnings (double-click on an error to jump to it)


Pay no attention to the file names, I always use wierd names.
Drafonis wrote:
From this code:

mob/var/specific // What the particular race is
> mob/var/health // Mostly so as to put little need for that in the actual code, this is for combat
> mob/var/focus // What the race's focus is (Warrior, etc.)
>
> mob // mob
> proc // proc
> CharacterSel(M,L,P)
> switch(alert("What is thy race, Sir [src.name]?",,"Name","[M]","[L]","[P]"<b>))</b>
> if("[M]<B>)"</b>
>

I get the following errors:

loading megalib.dme
megalib.dme:18:error: }: missing comma ',' or right-paren ')'
megalib.dm:15:error: list started here

megalib.dmb - 3 errors, 0 warnings (double-click on an error to jump to it)


Pay no attention to the file names, I always use wierd names.

Take a look at the bolded bits
In response to Maz
Mz, you may want to preview posts before posting them.
In response to Hazman
I changed the code so it says:

mob/var/specific // What the particular race is
mob/var/health // Mostly so as to put little need for that in the actual code, this is for combat
mob/var/focus // What the race's focus is (Warrior, etc.)

mob/var/specific // What the particular race is
mob/var/health // Mostly so as to put little need for that in the actual code, this is for combat
mob/var/focus // What the race's focus is (Warrior, etc.)

mob // mob
proc // proc
CharacterSel(M,L,P)
switch(alert("What is thy race, Sir [src.name]?",,"Name","[M]","[L]","[P]"))
if("[M]") // problem
src.specific = "[M]"
if("[L]") // problem
src.specific = "[L]"
if("[P]") // problem
src.specific = "[P]"


Now it says, in errors,

loading megalib.dme
megalib.dm:15:error::expected a constant expression
megalib.dm:17:error::expected a constant expression
megalib.dm:19:error::expected a constant expression

megalib.dmb - 3 errors, 0 warnings (double-click on an error to jump to it)

In response to Drafonis
CharacterSel(M,L,P)
switch(alert("What is thy race, Sir [src.name]?",,"Name","[M]","[L]","[P]"))
if("[M]") // problem
src.specific = "[M]"
if("[L]") // problem
src.specific = "[L]"
if("[P]") // problem
src.specific = "[P]"</DM>

The first thing is in your alert() you have a double ,. I belive you only wanted one, or if you just want a blank title at least use a ,"",

(What are M L P? Come on, use some descriptive variable names) I don't know exatly why, but the switch doesn't seem to like [M]'s... perhaps a:
var/choice = alert("What is thy race, Sir [src.name]?","Name","[M]","[L]","[P]")
if(choice == "[M]")
src.specific = "[M]"
etc.


-<font color="#bbffbb">Nova</font>
In response to Drafonis
Switches require constants to work; you can't use "[var]" as a value for it.

Lummox JR
In response to Nova2000
I did that, now I get invalid expression for the checking if the player's answer is M. Also, M, L, and P are there because I'm using this for a library. This proc should be able to take parameters, as far as I know.