ADMIN UPDATE

- You can now set the dir and name variables for newly spawned objects, turfs or mobs in the game-panel menu.
- Dirs are:
  - 1: north
  - 2: south
  - 4: east
  - 8: west
  For the rest:
  - northeast = north + east = 1 + 4 = 5

legal values: 1, 2, 4, 8, 5, 6, 9, 10

Leave the name space blank to keep the default name. 

If you assign a custom name for a mob, it will also be set as the real_name, meaning it will stick.

Coder note:
Names and dirs are both assigned after initialization, so they're not respected during New()

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1933 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2011-07-26 18:28:42 +00:00
parent 06d5c4f7cd
commit 7769420e4c
2 changed files with 25 additions and 5 deletions

View File

@@ -874,7 +874,7 @@ var/showadminmessages = 1
if (!paths)
return
else if (length(paths) > 5)
alert("Select less object types, jerko.")
alert("Select less object types, (max 5)")
return
else if (length(removed_paths))
alert("Removed:\n" + dd_list2text(removed_paths, "\n"))
@@ -884,17 +884,36 @@ var/showadminmessages = 1
var/X = offset.len > 0 ? text2num(offset[1]) : 0
var/Y = offset.len > 1 ? text2num(offset[2]) : 0
var/Z = offset.len > 2 ? text2num(offset[3]) : 0
var/tmp_dir = href_list["object_dir"]
var/obj_dir = tmp_dir ? text2num(tmp_dir) : 2
if(!obj_dir || !(obj_dir in list(1,2,4,8,5,6,9,10)))
obj_dir = 2
var/obj_name = sanitize(href_list["object_name"])
for (var/i = 1 to number)
switch (href_list["offset_type"])
if ("absolute")
for (var/path in paths)
new path(locate(0 + X,0 + Y,0 + Z))
var/atom/O = new path(locate(0 + X,0 + Y,0 + Z))
if(O)
O.dir = obj_dir
if(obj_name)
O.name = obj_name
if(istype(O,/mob))
var/mob/M = O
M.real_name = obj_name
if ("relative")
if (loc)
for (var/path in paths)
new path(locate(loc.x + X,loc.y + Y,loc.z + Z))
var/atom/O = new path(locate(loc.x + X,loc.y + Y,loc.z + Z))
if(O)
O.dir = obj_dir
if(obj_name)
O.name = obj_name
if(istype(O,/mob))
var/mob/M = O
M.real_name = obj_name
else
return