ID:160907
 
I have Icons on my map called Camaras and then in one room theres a computer called teh Camara Computer i want the camera computer to allow the user to choose what camara to watch.

    Camara_Computer()
icon='Icons/Objs1.dmi'
icon_state="Database"
DblClick(usr.client.eye != usr)
usr.client.eye = locate(5,5,1)
usr.client.perspective = EYE_PERSPECTIVE


I had a go but it isnt directly cenected to the camara just is on the spot where the camera is also it has a bug and isnt a good code how could i improve it and make it also conect to the camera no matter where that camera is.
Please re-review your post before posting it and ensure it is easy to understand your problem, and that you have written using understandable spelling and grammar...

Chrislee123 programmed:
>       DblClick(usr.client.eye != usr)


This is invalid syntax, and it shows you don't really understand the DM language very well. You ought to read this.

I had a go but it isnt directly cenected to the camara just is on the spot where the camera is also it has a bug and isnt a good code how could i improve it and make it also conect to the camera no matter where that camera is.

It is kind of difficult to understand what you mean here and what is the specific problem with your code. However, I can reply to this part:

make it also conect to the camera no matter where that camera is.

You could use the tag variable and the locate() proc in order to do this. Give every camera obj a unique tag variable (through the map editor's Instance Editor), then give the computer a variable that contains the tag(s) of the camera(s) it can access. The cameras (and their location) can then be dynamically found by your code that has access to the computer.
In response to Kaioken
    Camara_Computer
icon='Icons/Objs1.dmi'
icon_state="CameraComputer"
DblClick(usr.client.eye != usr)
var/C = /obj/Camera
usr.client.eye = C
usr.client.perspective = EYE_PERSPECTIVE
Camera
icon='Icons/Objs1.dmi'
icon_state="Camera"



I followed nearly everything u said yet it isnt working im confused i dunno why?
In response to Chrislee123
No, you didn't follow anything he said.
In response to Jeff8500
I did i added some tags not in a complex way but a way never the less...
In response to Chrislee123
I followed nearly everything u said yet it isnt working im confused i dunno why?

He's right, you followed basically nothing I've said. Your code doesn't use the tag anywhere (so even if you've set it, it has no effect). Re-read my previous post for more information.
Though looks like I probably shouldn't bother, as this:

Chrislee123 programmed:
>       DblClick(usr.client.eye != usr)
> var/C = /obj/Camera
> usr.client.eye = C
</dm>

Changes you from 'needing to read' this to HAVING to do it. You really need to read the ZBT tutorials, and then the DM Guide, because you don't understand the language enough yet to be using it.
In response to Kaioken
Dude i just rly want ppl to stop giving complex answers that way i may learn....and tutorials dont help....i need you to tell me what to do and where to do it and what that actually does
In response to Chrislee123
Chrislee123 wrote:
Dude i just rly want ppl to stop giving complex answers that way i may learn....

My answer wasn't complex. The "answer" you want is complete code already written for you to copy&paste, but in actuality, that teaches MUCH less because you won't learn from simply copy&pasting.

and tutorials dont help....

This is incorrect. Additionally, realize that a help post on the forums is basically a 'mini-tutorial' - both things tutor (/guide/help) you through getting something done. So if a tutorial can't help so, so can't I. Please read this article (it's different from the one I linked previously, and isn't a tutorial).
i need you to tell me what to do and where to do it and what that actually does

I already have. If you have truly tried to understand and follow my explanation, just tell me what you don't understand, and I'll attempt to explain it in more detail and clearness.

Also, not only I can't help you if you're not willing to put an effort to help yourself first, I'm also not willing to. Remember, no pain, no gain.
In response to Kaioken
Yer but it would be easier if you did it like this:

sleep(30) - Tells it to stop for 30 millaseconds

tags - Camera(1) - thats blah blah blah

Like that and also give an example other than what im gonna sue it for cause that would be rly effiecnt help and that way i can help myself by learning what it does and how to use it and etc.
In response to Chrislee123
If you look up locate() and tag, you'll know what it does and how it works.
In response to Kaioken
I made a loop and a list so its looking quite good now but it would be better if i learned the tag thingy.

obj/camarasystem/Camera_Computer
icon='Icons/Objs1.dmi'
icon_state="CameraComputer"
DblClick()
back
switch(input("View a room","Rooms")as null|anything in list("Gateroom","Armoury","Outside","Close"))
if("Gateroom") {usr.client.eye=locate(5,20,1);usr.client.perspective=EYE_PERSPECTIVE; goto back}
if("Armoury") {usr.client.eye=locate(15,12,1);usr.client.perspective=EYE_PERSPECTIVE; goto back}
if("Outside") {usr.client.eye=locate(7,6,1);usr.client.perspective=EYE_PERSPECTIVE; goto back}
if("Close") {usr.client.eye=usr.client.mob;usr.client.perspective=MOB_PERSPECTIVE|EDGE_PERSPECTIVE}
obj/camarasystem/Camera
icon='objs1.dmi'
icon_state="Camera"
name="camera"




Right ill take a look at your first post.
In response to Chrislee123
goto is pretty bade practice why not make the DblClick call a proc and instead of goto just call the proc again.
In response to A.T.H.K
That's also bad practice. A proper loop construct should be used, not a repeating call, which gives relatively crappy implications. Also, not proofreading your post before posting is also a bad practice.
In response to Kaioken
obj/camarasystem/Camera_Computer
icon='Icons/Objs1.dmi'
icon_state="CameraComputer"
DblClick()
..()
usr.ViewCameras()

mob/proc/ViewCameras()
var/list/Cameras = new
for(var/obj/camarasystem/Camera/C in world)
Cameras += C
Cameras += "Close"
var/choice = input("Which Camera would you like to view?","Camera") in Cameras
if(choice=="Close")
client.perspective = MOB_PERSPECTIVE
client.eye = usr
else
client.perspective = EYE_PERSPECTIVE
client.eye = choice
ViewCameras()

obj/camarasystem/Camera
icon='objs1.dmi'
icon_state="Camera"
name="Camera : Location 1" // Dont forget to set the name different each time you do this


Theres probably a few things wrong with this however look at it and look at the way you can select a camera just by adding them all into a list. This is what Kaioken was trying to explain.
In response to BrotherBear
Well, it is one method, but it is not the one I was explaining or something that he asked for.
In response to Kaioken
obj
camarasystem2
Camera_Computer
icon='Icons/Objs1.dmi'
icon_state="CameraComputer"
DblClick()
..()
usr.ViewCameras()
Camera
icon='objs1.dmi'
icon_state="Camera"
name="Camera : Gateroom"
Camera
icon='objs1.dmi'
icon_state="Camera"
name="Camera : Armoury"
Camera
icon='objs1.dmi'
icon_state="Camera"
name="Camera : Infirmatry"
Camera
icon='objs1.dmi'
icon_state="Camera"
name="Camera : Outside"

mob/proc/ViewCameras()
var/list/Cameras = new
for(var/obj/camarasystem2/Camera/C in world)
Cameras += C
Cameras += "Close"
var/choice = input("Which Camera would you like to view?","Camera") in Cameras
if(choice=="Close")
client.perspective = MOB_PERSPECTIVE
client.eye = usr
else
client.perspective = EYE_PERSPECTIVE
client.eye = choice
ViewCameras()


Right i done that and added a couple more cameras. Y does it set them all to the camera?
In response to Chrislee123
nvm lol i know what i did xD
In response to BrotherBear
No usr in procs as well... >_>