ID:144433
 
Code:
mob
master
icon = 'mobs.dmi'
icon_state = "master"
verb
Talk()
mob/other/choosing_character/proc/CreateNewCharacter()
set src in oview(1)
set category = "Communcation"
var/prompt_title = "Character Creation"
var/help_text = "Hello, I am Master Dids. Owner of this world, I am the air you breathe, the ground you feel. I have beckoned you here today as I felt your urge to join us on our journey and start your own. Okay lets begin. What is your name?"
var/default_value = ""
alert("char_name = input(src, help_text, prompt_title, default_value) as null|text")</b>


Problem description: mobs.dm:1723:prompt_title :warning: variable defined but not used
mobs.dm:1724:help_text :warning: variable defined but not used
mobs.dm:1725:default_value :warning: variable defined but not used

Im quite new to coding and the way i learn is by doing stuff like this... can someone explain why it refuses to work?


DidsKing wrote:
Code:
> mob
> master
> icon = 'mobs.dmi'
> icon_state = "master"
> verb
> Talk()

> mob/other/choosing_character/proc/CreateNewCharacter()
> set src in oview(1)
> set category = "Communcation"
> var/prompt_title = "Character Creation"
> var/help_text = "Hello, I am Master Dids. Owner of this world, I am the air you breathe, the ground you feel. I have beckoned you here today as I felt your urge to join us on our journey and start your own. Okay lets begin. What is your name?"
> var/default_value = ""
> alert("char_name = input(src, help_text, prompt_title, default_value) as null|text")</b>
>


First, off you can't put another mob inside another mob. Like, you did.

Second, this part here:

mob/other/choosing_character/proc/CreateNewCharacter()
set src in oview(1)
set category = "Communcation"
var/prompt_title = "Character Creation"
var/help_text = "Hello, I am Master Dids. Owner of this world, I am the air you breathe, the ground you feel. I have beckoned you here today as I felt your urge to join us on our journey and start your own. Okay lets begin. What is your name?"
var/default_value = ""
alert("char_name = input(src, help_text, prompt_title, default_value) as null|text")</b>


Is part of a login system of your code. For, when new players create new characters.

And, third is you can't end an alert with HTML or have any HTML in it.
Simply put, you aren't using any of the variables you are defining within that verb. This is because you have used a text string within an alert that contains the variables. Not only that, but you don't use alert() like that.

mob
master
icon = 'mobs.dmi'
icon_state = "master"
verb
Talk()
mob/other/choosing_character/proc/CreateNewCharacter()
set src in oview(1)
set category = "Communcation"
var/prompt_title = "Character Creation"
var/help_text = "Hello, I am Master Dids. Owner of this world, I am the air you breathe, the ground you feel. I have beckoned you here today as I felt your urge to join us on our journey and start your own. Okay lets begin. What is your name?"
var/default_value = ""
char_name = input(src, help_text, prompt_title, default_value) as null|text


In response to CaptFalcon33035
okay thanks you guys... btw that code came up with a new error sort of the same type of error though.

mobs.dm:1726:error:char_name:undefined var

does that mean i have to define the var somewere else?
In response to DidsKing
DidsKing wrote:
okay thanks you guys... btw that code came up with a new error sort of the same type of error though.

mobs.dm:1726:error:char_name:undefined var

does that mean i have to define the var somewere else?

Depending on what you need it for.
In response to Quest Industries
change that to,
do
src.name = input(src, help_text, prompt_title, default_value) as null|text
while(!src.name)
Correct answer: read the DM Guide.
In response to DidsKing
That means you're using the zeta source code.