ID:141528
 
Code:
mob/verb
Demon_Kill_Spell()
set category="Spells"
for(var/mob/M in say(M))
if(M.race=="Witch")
var/spellcast=input("Say the spell to destroy the demon","Demon Vanquish Spell") as text
if(spellcast=="I vanquish thee, demon")
usr.talk = 3<<"[spellcast]"
return


Ok i have spells coded in already this code is to just make it were you just click it and it says it automaticly instead of you typing. right now i got to work but when u click all it it doesnt say the spell like i want it to but it says Chris: (its as if i just hit enter and didnt type anything can someone help me out a bit?

usr.talk = 3<<"[spellcast]"

Fix whatever that line/s is/are supposed to be.
In response to Falacy
thats the thing what do i fix it to?
In response to Christopher52488
Christopher52488 wrote:
thats the thing what do i fix it to?

I dunno, what is that line supposed to be doing?
In response to Falacy
its supposed to be saying the spell that i want it to say like when i click the verb I (myself) say that spell and not type it
In response to Falacy
To be a little more specific, you're trying to do something that makes no sense; I can't even tell what the compiler would take that for, if it even compiles!

What you're trying to do is output a message, which is done with the << operator. On the left hand side of the << operator, there must be an object or list. On the right hand side, there can be either a variable or a constant (ex: a variable may be x, and a constant may be "Hi").

Additionally, brackets ( [] ) can be used to place variables inside the text string.

mob/verb/Talk(t as text)
view(world.view,src) << "[src] says: [t]


t is a text string, view() will always return a list, and I guess, in theory, the string you're outputting can be considered a variable.
In response to Christopher52488
Christopher52488 wrote:
its supposed to be saying the spell that i want it to say like when i click the verb I (myself) say that spell and not type it

Still not really sure what you want... but try this
view()<<"[usr] says: [spellcast]"
In response to Falacy
Still blank message
for(var/mob/M in say(M))
probably doesn't work unless you have a say() proc that returns a list of mobs.

if(M.race=="Witch")
is M a Witch?

var/spellcast=input("Say the spell to destroy the demon","Demon Vanquish Spell") as text
if(spellcast=="I vanquish thee, demon")
Are you typing that in exactly like that?
In response to Jeff8500
Jeff8500 wrote:
To be a little more specific, you're trying to do something that makes no sense; I can't even tell what the compiler would take that for, if it even compiles!

What you're trying to do is output a message, which is done with the << operator. On the left hand side of the << operator, there must be an object or list. On the right hand side, there can be either a variable or a constant (ex: a variable may be x, and a constant may be "Hi").

Additionally, brackets ( [] ) can be used to place variables inside the text string.

> mob/verb/Talk(t as text)
> view(world.view,src) << "[src] says: [t]
>

t is a text string, view() will always return a list, and I guess, in theory, the string you're outputting can be considered a variable.
SOrry for the edit . What im trying to really do is have it in a catagory like a tab for spells now with the code i provided is just givng blank message weres the blank message coming from and what do i do to change the blank message with a text?