ID:261281
 
In my RPG I want to be able to summon monsters to attack the monsters the person is fighting. I've come up with this;

mob
verb
Summon()
usr << "You call Myst!"
spawn() Myst()

mob
proc
Myst()
var/q = locate(usr.x+1,usr.y,usr.z)
/obj/Myst = q

obj
Myst
icon = 'Myst.dmi'

And this error pops up;

verbs.dm:171:error:/obj/Myst:bad variable

What am I doing wrong?

=The Bearded One=
var/q = locate(usr.x+1,usr.y,usr.z)
/obj/Myst = q

verbs.dm:171:error:/obj/Myst:bad variable

What am I doing wrong?

You're not creating a new Myst :). Also, if I'm not mistaken, it might be good to make Myst a mob so you can get all the mob procs like step() and what-not, though I don't know exactly how you're working things; it's only a suggestion!

Anyhow, solve this problem by using new() like so:
var/q = locate(x + 1,y,z) //set where it's placed
new /obj/Myst(q) //and place it!


Also, our buddy Myst won't do any attacking, unless you program that in, remember! :)
Ummm you have your variable assignment for q backwards.
Try var/obj/Myst/q = new(locate(usr.x+1,usr.y,usr.z))

-James
In response to Vortezz
Thank you Vortezz. Is there anyway to have it generate a bmp to "summon"? I made a bmp, but it shrank to fit into one tile, I can cut it up just fine, but for future reference I would like to know how to do this, if it's even possible.

=The Bearded One=
In response to I Have A Beard
I don't think you can use bmps as moving objs or mobs.
In response to Nadrew
So, can I if I don't want it to move?
In response to I Have A Beard
I don't even think you can make a mob a bmp.
In response to Nadrew
Oh, okay, guess I'll just have to cut up the image.

Now, how do I delete Myst after a certain amount of time? I tried using the same vars, then instead of locating the body parts, I tried deleting them, with del(h) or whatever, but I got a runtime error.
In response to I Have A Beard
You would have to loop though all of the parts using for() and delete them one by one.
In response to Nadrew
I don't understand what you're saying Nadrew. I looked up the for(), and here's what I came up with;

mob
proc
SumMyst()
var/h = locate(x,y + 1,z) new /obj/MystHead(h)
DelMyst()
var/r = (/obj/MystHead)
//Error Line for(r [as /obj/MystHead][inList])
del(r)
I get these two errors;

error: expected as(...)
error: ]: expected )