Jan 14 2002, 5:50 pm
In response to Deadron
|
|
Don't nominate him... I've already been making one. =P
|
In response to Spuzzum
|
|
ok, I need something like this for my game only its a bit more complex. I have looked at the library or demo or whatever it is for the question I'm about to ask and it realy didn't help that much.
Ok, I need a radar that is in the usr's inventory and it shows a map of the "z level" he is on,different map for a different "z level". This radar has a copy of the map and then dots for different mobs on it. Only it would have red dots for all the enemies of this usr, blue dots for all the allies of this usr, and is there a way to make it so they can only see their friend and foe on the radar if they are within 30 spaces of the usr. Oh and the radar has to show where the usr is on the map to. thanks |
In response to Lummox JR
|
|
Lummox wrote
First step: Learn to spell RADAR. You only had to say, "Rador is spelt Radar, not to be rude, just trying to help" Sorry, but that seemed like a rude comment to me. |
In response to Tapion1
|
|
Tapion1 wrote:
You only had to say, "Rador is spelt Radar, not to be rude, just trying to help" Eh. I didn't go out of the way to be polite with it. Although the capitalization could throw some people off--I capitalized it, however, because the word radar actually comes from the acronym RADAR, and so that's a more "official" form of the word. Lummox JR |
In response to DragonHeart
|
|
DragonHeart wrote:
ok, I need something like this for my game only its a bit more complex. I have looked at the library or demo or whatever it is for the question I'm about to ask and it realy didn't help that much. I'm sure you did, because I don't have it out yet! ;-) |
In response to Spuzzum
|
|
hey, A real simple one you could do is whenever a user moves run a proc that checks and sees if anyone is within 30 spaces then do a:
usr << "<beep">
that, of course, is a simple one. |
after a few days off fixxing it and lummer helping i got it working
obj/radar icon='radar.dmi' // pick whatever icon you want icon_state="radar" var/running=0 var/obj/radar_screen/screen=null verb/Radar() set src in usr if(running) usr << "You turn off the radar." if(screen) del(screen) running=0 else usr << "You turn on the radar." running=1 screen=new(null,usr) // do something here to add this to the events list spawn(5) Update() Move(newloc) .=..() // turn off radar screen if dropped or moved if(running) running=0 if(loc!=screen.owner) del(screen) proc/Update() if(screen) screen.Update() obj/radar_screen var/owner // point to the player var/rrange=15 icon='radar.dmi' screen_loc="SOUTHEAST" // southeast corner of screen New(newloc,mob/M) owner=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',"") if(rrange) for(var/mob/M in orange(rrange,owner)) var/dx=round((M.x-x)*10/rrange,1) var/dy=round((M.y-y)*10/rrange,1) var/icon/pix=new /icon('radar.dmi',"pixel") pix.Shift(EAST,dx) pix.Shift(NORTH,dy) ic.Blend(pix,ICON_OVERLAY) icon=ic spawn(5) Update() |
In response to Lummox JR
|
|
It's nice, but is there a way to extend the range of the scan? I messed with this a bit and found that it's good for detecting things close to the source, but not at any great distances...
|
In response to Xooxer
|
|
Xooxer wrote:
It's nice, but is there a way to extend the range of the scan? I messed with this a bit and found that it's good for detecting things close to the source, but not at any great distances... I'm not sure I follow you; there's an rrange variable right in there that should do the trick. Double it, and you should get double the range. Lummox JR |
In response to Lummox JR
|
|
I wouldn't be posting about it if that worked....
I set up a radar station, so the screen in the user's hud dislpays what the radar station would scan... just so you know. What happened when I changed the rrange value to 30 is the pixel moved about halfway across the icon, the suddenly disapeared... It hadn't even reached the edge of the radar screen yet. Not exactly what I was hoping for, and not what a player would expect.... ~X |
In response to Xooxer
|
|
Xooxer wrote:
I wouldn't be posting about it if that worked.... Curious. Since the code depends on orange() to work, I'd venture a guess that orange() is limited to some fundamental value, possibly to world.view. This could be intentional or it could be a bug in BYOND, but I'd say it's probably not a bug in the radar code itself. Since the radar works for nearby targets, it seems reasonable it would work for farther ones as long as they appeared in the orange() list. Lummox JR |
In response to Rollerc
|
|
Nice....entriguing...interestin....post it as a demo under demos and have sum fun already!
but please use the p.s. question: how did dantom do that? |
In response to unimatrix
|
|
unimatrix wrote:
p.s. Do what? |
In response to Nadrew
|
|
How Dantom created their own HTML tag.
|
In response to Exadv1
|
|
Tom's a cgi wizard he has his ways.
|
In response to Nadrew
|
|
Also what do you mean the radar works I pated it and nothing worked for me. The screen never appears and o yes I have the latest beta.
|
In response to Exadv1
|
|
Exadv1 wrote:
How Dantom created their own HTML tag. The thing is, it's not really HTML. The CGI script that controls the forum translates <DM> and </DM> into another tag or several tags, probably <PRE> and </PRE>. So what reaches the browser isn't precisely what you type in. Neat, huh? Lummox JR |
In response to Lummox JR
|
|
Lummox JR wrote:
Exadv1 wrote: Likely to be the CODE, PRE, and XMP tags put together to ensure that at least one works. =) |
In response to Spuzzum
|
|
and put together on these forums anyways, usally <pre> lets you use the font tag, but using it here acts just like XMP.Is just like <pre> |
In response to Lummox JR
|
|
I'd venture a guess that orange() is limited to some fundamental value, possibly to world.view. world.view*2, actually. Its pretty easy to make an extended version using block() however, which I had to do, coincidently, while creating a radar. -AbyssDragon |