ID:149686
 
ok i used the demo and it makes the mob correctly but every other one in the game gives me problems when running the game. This is the errors i get


the bunnyg (/mob/bunnyg): Move(the sfloor (6,11,5) (/turf/sfloor), 1)
runtime error: Cannot modify null.loc.
proc name: Move (/mob/Move)
source file: main.dm,199
usr: the bunnyg (/mob/bunnyg)
src: the bunnyg (/mob/bunnyg)
call stack:
the bunnyg (/mob/bunnyg): Move(the sfloor (18,9,5) (/turf/sfloor), 6)
runtime error: Cannot modify null.loc.
proc name: Move (/mob/Move)
source file: main.dm,199
usr: Aquashnor (/mob/monsters/Aquashnor)
src: Aquashnor (/mob/monsters/Aquashnor)
call stack:
Aquashnor (/mob/monsters/Aquashnor): Move(the grass (9,7,2) (/turf/grass), 10)
runtime error: Cannot modify null.loc.
proc name: Move (/mob/Move)
source file: main.dm,199
usr: Bum (/mob/monsters/Bum)
src: Bum (/mob/monsters/Bum)
call stack:
Bum (/mob/monsters/Bum): Move(the grass (16,8,2) (/turf/grass), 8)




and this is the coding for the multi tiled part




mob

var

obj/gm2

top

movetimer





Move(Loc)

// delay movement

if(world.time < movetimer) return

movetimer = world.time + 1

..()



var/turf/T = locate(x,y + 1,z)

if(T)

top.loc = T

else

top.loc = null





New(Loc)

..()

top = new()
Don't you just love the new byond version backwards compatibility? If you had the exact same build as he had when he made it, I know it would work (unless you modified it) :) I'm sure you'll have to go through the lib and change some of the code around to make byond happy.

Edit:
It seems that since you keep getting null.loc errors, you need to add checks to see if the mob exists before doing things to it. I don't understand why byond calls some things with null parimiters, but who knows. Just a pointer :)

Edit:
Ahahah after reading that, I see it's getting those errors IN the mob proc... I guess even IN the mob's procs you have to check for mobs... retarded ~(:B)
In response to Dreq
Oh, and please put your code between <dm> </dm> tags ;)
It would be very helpful if you could show us which line is 199.

I suspect your trouble is that Vortezz's demo assumes all mobs in the world are two tile mobs and overides the base mob/Move() proc. Since your other mobs do not have a top, it is returning errors when you try to relocate it.

To fix it, define a special two-tile subclass of mobs and only override Move() for that subclass.
In response to Dreq
Dreq wrote:
Don't you just love the new byond version backwards compatibility? If you had the exact same build as he had when he made it, I know it would work (unless you modified it) :) I'm sure you'll have to go through the lib and change some of the code around to make byond happy.

You know this? Interesting. I think that if you read the post a little more carefully, you would see that DS doesn't like the fact that the code is trying to modify null.loc. DS has never liked that.


Edit:
It seems that since you keep getting null.loc errors, you need to add checks to see if the mob exists before doing things to it. I don't understand why byond calls some things with null parimiters, but who knows. Just a pointer :)

Edit:
Ahahah after reading that, I see it's getting those errors IN the mob proc... I guess even IN the mob's procs you have to check for mobs... retarded ~(:B)

WOW. That is one of the ugliest jumps in logic I have seen in a good while. If the log is complaining about null.loc, the mob must not be there, and therefore BYOND is dumb since this is called from a mob proc. However, the problem is that the proc seems to be looking for a non-src mob IE a var/mob. This is the problem (as Shadowdarke's post pointed out). Error checking or simply defining a new sub group (say mob/big) would probably fix this.

-James
In response to Jmurph
Well that's still exactily what I told him, just add an if(themob) (then whatever)
In response to Dreq
ok i fixed the old one now i have my two tiled mob set up and i can walk and everything is fine but once i log out and then come back in, it deletes the top and i cant move at all. But i have absolutely no idea how to fix this since i have not made anything to affect a user when loging in or out, i just used the character saving demo. So what would i need to do to fix this problem?
In response to Netshark010101
hey has anyone seen my previous problem???? Plus i got a new one, i just finished adding the different dirrections for its walking movement but only the bottom faces the right direction and does the animation how do i make the top one move as well
In response to Netshark010101
man no one knows how to fix these 2 problems? this bites, cuz the sprite that i made is awesome, if only i could get it to work