Xooxer i got your radar working but when i downloaded the new beta byond it got mest up again heres the errors
New Gundam Game.dm:114:error:usr.hud:undefined proc
New Gundam Game.dm:138:error:M:undefined type: M
New Gundam Game.dm:139:error:M.x:undefined type: M.x
New Gundam Game.dm:140:error:M.y:undefined type: M.y
New Gundam Game.dm:145:error:M:undefined type: M
New Gundam Game.dm:146:error:M.x:undefined type: M.x
New Gundam Game.dm:147:error:M.y:undefined type: M.y
New Gundam Game.dm:152:error:M:undefined type: M
New Gundam Game.dm:153:error:M.x:undefined type: M.x
New Gundam Game.dm:154:error:M.y:undefined type: M.y
New Gundam Game.dm:159:error:M:undefined type: M
New Gundam Game.dm:160:error:M.x:undefined type: M.x
New Gundam Game.dm:161:error:M.y:undefined type: M.y
New Gundam Game.dm:138:M :warning: variable defined but not used
New Gundam Game.dm:145:M :warning: variable defined but not used
New Gundam Game.dm:152:M :warning: variable defined but not used
New Gundam Game.dm:159:M :warning: variable defined but not used
been trin for days to fix it
ID:149827
Feb 11 2002, 1:36 pm
|
|
In response to Xooxer
|
|
will im having one hard time fixxing it will M = mob so why isent it reading M ?? heres my code ii used
obj/radar/red icon='bases.dmi' // pick whatever icon you want icon_state="red_comm" var/obj/radar_screen/screen = null Click() if(usr:running) return screen=new(null,usr) usr.hud() usr:running = 1 // do something here to add this to the events list spawn(5) Update() proc/Update() if(screen) screen.Update() obj/radar_screen var/rrange=30 icon='radar.dmi' layer = MOB_LAYER + 2 icon_state = "" screen_loc = "14,1" New(newloc,mob/M) if(M.client) M.client.screen+=src Move() return proc/Update() // call this via an event loop var/icon/ic=new /icon('radar.dmi',"") var/obj/radar/red/RR = locate() if(rrange) for(var/mob/red/M in o_range(rrange,RR)) var/dx=round((M.x-RR.x)*10/rrange,1) var/dy=round((M.y-RR.y)*10/rrange,1) var/icon/pix=new /icon('radar.dmi',"red_pixel") pix.Shift(EAST,dx) pix.Shift(NORTH,dy) ic.Blend(pix,ICON_OVERLAY) for(var/mob/green/M in o_range(rrange,RR)) var/dx=round((M.x-RR.x)*10/rrange,1) var/dy=round((M.y-RR.y)*10/rrange,1) var/icon/pix=new /icon('radar.dmi',"green_pixel") pix.Shift(EAST,dx) pix.Shift(NORTH,dy) ic.Blend(pix,ICON_OVERLAY) for(var/mob/blue/M in o_range(rrange,RR)) var/dx=round((M.x-RR.x)*10/rrange,1) var/dy=round((M.y-RR.y)*10/rrange,1) var/icon/pix=new /icon('radar.dmi',"blue_pixel") pix.Shift(EAST,dx) pix.Shift(NORTH,dy) ic.Blend(pix,ICON_OVERLAY) for(var/mob/black/M in o_range(rrange,RR)) var/dx=round((M.x-RR.x)*10/rrange,1) var/dy=round((M.y-RR.y)*10/rrange,1) var/icon/pix=new /icon('radar.dmi',"black_pixel") pix.Shift(EAST,dx) pix.Shift(NORTH,dy) ic.Blend(pix,ICON_OVERLAY) icon=ic spawn(5) Update() proc/o_range(var/range as num,var/atom/center) var/start_x = center.x - range var/start_y = center.y - range var/end_x = center.x + range var/end_y = center.y + range if(start_x < 1) start_x = 1 if(start_y < 1) start_y = 1 if(end_x > 100) end_x = 100 if(end_y > 100) end_y = 100 var/turfs[] = block(locate(start_x,start_y,center.z),locate(end_x,end_y,ce nter.z)) var/contents[] = list() var/turf/T for(T in turfs) contents += T.contents return contents |
In response to Rollerc
|
|
Rollerc wrote:
will im having one hard time fixxing it will M = mob so why isent it reading M ?? heres my code ii used Well, I'm pretty sure the problem lies in the fact that you have no colored mobs, (mob/red, mob/blue, mob/green, mob/black) such as were referenced to previously in this code snipet. I have removed the reference, in exchange for a plain ol' mob. This should display a dot for each mob in rrange no matter what the mob is. If that's still not working, I would suggest you read over the thread this code came from, as the inner workings of this technique is better explained in there. And it might not hurt to go through the reference, FAQ, and Guide some more.... I find myself pawing through those fine works when I'm stumped. :P ~X |
In response to Xooxer
|
|
DUH! wha am I thinking i dont have a mob called red,black,green sorry man will only error im geting now is this
radar.dm:9:error:usr.hud:undefined proc i took it out and thare was no errors i just want to know if i need it |
In response to Rollerc
|
|
You should not need usr.hud(), unless you have a proc defined under you player's mob called hud(). I used it to bring up the Heads Up Display (hud) if the player clicked the radar station, becuase my radar screen is located in the HUD. If you have no HUD, then there should be no reason to call this proc.
~X |
This proc is not defined in your code, I used it to bring up the Heads Up Display (HUD) if it wasn't already up becuase that's where I display my radar screen. I believe you can remove it with no problems...
These errors are cuased by M not being defined before you try using it. I would have to see what you're code looks like now to be of furthur assistance. This is probably also why you are getting the errors below.
I posted that code, not to have it put straight into your game as is, but to be modified to fit within your code. Some things would have to be changed, renamed, or removed for it to function properly within your game.
~X