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 Studio Chat / ID Already Exist

Author
Message
Dark_ITheI _Angel
21
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 25th Sep 2022 13:58
Hello,

Am getting a weird error, no matter wich ID am trying to give agk tells me it already exist at the same line. Didnt have this before and now its happening in 2022 but also in 2021 (just updated yesterday)
Somebody knows what could be causing it or a fix to it? ... Picture Attached !
Animals

Attachments

Login to view attachments
Steve Ancell
18
Years of Service
User Offline
Joined: 16th Feb 2006
Location: Brighton, East Sussex, UK
Posted: 25th Sep 2022 14:01
Step back and think where you've put the CreatObjectCylinder command, the clue is it's inside a loop.
Steve Ancell
18
Years of Service
User Offline
Joined: 16th Feb 2006
Location: Brighton, East Sussex, UK
Posted: 25th Sep 2022 14:04
Try this and you'll realise what I mean.


Steve Ancell
18
Years of Service
User Offline
Joined: 16th Feb 2006
Location: Brighton, East Sussex, UK
Posted: 25th Sep 2022 14:09
What you did is create a cylinder with an ID of 2 on first iteration of the loop then then you're trying to create another cylinder with the same ID on the 2nd iteration, 3rd, 4th, etc... If you need to create the objects inside a loop then you need to replace the ID of 2 with an integer variable then increment that variable on each pass of the loop.
Steve Ancell
18
Years of Service
User Offline
Joined: 16th Feb 2006
Location: Brighton, East Sussex, UK
Posted: 25th Sep 2022 14:19 Edited at: 25th Sep 2022 14:21
You need to be doing something more along the lines of this.

Dark_ITheI _Angel
21
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 25th Sep 2022 14:28
Thanks for the help Steve, i was just not getting it that everything i created was inside a loop so it could not create it a second time with the same ID.
Just getting started with programming, Thanks again, was just not seeing my mistake.

Animals
Steve Ancell
18
Years of Service
User Offline
Joined: 16th Feb 2006
Location: Brighton, East Sussex, UK
Posted: 27th Sep 2022 02:04
You'll get there mate, it's a bit of a learning curve but you can do it.

Login to post a reply

Server time is: 2024-03-29 12:27:55
Your offset time is: 2024-03-29 12:27:55