Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Bug with SetObjectScalePermanant...possibly?

Author
Message
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 14th Nov 2019 09:33
Hi all.

Ok, so first off producing an example for this will be hard, but I will try.

I've spent 4 days trying to get a single bug ironed out, and I've come to what I think is a conclusion. In my code, I load an object (an arrow) and set it;s scale permanantly to 100x100x100, then again by 140x140x140. All is good (I need it at this scale).

In anothr part of my code, I want to copy this arrow, so I clone it. All good. Except, it's not. The clone looks EXACTLY the same as the original, however when I'm trying to place it, something very strange happens - it positions it miles away from the original, even if being set with the exact same coordinates. I assumed, quite naturally, this was my error somewhere (and indeed may well be), but after too many hours I removed the clone command and loaded the object from scratch again, and then set all the propoerties of the original again....and no issue.

I;ve even gone as far as dumping the exected world coord and the actual object world coord on screen - they are identical, but the cloned object is nowhere near the world coord that AppGameKit is reporting.

So my guess is that there's something wrong with the AppGameKit internal shader command on scaled objects maybe? I assume this as it literally only appears to the screen output that is wrong, not the data AppGameKit is reporting in terms of where it THINKS the object is.

It's very strange.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th Nov 2019 09:57
Im not sure if this is the same issue but ive come across similar problems when the pivot is not centred.
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 14th Nov 2019 10:13 Edited at: 14th Nov 2019 10:17
Yeah, the exact code which loads the object is this:



So it shouldn't be the pivot. The item is also never scaled or rotated after that, it's purely used as a location marker. I'll try and capture the behaviour in a video, but I'm also going to quickly try giving it a non default shader.

EDIT: That did't work, so not the shader.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th Nov 2019 10:59
just a thought havent seen the model but is it possible theres some debree miles away from the object itself that's being saved with it
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 14th Nov 2019 11:04
So I think I found the problem and it was me.

The behaviour was so erratic, but it only happened AFTER I moved the the object that was being cloned....and it;s the FixObjectPivot command after all. That fixes the position as well as the rotation, something I hadn't taken into account, so the cloned objects vertice positions were being left whereever they happened to be, but the position of the object was reset to zero - so when I set it to something other than zero, it actually had the offset of the position of the cloned object.

So no bug after all.

Login to post a reply

Server time is: 2024-04-25 11:05:32
Your offset time is: 2024-04-25 11:05:32