mob/proc/fight()
switch(input("Attack who?",text) in list ("Enemy","Enemy2"))
if("Enemy")
//coding for attacking the first enemy
well i want to take out the "Enemy" and "Enemy2" with variables that the usr has like E and E2 which are assigned to be the name of the Enemy when battle start. i tried doing it like this:
mob/proc/fight()
switch(input("Attack who?",text) in list ("[E]","[E2]"))
if("[E]")
but it said expected a constant expression.
Is there a way to do this??
Declare a var and call it who or something like that. Next, instead of if, use who = if and the rest of your code. Something like this:
[DM]
mob/proc/fight()
switch(input("Attack who?",text) in list ("[E]","[E2]"))
var/who
who = if("[E]")
coding here
else
coding here
[/DM]
If that doesn't work, try:
[DM]
mob/proc/fight()
switch(input("Attack who?",text) in list ("[E]","[E2]"))
var/who = if("[E]")
coding here
else
coding here
[/DM]
If those don't work, then I can't help you because remember, it's been a while so I don't remember clearly. Heck, I don't even have BYOND installed on my computer since after my reformat.