if("Legend")
if(prob(100.00))
character = new /mob/Pokemon/Diagla()
character.overlays += new /obj/diaglas
character.overlays += new /obj/diaglane
character.overlays += new /obj/diaglan
character.overlays += new /obj/diaglanw
character.overlays += new /obj/diaglasw
character.name = charactername
src.client.mob = character
mob/Pokemon/Diagla
icon = 'diagla.dmi'
icon_state = ""
obj/diaglan
icon = 'diagla.dmi'
icon_state = "n"
obj/diaglas
icon = 'diagla.dmi'
icon_state = "s"
obj/diaglaw
icon = 'diagla.dmi'
icon_state = "w"
obj/diaglae
icon = 'diagla.dmi'
icon_state = "e"
obj/diaglase
icon = 'diagla.dmi'
icon_state = "se"
obj/diaglasw
icon = 'diagla.dmi'
icon_state = "sw"
obj/diaglanw
icon = 'diagla.dmi'
icon_state = "nw"
obj/diaglane
icon = 'diagla.dmi'
icon_state = "ne"
ID:160515
Aug 28 2008, 1:10 pm
|
|
Aug 28 2008, 1:12 pm
|
|
Yeah. You're going to need to tells a bit more than that. Like, what's the problem? What should it do? Just posting a code snippet isn't very helpful. :P
|
In response to Xooxer
|
|
Not sure if it uses x or y or 0,0 or where to put them or i should just make a new code
. They all lay on 1 tile. |
In response to Sapphir
|
|
North would be y+1
South would be y-1 East is x+1 and West is x-1 If you want to find the southeast tile, combine the above and do y-1 and x+1. I think that's what you mean. |
In response to Xooxer
|
|
Xooxer wrote:
North would be y+1here my new code with errors and warings. Can you edit my code for me.
character.overlays y+1= new /obj/diaglan
login.dm:29:+ :warning: statement has no effect login.dm:29:error::bad assignment login.dm:29:character :warning: unused label login.dm:29:overlays :warning: unused label |
In response to Sapphir
|
|
Sorry for asking.
|
In response to Sapphir
|
|
Ok, let's look this over a sec.
Here, you're asking BYOND to make a new character, but you never tell it where to put it. In the () at the end, you need to put a turf location to tell BYOND where to make this new character. Let's say you want to place the character at the x,y,z location 10,15,1. That's 10 steps from the left edge, and 15 steps from the bottom edge of the map on the first z level (z levels are like separate layers on the map where you can put stuff, you probably only have one z level. It's like using multiple maps, but having them stacked on top of each other in one file.). So let's change this to make the character appear where we have chosen:
> character = new /mob/Pokemon/Diagla(locate(10,15,1))
We use the locate() proc to find a turf using the number coordinates we chose above, 10, 15, 1. This gives the new() proc a location, so it knows where to make this new character. Now that we have placed the character on the map, let's add the overlays. But, before I get to adding the overlays, let's look at these objects you've defined. > obj/diaglan Here is the north overlay object. If you want this overlay to be one tile above the object it's overlaid on, you need to set its pixel_y variable to 32. This will move the overlay 32 pixels north, or one full tile north. Let's do that now. > obj/diaglan Now when you make a new instance of this object, its image will appear to be one tile north of its location. Now let's add this overlay to the character we made earlier, and see what happens:
You'll notice something different here. I didn't pass a location to the new() proc to tell BYOND where to place this object. That's because we don't want the object on the map, we just want its picture in the overlays of the character. Since we do that by adding the object to the overlays list, the location of the object can be null. Now that this overlay is working, it should be simple for you to code the rest. Just use my previous post as a guide for setting the pixel_x and pixel_y variables of the overlay objects. if you want to move 1 tile east, pixel_x = 32. One tile south, pixel_y = -32. If you want to move one tile northwest, pixel_x = -32 and pixel_y = 32. Hope this helps. |
In response to Xooxer
|
|
Thanks for helping me, i'll try these codes.
|
In response to Sapphir
|
|
thanks they work.
|
In response to Sapphir
|
|
You're welcome. Glad I could help.
|
Sapphir wrote:
|
In response to Opop1
|
|
thts not gonna work you defined it in icon state
there a whole bunch of codes that com with it. |
In response to Sapphir
|
|
well what i was meaning is u shuld change the code up to something a lil more simple using the whole 0,0 deal
|
In response to Opop1
|
|
I rather not. I think s,e,w,n,nw,ne,sw, and se better.
|
In response to Sapphir
|
|
Ok well wood luck
|