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 / I have noticed these 2 commands do not work. Is it a future development issue with AGK ?

Author
Message
Mark Garrett
Reviewed AGK on Steam
18
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 24th Sep 2017 15:32 Edited at: 24th Sep 2017 16:03
It seems that on a Game-Creation-Platform that the following 2 examples should work, however on AppGameKit they do not:

Example #1


Example #2


Is this a future development issue? Or is this a 'bug'? Anyone know please?
With App-Game-Kit, spread your wings and fly!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Sep 2017 16:47
Sprite Image ID works OK for me:



Sprite 100013 Image ID = 100003
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Mark Garrett
Reviewed AGK on Steam
18
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 25th Sep 2017 06:41 Edited at: 25th Sep 2017 07:48
Well, you gave me an answer.... But I don't see how it relates to my question...

... So, let me explain my question better....And I hope you will understand what I am saying if I exemplify ...

This does code does not work:




Had to re-code it as follows..
this code works, but is longer and more complex:



Just saying, this re-coding should be unnecessary and adds to the length of the coding ,

By the way, I noticed there is a 'Bug Reports' forum, but for DarkBasic only. Can we have one also for AGK2? That would be better, I think.

App Game Kit is Fun
Ian Rees
AGK Developer
11
Years of Service
User Offline
Joined: 3rd May 2012
Location: Wales, UK
Posted: 25th Sep 2017 07:36 Edited at: 25th Sep 2017 07:38
Hi Bubba,

I can't replicate the issue - the code here:



shows two examples of setting the image - the first image is auto-assigned an ID and the second one is assigned the ID of 6. When I create two sprites from the two images my print statements show '100001' for tmpSprite and '6' for tmpSprite2.

This is what I expected. The use of ID's is documented here:
https://www.appgamekit.com/documentation/guides/1_id_numbers.htm

The important point is that the GetSpriteImageID command works and returns the correct values without me having to assign them to an integer variable.

Could you show us the part of your code where you assign the image and the sprite?

Thanks.

Edit - fixed link
E
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 25th Sep 2017 07:40 Edited at: 25th Sep 2017 07:42
As pointed out, GetSpriteImageID() works exactly as it's supposed to.
I also suspect that the problem is with the way you have loaded the image and assigned IDs to the image and sprite.

This works perfectly:
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Sep 2017 11:31
The code I posted was to show that a direct query gets you the Image ID.
Scraggle may have a point, the help is a little cryptic but suggests it only works under specific circumstances.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 25th Sep 2017 15:16
The sprite angle is possibly because the angle isn't actually dead on 180 degrees, I had that. Instead, try checking if the ROUND or FLOOR of the get sprite angle is 180. Worked for me. Have to remember that angles are floating point.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 26th Sep 2017 10:01
Quote: ", try checking if the ROUND or FLOOR of the get sprite angle is 180"

Or check if the sprite angle is >= 179.9 and <= 180.5.
Click here for VR Legend of Zelda stuff
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 26th Sep 2017 23:31
Having just come off some infuriating "learning" with angles and agk I, too, echo the previous posters. Also, keep in mind its a float. In my experience, wonky things can happen when you compare a float to an integer(maybe due to rounding?).

Login to post a reply

Server time is: 2024-04-24 03:45:24
Your offset time is: 2024-04-24 03:45:24