ID:266634
 
spell
setRune
name = "Set Rune"
cost = 300
target = "Self"
use(var/mob/M)
if(..() == 0) return 0
world << "testing"
var/rune/R = new /rune (M.x,M.y,M.z)
world << "testing"
R.setOwner(M)
world << "testing"
var/spell/S = input(M,"Select a spell to arm the rune with.","Arm Rune") in M.spellbook.spells + ""
world << "testing"
R.spell = new S.type (null)
world << "testing"

use() in DS outputs:
testing
testing
testing
testing
testing

So why does it not make a rune OR come up with an input to arm it? There is no compiler or run-time error.

-Lord of Water
Looks like you're trying to place a datum on the map. You can't do that.. only atoms are allowed.

-AbyssDragon
In response to AbyssDragon
Oops, I forgot to mention that /rune's parent_type is obj. I'll show the /rune datum description:
rune
parent_type = /obj
layer = TURF_LAYER+1
density = 1
icon = 'Magic.dmi'
icon_state = "Rune"
var
spell/spell
list/neutrals = list()
setSrc = 0 in 0 to 1
client/owner
New()
..()
if(!density) density = 1
name = realname
Move()
return setSrc
proc
setOwner(var/owned)
owner = owned
setSrc = 1
neutrals.Add(owner)
Bumped(var/mob/M)
if(spell == null)
density = 0
step(M,get_dir(M,src))
del src
if(M.key in neutrals || M.realname in neutrals)
else
spell.use(M)
owner << "<small>Rune snared by [M] (<a href='?view?params:x=[src.x];y=[src.y];z=[src.z];'>View</a>)"
density = 0
step(M,get_dir(M,src))
del src


I hope this helps!
In response to Lord of Water
There may be a bug then. BYOND might be thinking it's a datium anyway. Just to be sure, after you create a new rune, output its coordinates to see if it was not placed at all or if something more insidious is going on.

-AbyssDragon
In response to AbyssDragon
Evidently, the rune is being created after all: I put
world << src.x
world << src.y
world << src.z
In rune/New() and it outputted
0
0
0
So, there is something not going right.

[Edit]
Here's the definition of M in spell/setRune:

if(lowertext(S.target) != "self") M = input("Choose Target","Cast [S.name]") as mob in view()
else M = mob
S.use(M)

This is part of a client proc, so 'mob' will be the client's mob.

-Lord of Water
In response to Lord of Water
You have a line that reads:

var/rune/R = new /rune (M.x,M.y,M.z)

shouldn't it be:

var/rune/R = new /rune (locate(M.x,M.y,M.z))
In response to Kevin Kitsune
Kevin Kitsune wrote:
You have a line that reads:

var/rune/R = new /rune (M.x,M.y,M.z)

shouldn't it be:

var/rune/R = new /rune (locate(M.x,M.y,M.z))

Yes. Yes, it should. Good job! I'm impressed :)

I just felt like saying that. ;)

=V
In response to Vortezz
Let me try that... I tend to forget to put locate() where it goes. I should have thought of it already. Thanks!

[Edit]
Okay, my rune sets correctly. However, it does not bring up the prompt to choose a spell to put in it. Any idea why?
In response to Lord of Water
Lord of Water wrote:
Okay, my rune sets correctly. However, it does not bring up the prompt to choose a spell to put in it. Any idea why?

var/spell/S = input(M,"Select a spell to arm the rune with.","Arm Rune") in M.spellbook.spells + ""

If M.spellbook.spells is empty, input will select the only choice available without prompting M.
In response to Shadowdarke
So, would

var/spell/S = input(usr,"Select a spell to arm the rune with.","Arm Rune") in M.spellbook.spells + "" + ""

work any better? It does not solve the problem, still. And, since setRune is being used, usr.spellbook.spells certianly has at least 1 spell in it.

-LoW, still baffled.