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 / Incompatible types "String" and "Integer"

Author
Message
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 23rd Feb 2022 23:43
I'm getting the following error at my line 73 which is the line where the CreateText(x1, "MANAGER" + x + "ENTER NAME") is

EnterSirName.agc:73: error: Incompatible types "String" and "Integer"



Are we not allowed to do that?
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 24th Feb 2022 01:05 Edited at: 24th Feb 2022 01:07
I learned that adding string before the plus sign works.

CreateText(x1, "MANAGER" + string( x ) + "ENTER NAME"

But why is the text named x1 ?
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 24th Feb 2022 01:11 Edited at: 24th Feb 2022 01:12
Quote: "But why is the text named x1 ?"


Because I have a two For/Next loops in that snippet. One with "x" and the other "x1". One inside the other

I will try your suggestion and get back here and let you know if it worked. Thank you, Game_Code_here
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 24th Feb 2022 01:15 Edited at: 24th Feb 2022 01:17
Both For/Next loops access that CreateText statement

I put yours in and got the following:

EnterSirName.agc:73: error: Unexpected token "string"
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 24th Feb 2022 01:37
Well it is a string of data being added so it needs to be called.

If it is unexpected there's a reason for the unexpected part.

I wish I could help more but Do not know the rest of the code.

Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 24th Feb 2022 01:56 Edited at: 24th Feb 2022 02:01
Quote: "If it is unexpected there's a reason for the unexpected part.

I wish I could help more but Do not know the rest of the code."


I'm going to declare a variable as string and see if it work that way. I also if needed, I could post more of my code here.

My only problem is that both For/Next loop variables are integers. The "x" is tracking the number of players, the "x1" is used just to create more text objects
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
jd_zoo
5
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 24th Feb 2022 02:12
You need to convert your X integer variable to a string:

Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 24th Feb 2022 02:18
CreateText(x1, "MANAGER" + string( x ) + "ENTER NAME"

I added string not str lol

str is short for string, I figured you would understand.

I figure you just copied my code and ran it.
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 24th Feb 2022 02:21
Hi,

There are several flaws in your code.
- for each iteration of x, you're trying to create 8 texts using 3 to 8 as text ID, meaning when x reaches a value of 3, you're trying to create texts with text IDs you've already used when x was 2. This will throw an error
- you need to use str ( x ) when creating your texts
- you need an incremental counter so you have a unique text ID for every text you create
- you're positioning all texts at the same coordinates

Try running this code in a new project so you can see what I mean:




PSY


PSY LABS Games
Coders don't die, they just gosub without return
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 24th Feb 2022 02:26 Edited at: 24th Feb 2022 02:29
Quote: "I added string not str lol

str is short for string, I figured you would understand.

I figure you just copied my code and ran it.
"


Yea, I should have gotten that LOL

I changed it to Str(x) and it works

Quote: "Hi,

There are several flaws in your code.
- for each iteration of x, you're trying to create 8 texts using 3 to 8 as text ID, meaning when x reaches a value of 3, you're trying to create texts with text IDs you've already used when x was 2. This will throw an error
- you need to use str ( x ) when creating your texts
- you need an incremental counter so you have a unique text ID for every text you create
- you're positioning all texts at the same coordinates

Try running this code in a new project so you can see what I mean:"


I need "x" to start at 2 not 1 for the purpose of the game being a multiplayer not single player. Since I have 2 other text object being 1 and 2 is why the "x1" starts at 3
chances are is that I will reduce the amount of code I have in the function the snippet is a part of. I'm just getting a basic layout and then modify and reduce with more complex code
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 24th Feb 2022 02:37
That's ok, I had the same problem a couple days ago and got the answer I needed, I then read a lot on the issue of adding sting data and converting stings.

Here is my thread on it.

https://forum.thegamecreators.com/thread/228311
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 24th Feb 2022 02:53 Edited at: 24th Feb 2022 02:54
Quote: "That's ok, I had the same problem a couple days ago and got the answer I needed, I then read a lot on the issue of adding sting data and converting stings.

Here is my thread on it.

https://forum.thegamecreators.com/thread/228311
"



Cool, Thank you Game_Code_here

I will definitely check it out tomorrow after work. It's getting late here

And thank you to all the rest of you for your help. I will re-read this thread to catch things I may have missed someone said
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 24th Feb 2022 21:52 Edited at: 24th Feb 2022 21:52
Quote: "Since I have 2 other text object being 1 and 2 is why the "x1" starts at 3"


I know, but you're still using the same text IDs ( 3, 4, 5, 6, 7, 8, 9 and 10 ) for EACH player, which WILL throw an error.


PSY LABS Games
Coders don't die, they just gosub without return
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 25th Feb 2022 01:52 Edited at: 25th Feb 2022 10:58
Quote: "I know, but you're still using the same text IDs ( 3, 4, 5, 6, 7, 8, 9 and 10 ) for EACH player, which WILL throw an error."



I found that out LOL. Below is my entire #Include file. In the previous menu, you select how many players are going to player the game which is 1 to 8 players. Then it comes to this #Include file where the above code is found. Yes it is massive and I want to eventually reduce it down if possible, but for now I am getting the following error only when I choose 3 or more players.

The input code as far as detecting what number player is entering their name isn't there yet

Failed to add text 3 ID already exists in EnterSirName.agc at line 50



Not only that, but when I choose two players in the previous menu it wants to enter player two's name 3 times. I had it only doing it twice, but now 3
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 26th Feb 2022 03:05 Edited at: 26th Feb 2022 03:10
How can I fix my issue with the create text statement? It is saying text 3 already exists at line 55 which is the CreateText statement in my code. I was line 16



I guess I'm stumped. I don't see why it would say that because I'm not trying to CreateText 3 more than one time
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 26th Feb 2022 03:26 Edited at: 26th Feb 2022 03:27
Well I looked at your code and What I would do in the first place is create all my text objects together and settextvisible() on or off when I need them then delete them when not needed.

Also you are splitting your menu up into different functions and this also can cause errors.

But your problem is you are creating text in the loop.

Create everything before the loop and not as you need it and then you will see a big difference.

I could be wrong but this is what I see.

Also you can put in

ifgettextexist()=o then createtext()
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 26th Feb 2022 04:13 Edited at: 26th Feb 2022 04:27
Quote: " I'm not trying to CreateText 3 more than one time"

but you are; you are trying to create Text IDs 3-10 x many times.

when x = 2 To Account_Num_Players, x1 is going to = 3 (thru 10) each time:


this is a little different from your set up but hopefully displays a cleaner method to achieve what i think you're after:
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 26th Feb 2022 12:05 Edited at: 26th Feb 2022 12:06
Quote: "What I would do in the first place is create all my text objects together and settextvisible() on or off when I need them then delete them when not needed.

Also you are splitting your menu up into different functions and this also can cause errors.

But your problem is you are creating text in the loop.

Create everything before the loop and not as you need it and then you will see a big difference."


Game_Code_here, I will try what you have said after work today

Also, Virtual Nomad I think I understand your code other than the For/Next loop where it says For X = 1 to Num.

I don't see anywhere in your code where Num is set to a value or anywhere that it could receive a value from a key press unless you meant where the function is that says

Function AddPlayers(Num)
To be
Function AddPlayers(NumPlayers)

Which is a typo

I would like to try learn from your code to
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 26th Feb 2022 13:03 Edited at: 26th Feb 2022 13:07
if you look at User defined functions here: https://www.appgamekit.com/documentation/principles/4_functions.htm, we call Functions with up to 9 parameters.

The line:
AddPlayers(NumPlayers)

calls the function with a single Integer as the parameter, NumPlayers

i assume you understand that we defined NumPlayers in the loop above the function call.


in this case, the Function itself doesn't care what the variable name is that was passed into it. it only looks for a single Integer as its only parameter:


Num is just the Local variable i chose (it's just shorter than NumPlayers) which received the Integer passed into the Function.

So, Num = NumPlayers and the same function could have been written:



i hope that explanation helps (still on my first cup of coffee)
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 26th Feb 2022 14:06
Yes I understand we defined NumPlayers before in the loop. I believe I understand things now. I always thought that parameters in function title had to be exact, but I guess not lol. I have learned lol
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Feb 2022 14:10
You should let createText() generate the ID of each and assign its returned integer value to a variable. Much easier to manage and no worries of using duplicate IDs.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 26th Feb 2022 14:18 Edited at: 26th Feb 2022 14:21
short follow-up:

so far, NumPlayers has been a Local variable. since you'll probably use that value throughout the game, there are benefits to declaring it as a Global variable that functions can use, etc.

do you see how this might work?



Note the addition of:


...before we define it.

and now the AddPlayers() function doesn't need a parameter. it will simply reference whatever NumPlayers is set to Globally:

Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 26th Feb 2022 23:46 Edited at: 26th Feb 2022 23:49
Quote: "You should let createText() generate the ID of each and assign its returned integer value to a variable. Much easier to manage and no worries of using duplicate IDs."


Yea, I'm going to re write a lot of the code

Quote: "short follow-up:

so far, NumPlayers has been a Local variable. since you'll probably use that value throughout the game, there are benefits to declaring it as a Global variable that functions can use, etc.

do you see how this might work?"


Yes, I see how it might work. I usually declare all my variables global or at least most of them
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 27th Feb 2022 01:12
I had no clue we could change the text of a text object on the fly. That's sweet!
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 27th Feb 2022 23:03
Is there a way to load an image behind an text entry box started by StartTextInput()? I know you can change the background color using SetClearColor() before StartTextInput(), but I'd like to put an image if possible
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 27th Feb 2022 23:26 Edited at: 27th Feb 2022 23:27
if you want anything more than stock text input, i would get away from Text Input and opt for using Edit Boxes.

there, you have much more control and functionality including the ability to set its background image.
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 27th Feb 2022 23:32
Quote: "if you want anything more than stock text input, i would get away from Text Input and opt for using Edit Boxes

there, you have much more control and functionality including the ability to set its background image."



I thought I would have to do that, I had an EditBox in with an image behind it before I started this thread, but opted to change and now I want to change back, I need to figure out how to do the input connected to the EditBox now.

Thank you all for your help, I'm getting right on the EditBox stuff now lol
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 28th Feb 2022 02:35
This is how I do it in everything I write.

First I create my edit box



Then I add a variable to assign to my edit box value



Now with a edit box it is just a object sprite so you can add anything behind it or in front .

I didn't know if you knew so I thought I show you.

Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 28th Feb 2022 02:53
Quote: "
I didn't know if you knew so I thought I show you."


Yes, I have created a EditBox before, but it was just a basic one with a couple of commands not making it fancy or anything. I have not been able to get it working with detecting the input text yet. By the looks of your 2nd snippet, I must have not seen the GetEditBoxText() and SetEditBoxText() commands yet. I must have overlooked them lol

I've sat here for an hour trying different things to no avail lol.

Thank you Game_Code_here for showing me how you do it. I have learned a good amount of AppGameKit over the last 6 months or so, but I have a lot more to learn
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 28th Feb 2022 03:47 Edited at: 28th Feb 2022 05:15
Hmm, I'm not sure why I can't get the input text to work. I see the text typed out on screen, but when I press enter nothing happens. If I come up with something that exits the function(whether it works or not I don't know) I get an error saying an image can't be loaded because the ID is already in use in an #include file that hasn't been accessed yet
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 28th Feb 2022 05:24
Quote: "I see the text typed out on screen, but when I press enter nothing happens"


You just need to save the input as a variable.

The program as it runs keeps any text input into memory.

Quote: "I get an error saying an image can't be loaded because the ID is already in use in an #include file that hasn't been accessed yet"


I can not answer you there because I do not know all your code for every file but,

If you are using your include file after the creation of the text this could be the problem maybe.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 28th Feb 2022 09:17
I wrote this small example for you.

Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 28th Feb 2022 19:16 Edited at: 28th Feb 2022 19:18
Quote: "I wrote this small example for you"

I'm not sure if I told exactly what I was trying to do with this menu code I'm working on.

What I was refering to in my last post was that the text input by the user is being seen as I type it, but when I hit the enter key the cursor disappears and the program sits there and does nothing. It isn't moving on to the next thing.

The purpose of the input by the user is to input the name they want to use as the acount name that their game will be (at a later time of their choosing) saved under and used to play the game when they boot the game back up. I'm trying to set up the "manager name input screen" and up to 8 players can play. So if more than one person is playing, that is the purpose of changing the number in the text object to the next number as each player inputs their name.

Thank you Game_Code_here for the example. I will take a look at it today. I have been unsure what to put in the do/loop to get it to work. I tried for about 2 hours last night to no avail. I was trying to use the code you gave me with the array entry stuff in it and changing things to work with my variable names and editing out the code I don't need such as pressing keys 1-8 to choose the number of players because the previous menu before the one I'm currently working on is the one to choose how many players. It has 8 buttons to click on numbered 1-8 and that sets "Account_Num_Players" variable to the number of players that need to input their names on this screen. I ran your example in a test project and changed the variables needed to work with my code and it cycled through and printed all input names out perfectly at the end, but as you know I need to do this manually with creating a EditBox so I can put an image behind it and now getting it set up to save in an array to be able to save whenever desired isn't working yet. If I choose more than one player that is playing, it only lets me input one name and doesn't change text object above editbox to say the next player can input their name. As soon as I input the first name and hit enter the text stays there and cursor disappears and just sits there. I know I will eventually figure this out LOL. I want to have help, but don't want people to do my code for me for I'm not that way. I am learning it just takes time. Things were easy in DarkBasic Pro for something like this, but this is the same, but different in my opinion LOL
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 1st Mar 2022 03:07
Ok I see, sorry.

In this case I need to ask are you working on a server for players or home controller players?

But to be honest if I had to choose how many players with names I would set up many inputs more then one.

Then if there is a name in each input that is how many players, you can determine how many players due to how many names.

Not the only way but to me simple.

GetCurrentEditBox
Description
Returns the ID of the currently active edit box, only one edit box may focus at a time. If no edit box currently has focus it returns 0.

So if you click on a edit box that edit box has focus, then the player adds the name then the next edit box is clicked on, you will have to save each name differently due to each edit box.



Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 1st Mar 2022 04:28 Edited at: 1st Mar 2022 05:41
I updated the small example, not much but a great idea. Now you just check to see how many names are added to determine how many players before the game jump happens.



Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 1st Mar 2022 10:29
Thank you for the updated example. I'll try to look at it today. I didn't get a chance to look at the original one yesterday yet.
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 10th Mar 2022 00:39
Quote: "Ok I see, sorry.

In this case I need to ask are you working on a server for players or home controller players?

But to be honest if I had to choose how many players with names I would set up many inputs more then one.

Then if there is a name in each input that is how many players, you can determine how many players due to how many names.

Not the only way but to me simple.

GetCurrentEditBox
Description
Returns the ID of the currently active edit box, only one edit box may focus at a time. If no edit box currently has focus it returns 0.

So if you click on a edit box that edit box has focus, then the player adds the name then the next edit box is clicked on, you will have to save each name differently due to each edit box."


Sorry for not responding for awhile, I took some time away from this project to work on something else. I do that to clear my mind and take a break from something that is giving me trouble, then I come back to it.

Quote: "In this case I need to ask are you working on a server for players or home controller players?"


To answer this question, I want both local at home players and a (server eventually). First I want to get at home players going and then I will add a server later. I'd like to get the base game working first.
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 10th Mar 2022 19:48
Start here

GetRawJoystickExists
Description
Returns 1 if a joystick exists at the given index. Physical joysticks are detected at startup and placed in IDs 1-8 incrementally. You should call CompleteRawJoystickDetection at some point before this command to make sure that all present joysticks have been discovered. After the initial detection process plugging in additional joysticks will not be detected (except on Android which will detect new joysticks). Unplugging a joystick will not delete its index and this command will still return 1. You can use GetRawJoystickConnected to detect when a previously detected joystick is disconnected. If a disconnected joystick is reattached the AppGameKit will attempt to reconnect to it.

An alternative version of this command exists GetJoystickExists, in which case it will return 1 if there are any raw joysticks attached

Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 11th Mar 2022 14:19
I can't use that command because the game will not be playable with joysticks. Only mouse, keyboard or by touch. You won't be controlling any players on field in regards to moving them around and passing and kicking the ball. This will be strictly a coaching or manager game. At best you will be able to click a player on field and tell him to play forward, backwards, left or right more to accommodate for what the opposing team is doing. Them players will move strictly by AI according to their player attributes
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 11th Mar 2022 18:41
I see

Well that is easy enough,

Just structure the app to play due to each player.

If Player_1=1

do stuff

endif

Or even like this

for x=1 to 8

if Player[x].Exisit=1

do stuff

endif

next x

I would set up a type then a array for all players

Type Player
Num
Xpos
Ypos
endtype

That way You can control all aspects for each players conditions.

But I'm sure you probably figured all this out, Keep us posted, I would like to see how this turns out.

Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 12th Mar 2022 00:53 Edited at: 12th Mar 2022 00:53
Quote: "I see

Well that is easy enough,

Just structure the app to play due to each player.

If Player_1=1

do stuff

endif

Or even like this

for x=1 to 8

if Player[x].Exisit=1

do stuff

endif

next x

I would set up a type then a array for all players

Type Player
Num
Xpos
Ypos
endtype

That way You can control all aspects for each players conditions.

But I'm sure you probably figured all this out, Keep us posted, I would like to see how this turns out. "


Yea, I might do it one of those ways you suggested. I have thought about it some. I'm still working on the input stuff, I chose to use the default one that you can't use background image, but can change the color. I'm trying to get it to exit and go to the next screen, but having trouble figuring it out lol.
I will definitely keep everyone here updated how it's going.

Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.

Login to post a reply

Server time is: 2024-04-19 15:49:35
Your offset time is: 2024-04-19 15:49:35