ID:1612847
 
(See the best response by Ter13.)
Code:
turf/dirt
Entered(A)
var/encounterchance=100 // 5% seems to be best
if(ismob(A))
var/mob/M=A
if(M.client)
if(prob(encounterchance))
M.battlecave = maps.copy(2)
M.loc = locate(12, 9, M.battlecave.z)
M << "HI"
mob
Stat()
stat("loc", "[x], [y], [z]")
var
Map/battlecave


Problem description:

So the above is a combo of two codes, both of which work just fine on their own, but when combined give me this when I try to run it:

loading The After Zone.dme
loading LoginMenu.dmf
battlecode.dm:10:error: naps.copy: undefined var
Turfsnstuff.dm:12:error: m.loc: undefined type: m.loc
battlecode.dm:10:error: M.battlecave: undefined var
battlecode.dm:11:error: M.battlecave.z: undefined var
battlecode.dm:9:warning: battlecave: variable defined but not used
The After Zone.dmb - 4 errors, 1 warning


I have been fiddling with this code for almost twelve hours with NO luck. I'm trying to get it to basically have you walk around in the dirt turf, and randomly youll encounter a point where it teleports you to a new z level map which is a copy of a dungeon on a different Z level. Again both codes work on their own seperate, but when combined like that, they spaz right out. It probably some really silly mistake, but could someone please help me get this code to work?
Is maps defined on the /turf? Do you have a new instance generated when you copy()?

What is the library you are using to make the dynamic maps?
The errors you are showing don't correspond to the code you have shown. Please try again.
What do you mean the errors don't correspond to the code? thats the code thats causing problems.

And maps defined on turf? its supposed to create a new z level copy of another z level, so im not sure? what do you mean by the library?
Best response
"naps.copy".

There's no "naps" variable in your code.

Second, it's saying M's type is undefined, which clearly can't be the case because M in your snippet is a built-in type.

Therefore, either you have mucked with #define a bit too hard, or your errors don't point to the code you are showing.
oh yeah i fixed the naps thing. And I havent defined anything yet and the errors definantly point to this code. Do I need to #define?
In response to Darklady5
Darklady5 wrote:
What do you mean the errors don't correspond to the code? thats the code thats causing problems.

And maps defined on turf? its supposed to create a new z level copy of another z level, so im not sure? what do you mean by the library?

What I mean what code/source are you using which allows the map to be copied?

To my knowledge, there isn't any built-in procedures to copy a new Z layer; you would need to make your own to do it or have a library (someone else's premade code to give you that function with little/no editing required) like SwapMaps
In response to Darklady5
Darklady5 wrote:
oh yeah i fixed the naps thing. And I havent defined anything yet and the errors definantly point to this code. Do I need to #define?

Show us an up-to-date error log, please. The out of date error log isn't going to help us help you.