Camera views relative screen/map coordinates don't change...

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
User avatar
SBG
001 Subscriber
 
Joined: Thu Jun 17, 2010 8:37 pm
Location: merca

Camera views relative screen/map coordinates don't change...

Postby SBG » Mon Feb 15, 2016 12:05 am

...when panning its interface. So say you have an interface that has a camera view that focuses on a map with actors that are movable by positioning to mouse map coordinates when clicked and held. The interface that the camera view is in is pannable. The camera view moves with the interface just like it should, and you are able to click on actors inside the camera view to move them, but when the actors moving timer kicks in, it tries to position the actor on a map relative to the mouse cursor, which also works in that regard, however once the interface is panned from its original spot, and you grab one of these actors, hovering the newly positioned camera view will not position that actors on the map where the mouse is pointing. Instead, you have to hover over the area on the screen where the camera view originally was and the grabbed actor shows up in the map and camera view relative to where you are pointing. If that makes any sense.

User avatar
Gamerdude
001 Support
 
Joined: Wed Dec 12, 2007 8:56 pm
Location: Australia

Re: Camera views relative screen/map coordinates don't chang

Postby Gamerdude » Mon Feb 15, 2016 1:14 am

Might need a few screenshots or video for this one. :P
Image
Image

User avatar
SBG
001 Subscriber
 
Joined: Thu Jun 17, 2010 8:37 pm
Location: merca

Re: Camera views relative screen/map coordinates don't chang

Postby SBG » Mon Feb 15, 2016 3:52 pm



As you can see, it's a drag n drop inventory in a movable interface. When it's in its original position, it works fine, but when I move it, and grab an item to drag to it, I have to drag the item to the interfaces original spot to get it into the camera view. Strange behavior.

Should be noted that when there is an item in the inventory(camera view), you can click on it no matter where the interface is, so it still registers in that regard. It's just the positioning thing when going from the main map to the camera view that messes up.

User avatar
Lee
001 Support
 
Joined: Thu Sep 21, 2006 1:59 pm
Location: United Kingdom

Re: Camera views relative screen/map coordinates don't chang

Postby Lee » Tue Feb 16, 2016 7:37 am

Can you send this as a bug report (Help > Submit Bug) so we can look into it/get this issue fixed?
Lee - 001 Community Manager

User avatar
SBG
001 Subscriber
 
Joined: Thu Jun 17, 2010 8:37 pm
Location: merca

Re: Camera views relative screen/map coordinates don't chang

Postby SBG » Tue Feb 16, 2016 7:44 pm

Sent. Hopefully I explained the steps coherently enough in the bug report :P

User avatar
Lee
001 Support
 
Joined: Thu Sep 21, 2006 1:59 pm
Location: United Kingdom

Re: Camera views relative screen/map coordinates don't chang

Postby Lee » Thu Feb 18, 2016 12:22 pm

Mike has looked at your project and this doesn't appear to be an issue with the engine itself, rather the way you've set this up. If you enable the "Hit Test View" in the Cheats window of the Debugger, you'll see things are being off-set correctly.
Lee - 001 Community Manager

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: Camera views relative screen/map coordinates don't chang

Postby Mike » Thu Feb 18, 2016 12:35 pm

It might be worth noting that positions you set on fields are relative to the position of the interface, and not the screen. You will have to offset it yourself. This is because interfaces could be aligned in so many different ways with different resolutions, that relative coordinates are far more useful and reliable. It's for special tasks like this that require a bit of math on your part. Alternatively, you could have it on a different interface. Not sure if that would help your cause though.

User avatar
SBG
001 Subscriber
 
Joined: Thu Jun 17, 2010 8:37 pm
Location: merca

Re: Camera views relative screen/map coordinates don't chang

Postby SBG » Thu Feb 18, 2016 7:46 pm

So basically I should be moving the fields and not the interface itself? If that's the case, shouldn't be a problem. I'm not sure I understand *exactly* why this is the way it is, and I can't make heads or tails of Hit Test View because the camera view doesn't even seem to be anywhere when I hit it, plus the cursor disappears so it's impossible for me to move the interface with it enabled, but I'll take your word for it. :-P

Just trying to make the best game I can, whatever it takes :D

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: Camera views relative screen/map coordinates don't chang

Postby Mike » Thu Feb 18, 2016 10:24 pm

If you could perhaps isolate the problem down to a straight up plain interface, and show how I can compensate properly or how it's producing incorrect results, then I could fix it. However, the scope of it and the fact that 001 is providing proper hit rectangles for offset interface, I'm not entirely sure what I would change specifically. But to recap, the provided mouse position is relative to the screen while the position of fields is relative to the interface. These may be converted back and forth depending on your needs.

User avatar
SBG
001 Subscriber
 
Joined: Thu Jun 17, 2010 8:37 pm
Location: merca

Re: Camera views relative screen/map coordinates don't chang

Postby SBG » Fri Feb 19, 2016 12:28 am

Ok I understand exactly what you are saying. Seems like screen and interface coordinates are being swapped out somehow. I'm honestly not sure exactly where the problem lies in that situation or how to fix it, but knowing that, I now know that at least moving the fields instead of the interface will solve the problem. No biggie, just a little bit of alteration and some copy-paste-modify action. Interesting problem though.

The weird part though, is that if you actually put something in the inventory and move it around(I didn't do that in the video), you can click on it no matter where the interface is and it grabs the item, which promptly ducks behind the interface into the map. So it does seems to register the location to some degree.

And an update, changed it to position fields instead, works perfectly!

User avatar
Mr.Numbers
001 Support
 
Joined: Wed Feb 28, 2007 1:50 am
Location: Alberta, Canada

Re: Camera views relative screen/map coordinates don't chang

Postby Mr.Numbers » Fri Feb 19, 2016 7:30 pm

To simplify what the issue was (Likely) was that when you have a field at the co-ordinates 0,0. You then use the "Pan Interface" to move the interface right 32 pixels. The original field is still at the co-ordinate 0,0, but its being displayed at 32,0. This is because the "Get Field Position X" or whatever use-value returns the fields position relative to the origin of the interface, not its physical position on the screen. All you would have had to of done was likely subtract the Interfaces X/Y Pan co-ordinates from the fields co-ordinates to fix the issue.

Either way, you solved your issue which is all that matters I guess :P
Image
I AM THE ALL MIGHTY SCRIPTING MASTER
Please do not PM me with Engine 001 related questions, rather post on the forums. ;)

User avatar
SBG
001 Subscriber
 
Joined: Thu Jun 17, 2010 8:37 pm
Location: merca

Re: Camera views relative screen/map coordinates don't chang

Postby SBG » Fri Feb 19, 2016 7:45 pm

I actually wonder if it did this because I failed to check maintain distance from edge on the field, but I can't be arsed to go back and check now. I made the script way better when I switched to positioning fields anyway. Not gonna fix something that isn't broke :P

User avatar
Mr.Numbers
001 Support
 
Joined: Wed Feb 28, 2007 1:50 am
Location: Alberta, Canada

Re: Camera views relative screen/map coordinates don't chang

Postby Mr.Numbers » Sat Feb 20, 2016 9:51 am

Of course! Hehe :P
Twas just posting that in case someone else searches for this issue here, I guess?
Image
I AM THE ALL MIGHTY SCRIPTING MASTER
Please do not PM me with Engine 001 related questions, rather post on the forums. ;)


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron