ID:2147050
 
I'm having trouble deriving a screen_loc from params, when using Click(), ect, from interacting with an item that's been assigned to a grid's cell; it comes back as null to my knowledge.

I'm a little confused if it's supposed to be returning the screen_loc of the obj, or the mouse. Either way, both are null. Is there any way around this issue? I'm trying to get the screen_loc so I can assign a radial menu when right-clicking, basically.

But so far, I've had to use mouse_down(), close the interface window, then wait for mouse_up() to be called before taking the params and finding what I assume is the screen_loc of the mouse, then reopening the interface menu. It works, but it looks terrible and also relies on the player to let go of their click.

Many thanks for any help, tips or advise. - Ginseng

If you're using mouse info on the item within the grid, then of course you won't have screen_loc to work with because you're not on the map. screen_loc should be included if you're on the map, though.
This is how to get the screen_loc of the mouse when it clicks an object that is visible in a map control:
obj/Click(location, control, params)
var
list/p = params2list(params)
mouse_screen_loc = p["screen-loc"]

Getting the position of the mouse outside of the map control is not really supported in Dream Seeker.
I had a feeling that was the case, thanks for the reply. Is there then no way to extract a screen_loc from an item inside a grid, by somehow tracking the mouse position on the screen, by chance?

To be specific, I'm trying to make it so when you right click an item in the grid, a radial menu pops up. It's screen_loc is then set to where the mouse currently is, but I can't seem to think of a way to achieve this.

I've tried getting the screen_loc of the item, but like you said, it seems it's not been assigned a screen_loc when inside a grid. I also tried the work around mentioned in my first post to no avail. Is there possibly anything else I can do?

I really would prefer not to revert the inventory system I've created using the interfaces back into on-screen objs, since the interface has a lot of versatility in regards to positioning and allowing the player to move it around as they please.

Many thanks. - Ginseng
In response to Kaiochao
Kaiochao wrote:
This is how to get the screen_loc of the mouse when it clicks an object that is visible in a map control:
> obj/Click(location, control, params)
> var
> list/p = params2list(params)
> mouse_screen_loc = p["screen-loc"]
>

Getting the position of the mouse outside of the map control is not really supported in Dream Seeker.

Thanks for the reply and example. I actually used exactly that to try and get the screen_loc of the item inside the grid, inside the interface; just didn't know it hadn't been assigned a screen_loc, since technically, it's not on the players screen objs list.

I'm really pleased we can derive extra params from mouse based functions, though, such as right clicks; I wasn't aware of this until the other day. - Ginseng
In response to Ginseng
Ginseng wrote:
I've tried getting the screen_loc of the item, but like you said, it seems it's not been assigned a screen_loc when inside a grid.

That's what I said; it's not on the map, and therefore has no screen_loc.
In response to Ginseng
By the way, the "screen-loc" parameter refers to the "screen_loc" of the mouse cursor, not of the atom involved in the mouse event.
Thanks for the reply guys, I'm starting to understand the intricacies involved a bit better with all the relevant functions discussed so far. To conclude. What I'm trying to do, isn't viable using interfaces at the moment?

Thanks again. - Ginseng
In response to Ginseng
Maybe not doable in Dream Seeker, but definitely doable in the web client.