Ok.. when the battle starts I want to lay
/turf/BattleAreana/Up
/turf/BattleAreana/Down
/turf/BattleAreana/Left
/turf/BattleAreana/Right
so whree it creates an areana around the people battleing
The up shuld be 1 space from the src
The down should be 1 space down the src
left should be 2 spaces left from src
right shuold be 4 spaces right from src
so where it creates like a areana, but what would be the cords, and how would I delete / create them?
ID:268145
Mar 24 2004, 9:10 am
|
|
In response to sapphiremagus
|
|
ok thanks.
|
In response to sapphiremagus
|
|
When I create the object, nothing happons.
new /mob/BattleAreana/Right(src.x+1,src.y,src.z) (note: when I did it with a var it caused errors, so im just goign to delete them with) for(var/mob/BattleArena/M in view(4)) (4 being the length of the battle field. |
That being said, x y and z are all numeric values. That is to say that thay are either null or 0, or some number from 1 to the max value of the map.
With that knowledge, how do you suppose you find the coordinates for an object to the right of another object?
Keep in mind that values increase from left to right, and from down to up, such that the lower left of the map is 1,1,zlevel.
So, with that in mind, seems that to the right of the player would be a positive x increase, right? Does the y value change at all? Are we going up or down? No? Ok, then the y value stays the same. What about z? Are we changing map levels? No? Ok then, z value stays the same. Lets look at this a little closer:
Let's say that src has an x value of 5, a y value of 3 and a z value of 1.
x = 5
y = 3
z = 1
We'll call the new object nobj. What are nobj's coordinates? According to above, they are :
x = src.x+1
y = src.y
z = src.z
Now we'll talk about our friend, locate(). Locate can take a set of coordinates and return the location.
Replace objpath with whatever type path you're working with (ie: /turf/BattleArena/Right.
And you're done. You now have a new <insert object here> sitting at 6,3,1. To delete this obj, just use del right, or right.Del().
I didn't directly answer the question, but I did give you enough information that you should be able to work it out on your own. Try it. If you still have trouble, come see us again and I'll be a little more direct.