mob
ship
icon = 'ship.dmi'
icon_state = "ship1"
walk (mob,WEST,4)
error:mob:duplicate definition
error:WEST:duplicate definition
error:WEST:duplicate definition/dm>
I don't know how to fix this so could some one please help me? thank you!
~Starwarspower~
ID:175367
May 1 2003, 11:39 am
|
|
I need a mob to constantly move across the screen at lag =4. I tried using the walk proc, but since i'm not that good of a coder, it wouldn't work :(. Here is what I tried to do. Can anyone see whats wrong?
|
May 1 2003, 11:45 am
|
|
Things like this can't be placed in the object definition. If you want something to be executed when the object is created, put it inside the New() proc. Don't forget that if New() doesn't return (it automatically returns when it reaches the end), then you will be unable to create a reference to a new object of that type, so putting a while() loop inside New() without spawn()ing it off is a bad idea.
|
In response to Garthor
|
|
I tried making it in a new proc but it still didn't work( a different reason this time though)lol.
I bet I did something totally screwy so you can laugh at me all you want when you se how I messed up, but this is now what I wrote. mob I still can't seem to get it right... Please help? Thanks! ~Starwarspower~ |
In response to Starwarspower
|
|
Here, call it like this -->
mob/ship{icon = 'ship.dmi';icon_state = "ship1"} mob/proc/ShipThang(){walk(ship,WEST,4)} mob/New(){src.ShipThang()} ..() |
In response to Branks
|
|
I don't know if this has been answered correctly.. so I'm gonna give it a shot. I think, think this should work:
mob sorry about the one line that should be two lines... Try that, ~Aleis~ |
In response to Starwarspower
|
|
Wow, a lot of bad (or vague) advice in this thread.
Firstly, you're not giving the icon 'ship.dmi' to /mob/ship, you're giving it to ALL mobs. Check your indentation. Secondly, that's not how you call a proc, that's how you define it. You need New(). <code>mob ship New() walk(src,WEST,4) //Walks src (the ship) west with 4 ticks between each step</code> |
In response to Aleis
|
|
Thank you everybody who told me what to do... ill try all of them and then use the one i think works best... if any work :)
Thanks ~Starwarspower |