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 / [SOLVED] Just bought and having problems

Author
Message
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 14th Mar 2021 01:01
So I am learning how to use the upgraded version as studio and I added the first scene then I added a main player and where it says unique veritable I added Player calling my sprite Scene one_Player

then when I run the app it tells me

scene one.scene:14:Error: Unexpected token one_player

scene one.scene:202:Error: Unexpected token "one_player", variable must be followed by an assignment

I checked the code and everything is written correctly as the editor pre wrote the code.

Is this not working and if not why did I even buy studio.

The author of this post has marked a post as an answer.

Go to answer

n00bstar
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location: Montreal, Canada.
Posted: 14th Mar 2021 01:15
If I understand correctly.... try naming your sprite something else, without any spaces in the name.
-----------------------------------------------------------------------------
We all got a chicken duck woman thing waiting for us
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 14th Mar 2021 01:21
Well I named the whole scene scene one

Is there a way to change the scenes name to one word?
n00bstar
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location: Montreal, Canada.
Posted: 14th Mar 2021 01:29
This post has been marked by the post author as the answer.
You need to start using quotes when you write here... it's really not clear if you named your sprite "one_player" or "scene one_player"

The error you're getting seems to indicate that your sprite name is made up of multiple words with spaces in between, which won't work.

Try posting your code here, it'll be simpler for us to analyze it and help you.

-----------------------------------------------------------------------------
We all got a chicken duck woman thing waiting for us
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 14th Mar 2021 01:43 Edited at: 14th Mar 2021 01:45
My scene is called

scene one

so when I name my sprit it automatically names it

Scene one_Player

with spaces

So I made a new scene and named it

Menu, one word

And everything is working fine now.

Just for further reference to others

Name all your scenes with one word
n00bstar
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location: Montreal, Canada.
Posted: 14th Mar 2021 03:06 Edited at: 14th Mar 2021 04:23
I'm surprised it even lets you name something with multiple words. Yet another fail for Studio.
-----------------------------------------------------------------------------
We all got a chicken duck woman thing waiting for us
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 14th Mar 2021 07:20
Quote: "Yet another fail for Studio."


Yea Studio must be a frustrating first look at programming it annoys the living s&&t out of me and I know what I'm doing, that editor is junk!

Property fields that send data to scripts without first validating the data from a company with an Intel black belt, even I run regEX on such fields for apps only I use FCOL!

Quote: "Is there a way to change the scenes name to one word?"


Sure, remove the file from the project, open the file in a external editor do a search and replace on the file name, save the file to a new name and add it to the project, easy, who needs a "Rename" menu item! bla!!

Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 14th Mar 2021 08:41
Quote: "that editor is junk!"


I'm finding this out now

very slow and hard to work in
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 15th Mar 2021 09:55 Edited at: 15th Mar 2021 09:56
Bad programming practise in general to create variables with Spaces.

Rather use "underscore" op Capitalize

sceneOnePlayer or scene_one_player

Luckily APPGAMEKIT, is one a very few language , don't care about capitalization in variables... Try C++ and see how Capitalization can become a huge pain-in-the-butt, not to mention all the "{" curly brackets, or ";" semicolons after the lines.

APPGAMEKIT is actually a VERY good language.. limitation for sure.... but good!!!

The scene name will always add n prefix to YOUR variable.
If your variable is my_variable, doesn't matter if it's a sprite, text, editbox, and your scene is named "main.scene" the variable will alway be changed to "main_my_variable"

Quote: ""that editor is junk!""


Disagree on this. I've been using the editor for 90% of my designs.
Yes, there might be some needed additions, but it's pretty stable....

D
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 16th Mar 2021 01:12
DannyD

Ok, Well I have been just doing this now

Level_1
Level_1_1
Level_1_2

So on and forth so I don't get confused

I also learned that if you do not Name sprites or even 3d models exactly my phone will not load it in. .
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 16th Mar 2021 06:28
@Game_Code_here

Quote: "I also learned that if you do not Name sprites or even 3d models exactly my phone will not load it in. ."

Don't really understand exactly what you mean here. Can you explain more, or some sample code to test.

Generally, I give all my Sprites/text/editbox I know I will use a variable name (If its only as static sprite, always at the same place, I dont care, cause AppGameKit will assign a array[] variable to it

During my years of programming I've create a method that work for me
Variables Example:
firstSecondThirdVariable = Alway Start lowercase, then all other "Words" Uppercase. This read easy and help remember the Variables
In AppGameKit, I use the exact same approach, but add the following
firstSecondThird_eb = editbox
firstSecondThird_txt = Text
firstSecondThird_vb = Virtual Buttons
firstSecondThird_spr = Sprites
firstSecondThird_img = Images
firstSecondThird_snd = Sound
....

Few advantages in this way.. Well this is my way and not always the correct way, but it work for me for years
all Images/Sprites etc that is together in a "group" can have the same variable name, and only the _XX will change

Cherio
D








blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Mar 2021 20:26
He means android/iphone are case sensitive when it comes to filenames
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 16th Mar 2021 22:44
@blinkOK

Oh yes, i've seen that before. Couldn't get an image to show on my android, and then realize the filename in the APP i"myfile.png" but the actual file is "Myfile.png". Took me a while to figure that out...

Could this be a Bug on AppGameKit side?

Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 16th Mar 2021 22:58 Edited at: 16th Mar 2021 22:59
"Could this be a Bug on AppGameKit side"

It's an operating system thing. Windows OS doesn't care about case.
C:\User\JohnDoe\Photo.jpg and c:\user\johndoe\photo.jpg are the same thing to Windows.
In most other operating systems - Android included - those are different directory and file names.

A good practice when coding for multiple platforms is to try to keep all filenames lowercase.
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
Use virtual resolution instead of the default percentage system." - Digital Awakening
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 17th Mar 2021 12:00
Quote: "A good practice when coding for multiple platforms is to try to keep all filenames lowercase."


Agree, I try to stick to it as far as possible.....
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 18th Mar 2021 09:16
String comparisons i find it good practice to use the toupper command ie if toupper(a$) = "B" it certainly stops allot of problems with comparions that are hard to spot

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 18th Mar 2021 11:22
"use the toupper command" I had no idea that command even existed.
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
Use virtual resolution instead of the default percentage system." - Digital Awakening
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 18th Mar 2021 19:37
Quote: "i find it good practice to use the toupper command"


I prefer lower but yeah this is good advice, depending on the use case I usually trim spaces to as I'v lost count of the amount of times that headache has popped up.

Login to post a reply

Server time is: 2024-04-20 08:42:36
Your offset time is: 2024-04-20 08:42:36