ID:140383
 
Code:
mob/var/turf/encounter

mob/proc
encounter(mob/M as mob)
var/turf/encounter/T
if(prob( rand(35*(1/100),60*(1/100))))
for(T in world)
if(!T.occupied)
T.occupied = 1
M.mainx = M.x
M.mainy = M.y
M.mainz = M.z
M.encounter = T
// spawn(1)M.Move(usr.encounter)
M.battarea = M.inbattle
M.inbattle = null
// spawn()new /mob/Hollow(locate(M.encounter.x,M.encounter.y+4,M.encounter.z))
return 1
return 0


Problem description:
When I try to compile I get the following error
Battle.dm:7:error: T: undefined type: T
Battle.dm:8:error: T.occupied: undefined type: T.occupied
Battle.dm:9:error: T.occupied: undefined type: T.occupied
Battle.dm:13:error: T: undefined type: T
Battle.dm:5:warning: T: variable defined but not used


Its not suppose to be

mob/var/turf/encounter


instead it should be

turf/var/encounter

In response to Ice84 (#1)
If I do that encounter will no longer be defined and that does not help with the errors I get with T
In response to Death818728 (#2)
Maybe you could explain a bit more what you want this proc to do then someone could help you?
I tried looking at it but it's.. pretty confusing. o_O

I think he was right though.

You added a turf to a mob as a variable...but why?

turf/encounter

should be it's own type.
or really more like
turf/grass //the type of turf you step in.


when a mob steps on it, then the encounter chance is calculated. If the encounter happens then, do "attack stuff"

for that you would need to override the Entered() proc of the
turf/encounter so that everytime a mob enters the turf, there is a chance of entering a fight
In response to Dariuc (#3)
I was trying to make the proc have a random chance of getting into battle similar to a turn based, but rather than a turn based system I'd make it free combat in that battle area, but when I try to define T it keeps saying it isn't defined but the warning says it is defined but not used