-Holograms can move around again. I'm also experimenting with them being area based, meaning they can move around an area freely and lose their hologram when they leave the area. I've made it a const option, so change HOLOPAD_MODE to 0 to return it to the old system, which will destroy the hologram when it is out of range of the holopad.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4633 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-09-06 02:33:30 +00:00
parent 46524c533a
commit db2d703f72
4 changed files with 41 additions and 4 deletions

View File

@@ -330,6 +330,7 @@
icon_state = "holopad0" icon_state = "holopad0"
var/mob/living/silicon/ai/master//Which AI, if any, is controlling the object? Only one AI may control a hologram at any time. var/mob/living/silicon/ai/master//Which AI, if any, is controlling the object? Only one AI may control a hologram at any time.
var/last_request = 0 //to prevent request spam. ~Carn var/last_request = 0 //to prevent request spam. ~Carn
var/holo_range = 5 // Change to change how far the AI can move away from the holopad before deactivating.
/obj/machinery/hologram/projector /obj/machinery/hologram/projector
name = "hologram projector" name = "hologram projector"

View File

@@ -12,6 +12,12 @@ Possible to do for anyone motivated enough:
Itegrate EMP effect to disable the unit. Itegrate EMP effect to disable the unit.
*/ */
// HOLOPAD MODE
// 0 = RANGE BASED
// 1 = AREA BASED
var/const/HOLOPAD_MODE = 1
/obj/machinery/hologram/holopad/attack_hand(var/mob/living/carbon/human/user) //Carn: Hologram requests. /obj/machinery/hologram/holopad/attack_hand(var/mob/living/carbon/human/user) //Carn: Hologram requests.
if(!istype(user)) if(!istype(user))
return return
@@ -72,7 +78,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
hologram.mouse_opacity = 0//So you can't click on it. hologram.mouse_opacity = 0//So you can't click on it.
hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them. hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them.
hologram.anchored = 1//So space wind cannot drag it. hologram.anchored = 1//So space wind cannot drag it.
hologram.name = "AI hologram"//If someone decides to right click. hologram.name = "[A.name] (Hologram)"//If someone decides to right click.
hologram.SetLuminosity(2) //hologram lighting hologram.SetLuminosity(2) //hologram lighting
SetLuminosity(2) //pad lighting SetLuminosity(2) //pad lighting
icon_state = "holopad1" icon_state = "holopad1"
@@ -94,12 +100,28 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
/obj/machinery/hologram/holopad/process() /obj/machinery/hologram/holopad/process()
if(hologram)//If there is a hologram. if(hologram)//If there is a hologram.
if(master && !master.stat && master.client && master.eyeobj.loc == src.loc)//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector. if(master && !master.stat && master.client && master.eyeobj)//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector.
if(!(stat & NOPOWER))//If the machine has power. if(!(stat & NOPOWER))//If the machine has power.
if((HOLOPAD_MODE == 0 && (get_dist(master.eyeobj, src) <= holo_range)))
return 1 return 1
else if (HOLOPAD_MODE == 1)
var/area/holo_area = get_area(src)
var/area/eye_area = get_area(master.eyeobj)
if(eye_area in holo_area.master.related)
return 1
clear_holo()//If not, we want to get rid of the hologram. clear_holo()//If not, we want to get rid of the hologram.
return 1 return 1
/obj/machinery/hologram/holopad/proc/move_hologram()
if(hologram)
step_to(hologram, master.eyeobj) // So it turns.
hologram.loc = get_turf(master.eyeobj)
return 1
/obj/machinery/hologram/power_change() /obj/machinery/hologram/power_change()
if (powered()) if (powered())
stat &= ~NOPOWER stat &= ~NOPOWER

View File

@@ -10,6 +10,7 @@
var/mob/living/silicon/ai/ai = null var/mob/living/silicon/ai/ai = null
density = 0 density = 0
nodamage = 1 // You can't damage it. nodamage = 1 // You can't damage it.
mouse_opacity = 0
// Movement code. Returns 0 to stop air movement from moving it. // Movement code. Returns 0 to stop air movement from moving it.
/mob/aiEye/Move() /mob/aiEye/Move()
@@ -41,6 +42,11 @@
if(ai) if(ai)
if(ai.client) if(ai.client)
ai.client.eye = src ai.client.eye = src
//Holopad
if(istype(ai.current, /obj/machinery/hologram/holopad))
var/obj/machinery/hologram/holopad/H = ai.current
H.move_hologram()
// AI MOVEMENT // AI MOVEMENT

View File

@@ -49,6 +49,15 @@ should be listed in the changelog upon commit tho. Thanks. -->
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here --> <!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
<div class="commit sansserif">
<h2 class="date">6 September 2012</h2>
<h3 class="author">Giacom updated:</h3>
<ul class="changes bgimages16">
<li class="rscadd">AIs can now move around their holograms. I am also experimenting by making them area dependant, instead of depending on the range between the holopad and the hologram.</li>
<li class="tweak">Removed cameras from bots. They weren't working well with freelook and I felt that since they weren't used at all, they wouldn't be missed.</li>
</ul>
</div>
<div class="commit sansserif"> <div class="commit sansserif">
<h2 class="date">3 September 2012</h2> <h2 class="date">3 September 2012</h2>
<h3 class="author">Giacom updated:</h3> <h3 class="author">Giacom updated:</h3>
@@ -59,7 +68,6 @@ should be listed in the changelog upon commit tho. Thanks. -->
<li class="rscadd">Cameras get upgrades! Currently there's X-ray, EMP-Proof and Motion. You'll find the EMP-Proof and Motion cameras in the normal places (Singularity Pen & EVA), the new X-ray cameras can be found in the Dormitory and Bathrooms, plus some extra ones to invade your privacy. See if you can smash them all.</li> <li class="rscadd">Cameras get upgrades! Currently there's X-ray, EMP-Proof and Motion. You'll find the EMP-Proof and Motion cameras in the normal places (Singularity Pen & EVA), the new X-ray cameras can be found in the Dormitory and Bathrooms, plus some extra ones to invade your privacy. See if you can smash them all.</li>
<li class="tweak">Alien Larva can bite simple animals (see: Ian, Runtime, Mice) to kill them and gain a small amount of growing points.</li> <li class="tweak">Alien Larva can bite simple animals (see: Ian, Runtime, Mice) to kill them and gain a small amount of growing points.</li>
<li class="tweak">Space travel was tweaked to be more random when changing Z levels. This will stop people and items from being stuck in an infinite loop, as they will eventually hit something to make them stop.</li> <li class="tweak">Space travel was tweaked to be more random when changing Z levels. This will stop people and items from being stuck in an infinite loop, as they will eventually hit something to make them stop.</li>
<li class="tweak">Removed cameras from bots. They weren't working well with freelook and I felt that since they weren't used at all, they wouldn't be missed.</li>
</ul> </ul>
</div> </div>