ID:1905106
 

Problem description:

In certain conditions when I change the client.eye location I am met with a black screen that resembles when a mob walks of the map.

Code:
    SkillTree()
if(Skill_Tree)
for(var/I in client.images) if(I)
del I
client.eye = usr
Skill_Tree = 0
return
src << "Your view has changed, but you are still in the same spot."
Skill_Tree = 1
client.eye = locate(25,25,1)
Refresh_Skilltree()


This code works fine if i'm stood nearish the center of the map, if I stand near the edge map it causes the black screen, but areas and obj within view that have Click() do not proc.

Almost like its off center somehow....

Some important stuff to note;
Client view is 20x15
map_format = SIDE_MAP //This doesn't seem right
ICONWIDTH X ICONHEIGHT = 32x32

Thanks in advance!
You need to set client.perspective to be/include EYE_PERSPECTIVE.
Ah thanks!

Now works even if its near the edge of the map, but I still cant click objects.

Even when they are in Mob view I cant seem to click them.

Was there a setting to disable mouse in the map window?
Small BUMP.

I did A little searching and found that if you override client.click() then you need to use ..()

Where would I add ..() in this code?

    Click()

if( (name in usr.Learned_Skills) )
usr << "You have already learned this!"

else if( !(name in usr.Activated_Skills) )
usr <<"This skill is not available at this time."

else if(usr.Skill_Points < reqpoints)
usr << "You don't have the required skill points for this!"

else if( alert("Obtain [name] for [reqpoints] points?","Skill Obtain","Yes","No") == "Yes")
usr << "You have obtained [name]!"
usr.Learned_Skills += name
for(var/A in unlocked_skills)
if( !(A in usr.Activated_Skills) )
usr.Activated_Skills += A
usr.Skill_Points = max(0, usr.Skill_Points - reqpoints)
usr.contents += new tech_obtained
usr.Refresh_Skilltree()
In response to DaGilbert
That's correct, overriding client.Click() means that atom.Click() won't happen until ..() is called.

But is what you posted actually client.Click()?

Just to check, try adding a debug message to client.Click() to see if it is really happening:
client/Click()
src << "client.Click() happened"
..()
Ah no, the code above is an Obj/Click()

The client.Click() Is here.
client

perspective = EYE_PERSPECTIVE

Click(mob/m)
if(m == usr) return

if(istype(m))
if(!usr.party)
usr.party = new(usr)

if(m in usr.party.mobs)
usr.party.remove_player(m)
else
usr.party.add_player(m)


I'm having trouble being able to using obj/click() while the code above is implemented.

If I remove the client.click() then the obj works, but only if the object is within view of the mob.

Not sure if I used Client.Persepctive Right.
Just toss "..()" at the top, or bottom of that client/Click() call, depending on where you need it, that will allow atom.Click() (and subsequently obj.Click()) to execute.
If placed at the bottom, the player won't be able to click himself. However, if placed at the top, m.Click() won't know if I was added/removed from usr's party. That's the kind of thing you want to watch out for and base your decision on.

You also have the option of calling it at all ends of the proc. For example, if(m == usr), do ..() before returning, and call ..() after the party management but inside the "else" block. You want to be careful not to accidentally call ..() multiple times, though, which will never happen in the case of if/else.