ID:263538
 

obj/hud/disk_rest
proc
toggle()
obj/duel_disk
Click()
Call(??)//now here i got problem call toggle()


Problem description:

Your going about calling proc all wrong, you should read the DM guide it has some good examples on procs and how they work
http://www.byond.com/docs/guide/
call(/obj/hud/disk_rest/toggle)

I think that's what you need...
In response to Jhon
Hell no.

Call() isn't the way to do it here: you want something more like usr.client.duel_disk_hud.toggle().
In response to Jhon
i think u rite,but the rite format is
usr.call(/obj/hud/disk_rest/toggle)
Arro_0 wrote:
> obj/hud/disk_rest
> proc
> toggle()
> obj/duel_disk
> Click()
> Call(??)//now here i got problem call toggle()
>

Problem description:


You can go about that like this:
obj/hud/disk_rest/proc/toggle()
obj/duel_disk/Click() call(/obj/hud/disk_rest/proc/toggle)()

That is, if you just *have* to use call()(), which you don't. I don't recommend using call(). You could do something like this,
obj/hud/disk_rest/proc/toggle()
obj/duel_disk
var/hud/disk_rest/disk_rest = new/obj/hud/disk_rest
Click() disk_rest.toggle()

If you know what I mean.
In response to Koil
it works,thx all
In response to Koil
Koil wrote:
Arro_0 wrote:
> > obj/hud/disk_rest
> > proc
> > toggle()
> > obj/duel_disk
> > Click()
> > Call(??)//now here i got problem call toggle()
> >

Problem description:


You can go about that like this:
> obj/hud/disk_rest/proc/toggle()
> obj/duel_disk/Click() call(/obj/hud/disk_rest/proc/toggle)()
>

That is, if you just *have* to use call()(), which you don't. I don't recommend using call(). You could do something like this,
> obj/hud/disk_rest/proc/toggle()
> obj/duel_disk
> var/hud/disk_rest/disk_rest = new/obj/hud/disk_rest
> Click() disk_rest.toggle()
>

Hm,second one doesnt work
In response to Arro_0
Don't just copy-paste code. Learn from it and adapt it to your game. Read the reference entry for call() (if you decide to use it), and read the DM Guide.