ID:179805
 
Has anyone else recieved this error when trying to use Vortezz's Multi-tiled Mob Tutorial? I am doing everything that he said to do, and I was just wondering if this is a problem with his code, or mine.

error:tile2.icon:left-hand side must be an object variable

I recieved this on this line:

mob
Fighter
icon = 'fighter01.dmi'

tile2.icon = 'fighter02.dmi' // <----Here

I can show the whole thing, but I don't belive it is needed for this post...
Xooxer wrote:
mob
Fighter
icon = 'fighter01.dmi'

tile2.icon = 'fighter02.dmi' // <----Here

Hmm. That's very obscure. Lemme run this up :)

Well, I get it on my side as well.. I'm doing this:
mob
Fighter
var
obj
tile2
icon = 'fighter01.dmi'

tile2.icon = 'fighter02.dmi'

I really don't understand this. I'll have to do some debugging tomorrow.
In response to Vortezz
Try setting it at New()?

Alathon
In response to Alathon
Thanx for the suggestion, Alathon!

It works great now. I moved the New() definition Vortezz had inside the Fighter definition as so:

mob/fighter
icon = 'fighter01.dmi'

New()
tile2 = new()
tile2.icon = 'fighter02.dmi'

That way, I can have diffrent icons for the various characters... Although right now I'm simply fooling around with this, so there is only one mob...

~Happy Xoox :-)

[EDIT] Only one slight drawback... if the mob's extra tile(s) go off the edge, they are deleted. So Vortezz's demo guy would be decapitated if he took him to the top of the map. Only temporary, as the icons return once the extra tiles are back on the playing field. Nothing a little reworking shouldn't fix...
In response to Xooxer
For something like that you could try to rework Move() to support checking for it. You can do it many ways, the easiest being simply stopping people 2 turfs from the edge. If you prefer a more customizable version, try doing some checks for multiple-parts, and then make sure that the part doesnt move over the edge, mess around with locate() and you should be able to quite easily.


Or you could surround the edge by areas which cannot be passed. As I said there are many ways to do it, I hope you find one that suits your needs :)

Alathon
In response to Alathon
the only problem i`m having with this code is that my character cant move and doesnt have a head when i login, so i have to fix that somehow, otherwise, it works great, the head is always in the same dir as the body, so i basicly have better looking character icons now

thanks Vortezz
In response to Xooxer
How about making the map slightly bigger than needed and putting black tiles around the edge.