ID:138854
 
Code:
obj
fountain
icon = 'fountain.dmi'
name = "stone fountain"
density = 1

fountain/MouseEntered(t as text)
winshow("Obj_Info",show=1)
src <<output("Drink")


Problem description:
I am trying to get a tab to disply on screen when the mouse enters the fountain that delivers the message "Drink" in the tab.
I can get it to work as regular text off the game screen but I would really like to use windows for this.
The only error I get with this code is "expecting 2 to 3 args, found 1" in relationship to "winshow". I left out the usr,mob,src or whatever that is shown in guides to preceed the skin name and show=. That does not work either.
I have to be overlooking something simple but now I am frustrated and asking for help.

Attention:
This function does not support named arguments and their use throws the error 'expected 2 to 3 arguments (found 1)'.


^ Took that directly from the reference.
 fountain/MouseEntered(t as text)
winshow("Obj_Info",1) // Just a number bigger then 1 or equal to 1 to show it, and a zero to hide the window.
src <<output("Drink")
In response to Raimo
Thanks for the help.
I am stil learning the language. I have not yet grasped fully the grammer or sentence structure of code. (as I do with our own written language).
That is why I post here in hopes that someone's response will clarify for me what I am reading or trying to write. By you changing the code to just showing the number "1" I can now understand what is meant by a named argument.
Before this my only understanding of code argument is that you stated your argument in the parenthesis and therefore believed that somehow I was missing the proper ordering.
Thanks again for your help Raimo
In response to Spindraft
No problem, Spindraft. You can always ask questions here if you don't know how to do something or just if you need help, we will be glad to help you out. I hope you will enjoy your further development in BYOND.
In response to Raimo
Code:
obj
fountain
icon = 'fountain.dmi'
name = "stone fountain"
density = 1

fountain/MouseEntered(t as text)
winshow("mapwindow.map","obj_info",1)
src <<output("Drink water from fountains to restore your health")

//I get this runtime error

runtime error: bad client
proc name: MouseEntered (/obj/fountain/MouseEntered)
usr: Guest-1378653397 (/mob)
src: the stone fountain (/obj/fountain)
call stack:
the stone fountain (/obj/fountain): MouseEntered(the road (47,10,1) (/turf/road), "mapwindow.map", "screen-loc=8:29,9:9")


Problem description:
I have tried several configurations with this code including tips in the DM Reference, Raimo's earlier post and just plain mixing things up to get it to work. This particuar copy just happens to be the one printed when I made this post. What am I missing here? I have tried just about every idea I can come up with.
I dont understand bad client because MouseEntered is the client.
I tried obj/turf/control/param where the t as text is, that did not work either.
In response to Spindraft
You're arguments are still just a little off:

Correct format:
winshow(player, window, show)

What you're trying:
winshow("mapwindow.map","obj_info",1)

Where it's expecting a player (mob or client), you're passing it a text string. It doesn't know how to turn that text string into a client, so it calls it a "bad client".

What you want is:
winshow(usr,"obj_info",1)


Because the usr (in this particular case) is the mob of the player who triggered MouseEntered().