ID:264817
 

Problem description:
The link comes up perfectly but when i click it nothing happens? no matter what code i use it shows the link but it doesnt do what its suppose to do..its like the links been removed. I tried a code from another game that works then put it into my game and it doesnt. only the link shows.
Please help me find a solution.
First, don't copy and paste.

Second, I'm guessing your Topic() is not being called properly. Check out this for some clarification.
i only did the copy and paste to see if it would work and the same code works in the other games but just not in mine for some reason

and still not working..it shows up but clicking does nothing..
In response to Vai God69
If a piece of code does not yield the expected result and you want others to assist you, you provide the code snippet and explain what you expected to happen and what actually happens when that code is executed.
Otherwise, you're going to have to wait for somebody with a crystal ball to read your mind.
In response to Schnitzelnagler
mob

Topic(href, href_list[])
if( findtext("watch", href_list["action"]))
var/A = href_list["action2"]
for(var/mob/M in fighting_participants)
if(M==A)
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = M
usr.watching = 1
usr << "If you want your sight to normal just use the Watch verb."


I want this code ,wich is suppose to be a watch code so can see people fighting in tourny, to when the rounds appear in tourny output to be able to click the peoples names and then there eye sight goes to the person fighting
In response to Vai God69
We need to also see where you are creating the link, that is being clicked.
In response to Garthor
<a href='?src=\ref[M];action=watch;action2=[usr.name]'>perspns name</a>
In response to Vai God69
href_list["action2"] is a text string. You are attempting to compare it to an instance of an actual mob. Mobs are not text strings.

You'll want to use \ref[usr] and then use locate(href_list["action2"]) to find the mob.
In response to Vai God69
I would say something along the lines of...

switch(href_list["action"])
if("watch")


One of the problems I was having while looking at this.
In response to Vai God69
Vai God69 wrote:
<a href='?src=\ref[M];action=watch;action2=[usr.name]'>perspns name</a>


Use " " instead of ' ' if you want it to recognize variables. And listen to what Garthor wrote.
In response to CauTi0N
He's using single quotes because it's embedded inside a text string.
In response to Garthor
mob

Topic(href, href_list[])
world << "Watch" //to check if its even being called
if( href_list["action"]=="watch")
world << "Watch" //to check if its even being called
var/A = locate(href_list["action2"])
for(var/mob/M in fighting_participants)
if(M==A)
src.client.perspective = EYE_PERSPECTIVE
src.client.eye = M
src.watching = 1
src << "If you want your sight to normal just use the Watch verb."


This still doesnt work. could some body please write me up a proc so i can test it.
In response to Garthor
Mmm. Not sure why that didn't register to me.
In response to CauTi0N
for some reason i can take that code put intoanother game at it will work but for some reason not mine..is there a way you can stop links? cuz thats the only reason i can see..what about garbage collection
In response to Vai God69
ok i got it to work..for some reason i had to use client instead of mob.

now i have another problem... When i click it it does what i want but the sight doesnt go to the persons i clicked..

client

Topic(href, href_list[])
if( href_list["action"]=="watch")
var/mob/A = href_list["action2"]
for(var/mob/M in world)
if(M.name==A)
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = A
usr.watching = 1
usr << "You are watching [A]==[M]."
usr << "If you want your sight to normal just use the Watch verb."



usr <<"<a href='?src=\ref[usr];action=watch;action2=[usr.name]'>Get</a>"


My sight just goes black for some reason.
In response to Vai God69
Uhhh...why are you using usr in this?