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"

+ Code Snippet
For x = 2 To Account_Num_Players
		For x1 = 3 To 10
			CreateText(x1, "MANAGER" + x + "ENTER NAME")
				SetTextSize(x1, 50)
					SetTextColor(x1, 250, 250, 0, 255)
						SetTextFont(x1, 1)
					TextW = GetTextTotalWidth(x1)
				SetTextPosition(x1, 512 - TextW / 2, 130)
			SetTextVisible(x1, 0)
		Next	
	Next


Are we not allowed to do that?
Posted: 24th Feb 2022 1:05
I learned that adding string before the plus sign works.

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

But why is the text named x1 ?
Posted: 24th Feb 2022 1:11
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
Posted: 24th Feb 2022 1:15
Both For/Next loops access that CreateText statement

I put yours in and got the following:

EnterSirName.agc:73: error: Unexpected token "string"
Posted: 24th Feb 2022 1: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.
Posted: 24th Feb 2022 1:56
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
Posted: 24th Feb 2022 2:12
You need to convert your X integer variable to a string:

+ Code Snippet
For x = 2 To Account_Num_Players
        For x1 = 3 To 10
            CreateText(x1, "MANAGER" + str(x) + "ENTER NAME")
                SetTextSize(x1, 50)
                    SetTextColor(x1, 250, 250, 0, 255)
                        SetTextFont(x1, 1)
                    TextW = GetTextTotalWidth(x1)
                SetTextPosition(x1, 512 - TextW / 2, 130)
            SetTextVisible(x1, 0)
        Next   
    Next
Posted: 24th Feb 2022 2: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.
Posted: 24th Feb 2022 2: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:

+ Code Snippet
SetVirtualResolution( 1024, 768 )

Account_Num_Players as integer = 5

For x = 1 To Account_Num_Players
	CreateText(x, "MANAGER" + str ( x ) + "ENTER NAME")
	SetTextSize(x, 50)
	SetTextColor(x, 250, 250, 0, 255)
	TextW = GetTextTotalWidth(x)
	SetTextPosition(x, 512 - TextW / 2, 130 * x)
	//SetTextVisible(x, 0)
Next

repeat
	sync()	
until GetRawKeyPressed ( 27 )
END



PSY
Posted: 24th Feb 2022 2:26
"


Yea, I should have gotten that LOL

I changed it to Str(x) and it works

ry 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
Posted: 24th Feb 2022 2: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
Posted: 24th Feb 2022 2:53
"



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
Posted: 24th Feb 2022 21:52
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.
Posted: 25th Feb 2022 1:52
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

+ Code Snippet
Function EnterSirName()
	
	If Account_Num_Players < 2
		Single_Player()
	Else
		MultiPlayer()
	Endif	
EndFunction

Function Single_Player()
		
	Menu_Background()
	
// text object 1--------------------------------------------------------------------------------------------			
		CreateText(1, "PLEASE ENTER NAME")                 // create the text used at top of menu
			SetTextSize(1, 50)                              // set text size
				`SetTextBold(1, 1)                           // set text to bold
					SetTextColor(1, 250, 250, 0, 255)            // set text color
				SetTextFont(1, 1)
			TextW = GetTextTotalWidth(1)                     // get text total width
		SetTextPosition(1, 512 - TextW / 2, 130)            // set text position to the center
	
// text object 2----------------------------------------------------------------------------------------------	
	CreateText(2, "Enter Name Here")           // create the text above the text edit box
		SetTextSize(2, 25)                    // set font size
			SetTextColor(2, 255, 175, 0, 255)   // set the text color
			SetTextFont(1, 1)
		TextW = GetTextTotalWidth(2)          // get text 2 total width
	SetTextPosition(2, 512 - TextW / 2, 285) // set text 2 to center of the screen

	Input_Player_Names()
	
EndFunction

// input text loop------------------------------------------------------------------


//-------------------------------------------------------------------------------------------------------------------------
// MULTIPLAYER FUNCTION---------------------------------------------------------------------------------------------------

Function MultiPlayer()
	
	Menu_Background()
	
	For x = 2 To Account_Num_Players
		For x1 = 3 To 10
			CreateText(x1, "MANAGER " + Str(x) + " ENTER NAME")
				SetTextSize(x1, 50)
					SetTextColor(x1, 250, 250, 0, 255)
						SetTextFont(x1, 1)
					TextW = GetTextTotalWidth(x1)
				SetTextPosition(x1, 512 - TextW / 2, 130)
			SetTextVisible(x1, 0)
		Next	
	Next
	
	If Account_Num_Players >= 2
		
		Select Sir_Name_Num
			
			Case Sir_Name_Num
				
				If Account_Num_Players = 2
					SetTextVisible(3, 1)              // PLAYER 1 ENTER NAME TEXT
						Input_Player_Names()            // PLAYER 1 INPUT
							SetTextVisible(3, 0)     // HIDE PLAYER 1 ENTER NAME TEXT
						SetTextVisible(4, 1)         // PLAYER 2 ENTER NAME TEXT
					Input_Player_Names()          // PLAYER 2 INPUT
				Endif
			EndCase
			
			Case Sir_Name_Num
				
				If Account_Num_Players = 3
					SetTextVisible(3, 1)              // player enter name text
						Input_Player_Names()            // player 1 input
							SetTextVisible(3, 0)     // hide player 1 enter name text
								SetTextVisible(4, 1)         // player 2 enter name text
								Input_Player_Names()          // player 2 input
							SetTextVisible(4, 0)           // hide player 2 enter name text
						SetTextVisible(5, 1)          // player 3 enter name text
					Input_Player_Names()           // player 3 input
				Endif
			EndCase
				
			Case Sir_Name_Num
				
				If Account_Num_Players = 4
					SetTextVisible(3, 1)              // player 1 enter name text
						Input_Player_Names()            // player 1 input
							SetTextVisible(3, 0)     // hide player 1 enter name text
								SetTextVisible(4, 1)         // player 2 enter name text
									Input_Player_Names()          // player 2 input
										SetTextVisible(4, 0)           // hide player 2 enter name text
									SetTextVisible(5, 1)          // player 3 enter name text
								Input_Player_Names()           // player 3 input
							SetTextVisible(5, 0)              // hide player 3 enter name text
						SetTextVisible(6, 1)               // player 4 enter name text
					Input_Player_Names()           // player 4 input
				Endif
			EndCase
				
			Case Sir_Name_Num
				
				If Account_Num_Players = 5
					SetTextVisible(3, 1)              // player 1 enter name text
						Input_Player_Names()            // player 1 input
							SetTextVisible(3, 0)     // hide player 1 enter name text
								SetTextVisible(4, 1)         // player 2 enter name text
									Input_Player_Names()          // player 2 input
										SetTextVisible(4, 0)           // hide player 2 enter name text
											SetTextVisible(5, 1)          // player 3 enter name text
										Input_Player_Names()           // player 3 input
									SetTextVisible(5, 0)              // hide player 3 enter name text
								SetTextVisible(6, 1)               // player 4 enter name text
							Input_Player_Names()           // player 4 input
						SetTextVisible(6, 0)                // hide player 4 enter name text
					SetTextVisible(7, 1)                 // player 5 enter name text
					Input_Player_Names()             // player 5 input
				Endif
			EndCase
				
			Case Sir_Name_Num
				
				If Account_Num_Players = 6
					SetTextVisible(3, 1)                  // player 1 enter name text
						Input_Player_Names()             // player 1 input
							SetTextVisible(3, 0)           // hide player 1 enter name text
								SetTextVisible(4, 1)            // player 2 enter name text
									Input_Player_Names()          // player 2 input
										SetTextVisible(4, 0)           // hide player 2 enter name text
											SetTextVisible(5, 1)          // player 3 enter name text
												Input_Player_Names()           // player 3 input
													SetTextVisible(5, 0)              // hide player 3 enter name text
												SetTextVisible(6, 1)               // player 4 enter name text
											Input_Player_Names()           // player 4 input
										SetTextVisible(6, 0)                // hide player 4 enter name text
									SetTextVisible(7, 1)                 // player 5 enter name text
								Input_Player_Names()             // player 5 input
							SetTextVisible(7, 0)                // hide player 5 enter name text
						SetTextVisible(8, 1)                    // player 6 player name text
					Input_Player_Names()                    // player 6 input
				Endif
			EndCase
				
			Case Sir_Name_Num
				
				If Account_Num_Players = 7
					SetTextVisible(3, 1)                  // player 1 enter name text
						Input_Player_Names()             // player 1 input
							SetTextVisible(3, 0)           // hide player 1 enter name text
								SetTextVisible(4, 1)            // player 2 enter name text
									Input_Player_Names()          // player 2 input
										SetTextVisible(4, 0)           // hide player 2 enter name text
											SetTextVisible(5, 1)          // player 3 enter name text
												Input_Player_Names()           // player 3 input
													SetTextVisible(5, 0)              // hide player 3 enter name text
														SetTextVisible(6, 1)               // player 4 enter name text
														Input_Player_Names()           // player 4 input
													SetTextVisible(6, 0)                // hide player 4 enter name text
												SetTextVisible(7, 1)                 // player 5 enter name text
											Input_Player_Names()             // player 5 input
										SetTextVisible(7, 0)                // hide player 5 enter name text
									SetTextVisible(8, 1)                    // player 6 player name text
								Input_Player_Names()                    // player 6 input
							SetTextVisible(8, 0)                 // hide player 6 player name text
						SetTextVisible(9, 1)                // player 7 enter name text
					Input_Player_Names()             // player 7 input
				Endif
			EndCase
				
			Case Sir_Name_Num
				
				If Account_Num_Players = 8
					SetTextVisible(3, 1)                  // player 1 enter name text
						Input_Player_Names()             // player 1 input
							SetTextVisible(3, 0)           // hide player 1 enter name text
								SetTextVisible(4, 1)            // player 2 enter name text
									Input_Player_Names()          // player 2 input
										SetTextVisible(4, 0)           // hide player 2 enter name text
											SetTextVisible(5, 1)          // player 3 enter name text
												Input_Player_Names()           // player 3 input
													SetTextVisible(5, 0)              // hide player 3 enter name text
														SetTextVisible(6, 1)               // player 4 enter name text
															Input_Player_Names()           // player 4 input
																SetTextVisible(6, 0)                // hide player 4 enter name text
															SetTextVisible(7, 1)                 // player 5 enter name text
														Input_Player_Names()             // player 5 input
													SetTextVisible(7, 0)                // hide player 5 enter name text
												SetTextVisible(8, 1)                    // player 6 player name text
											Input_Player_Names()                    // player 6 input
										SetTextVisible(8, 0)                 // hide player 6 player name text
									SetTextVisible(9, 1)                // player 7 enter name text
								Input_Player_Names()             // player 7 input
							SetTextVisible(9, 0)                 // hide player 7 player name text
						SetTextVisible(10, 1)   	           // player 8 enter name text
					Input_Player_Names()             // player 8 input
				Endif
			EndCase
				
		EndSelect
									
	Endif
	 
	Input_Player_Names()
	
	
	DeleteAllImages()            // delete menu background image
	DeleteAllSprites()            // delete sprite created from background image
	DeleteEditBox(1)            // delete editbox
	DeleteAllText()
	DeleteEditBox(1)   
	
	
EndFunction

Function Input_Player_Names()
	
	StartTextInput ( )
	text$ = ""
	
	Repeat   
		  
			If GetTextInputCompleted () = 1
				text$ = GetTextInput ()
			endif

		Print (text$)

		Sync()                       // refresh the screen
	 Until GetTextInputCompleted() = 1
	
EndFunction


// MenuBackground-------------------------------------------------
Function Menu_Background()

	LoadImageResized(1, "football.png", 0.5, 1.0, 0)                     // load background image
	   CreateSprite(1, 1)   
	   SetSpriteSize(1, 1024, 768)
	SetSpritePosition(1, 0, 0)                       // set background sprite postion

EndFunction	


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
Posted: 26th Feb 2022 3:05
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

+ Code Snippet
// ENTER SIRNAME SCREEN FUNCTION-----------------------------------------------------------

Function EnterSirName()
	
	If Account_Num_Players < 2
		Single_Player()
	Else
		MultiPlayer()
	Endif	
EndFunction

Function Single_Player()
		
	Menu_Background()
	
// text object 1--------------------------------------------------------------------------------------------			
		CreateText(1, "PLEASE ENTER NAME")                 // create the text used at top of menu
			SetTextSize(1, 50)                              // set text size
				`SetTextBold(1, 1)                           // set text to bold
					SetTextColor(1, 250, 250, 0, 255)            // set text color
				SetTextFont(1, 1)
			TextW = GetTextTotalWidth(1)                     // get text total width
		SetTextPosition(1, 512 - TextW / 2, 130)            // set text position to the center
	
// text object 2----------------------------------------------------------------------------------------------	
	CreateText(2, "Enter Name Here")           // create the text above the text edit box
		SetTextSize(2, 25)                    // set font size
			SetTextColor(2, 255, 175, 0, 255)   // set the text color
			SetTextFont(1, 1)
		TextW = GetTextTotalWidth(2)          // get text 2 total width
	SetTextPosition(2, 512 - TextW / 2, 285) // set text 2 to center of the screen

	Input_Player_Names()
	
	DeleteAllSprites()
	DeleteAllImages()
	DeleteAllText()
	
EndFunction

// input text loop------------------------------------------------------------------


//-------------------------------------------------------------------------------------------------------------------------
// MULTIPLAYER FUNCTION---------------------------------------------------------------------------------------------------

Function MultiPlayer()
	
	Menu_Background()
	
	For x = 2 To Account_Num_Players
		For x1 = 3 To 10
			CreateText(x1, "MANAGER " + Str(x) + " ENTER NAME")
				SetTextSize(x1, 50)
					SetTextColor(x1, 250, 250, 0, 255)
						SetTextFont(x1, 1)
					TextW = GetTextTotalWidth(x1)
				SetTextPosition(x1, 512 - TextW / 2, 130)
			SetTextVisible(x1, 0)
		Next x1	
	Next x
	
	If Account_Num_Players >= 2
		
		Select Sir_Name_Num
			
			Case Sir_Name_Num
				
				If Account_Num_Players = 2
					SetTextVisible(3, 1)             // PLAYER 1 ENTER NAME TEXT
						Input_Player_Names()            // PLAYER 1 INPUT
							SetTextVisible(3, 0)     // HIDE PLAYER 1 ENTER NAME TEXT
						SetTextVisible(4, 1)         // PLAYER 2 ENTER NAME TEXT
					Input_Player_Names()          // PLAYER 2 INPUT
				Endif
			EndCase
			
			Case Sir_Name_Num
				
				If Account_Num_Players = 3
					SetTextVisible(3, 1)              // player enter name text
						Input_Player_Names()            // player 1 input
							SetTextVisible(3, 0)     // hide player 1 enter name text
								SetTextVisible(4, 1)         // player 2 enter name text
								Input_Player_Names()          // player 2 input
							SetTextVisible(4, 0)           // hide player 2 enter name text
						SetTextVisible(5, 1)          // player 3 enter name text
					Input_Player_Names()           // player 3 input
				Endif
			EndCase
				
			Case Sir_Name_Num
				
				If Account_Num_Players = 4
					SetTextVisible(3, 1)              // player 1 enter name text
						Input_Player_Names()            // player 1 input
							SetTextVisible(3, 0)     // hide player 1 enter name text
								SetTextVisible(4, 1)         // player 2 enter name text
									Input_Player_Names()          // player 2 input
										SetTextVisible(4, 0)           // hide player 2 enter name text
									SetTextVisible(5, 1)          // player 3 enter name text
								Input_Player_Names()           // player 3 input
							SetTextVisible(5, 0)              // hide player 3 enter name text
						SetTextVisible(6, 1)               // player 4 enter name text
					Input_Player_Names()           // player 4 input
				Endif
			EndCase
				
			Case Sir_Name_Num
				
				If Account_Num_Players = 5
					SetTextVisible(3, 1)              // player 1 enter name text
						Input_Player_Names()            // player 1 input
							SetTextVisible(3, 0)     // hide player 1 enter name text
								SetTextVisible(4, 1)         // player 2 enter name text
									Input_Player_Names()          // player 2 input
										SetTextVisible(4, 0)           // hide player 2 enter name text
											SetTextVisible(5, 1)          // player 3 enter name text
										Input_Player_Names()           // player 3 input
									SetTextVisible(5, 0)              // hide player 3 enter name text
								SetTextVisible(6, 1)               // player 4 enter name text
							Input_Player_Names()           // player 4 input
						SetTextVisible(6, 0)                // hide player 4 enter name text
					SetTextVisible(7, 1)                 // player 5 enter name text
					Input_Player_Names()             // player 5 input
				Endif
			EndCase
				
			Case Sir_Name_Num
				
				If Account_Num_Players = 6
					SetTextVisible(3, 1)                  // player 1 enter name text
						Input_Player_Names()             // player 1 input
							SetTextVisible(3, 0)           // hide player 1 enter name text
								SetTextVisible(4, 1)            // player 2 enter name text
									Input_Player_Names()          // player 2 input
										SetTextVisible(4, 0)           // hide player 2 enter name text
											SetTextVisible(5, 1)          // player 3 enter name text
												Input_Player_Names()           // player 3 input
													SetTextVisible(5, 0)              // hide player 3 enter name text
												SetTextVisible(6, 1)               // player 4 enter name text
											Input_Player_Names()           // player 4 input
										SetTextVisible(6, 0)                // hide player 4 enter name text
									SetTextVisible(7, 1)                 // player 5 enter name text
								Input_Player_Names()             // player 5 input
							SetTextVisible(7, 0)                // hide player 5 enter name text
						SetTextVisible(8, 1)                    // player 6 player name text
					Input_Player_Names()                    // player 6 input
				Endif
			EndCase
				
			Case Sir_Name_Num
				
				If Account_Num_Players = 7
					SetTextVisible(3, 1)                  // player 1 enter name text
						Input_Player_Names()             // player 1 input
							SetTextVisible(3, 0)           // hide player 1 enter name text
								SetTextVisible(4, 1)            // player 2 enter name text
									Input_Player_Names()          // player 2 input
										SetTextVisible(4, 0)           // hide player 2 enter name text
											SetTextVisible(5, 1)          // player 3 enter name text
												Input_Player_Names()           // player 3 input
													SetTextVisible(5, 0)              // hide player 3 enter name text
														SetTextVisible(6, 1)               // player 4 enter name text
														Input_Player_Names()           // player 4 input
													SetTextVisible(6, 0)                // hide player 4 enter name text
												SetTextVisible(7, 1)                 // player 5 enter name text
											Input_Player_Names()             // player 5 input
										SetTextVisible(7, 0)                // hide player 5 enter name text
									SetTextVisible(8, 1)                    // player 6 player name text
								Input_Player_Names()                    // player 6 input
							SetTextVisible(8, 0)                 // hide player 6 player name text
						SetTextVisible(9, 1)                // player 7 enter name text
					Input_Player_Names()             // player 7 input
				Endif
			EndCase
				
			Case Sir_Name_Num
				
				If Account_Num_Players = 8
					SetTextVisible(3, 1)                  // player 1 enter name text
						Input_Player_Names()             // player 1 input
							SetTextVisible(3, 0)           // hide player 1 enter name text
								SetTextVisible(4, 1)            // player 2 enter name text
									Input_Player_Names()          // player 2 input
										SetTextVisible(4, 0)           // hide player 2 enter name text
											SetTextVisible(5, 1)          // player 3 enter name text
												Input_Player_Names()           // player 3 input
													SetTextVisible(5, 0)              // hide player 3 enter name text
														SetTextVisible(6, 1)               // player 4 enter name text
															Input_Player_Names()           // player 4 input
																SetTextVisible(6, 0)                // hide player 4 enter name text
															SetTextVisible(7, 1)                 // player 5 enter name text
														Input_Player_Names()             // player 5 input
													SetTextVisible(7, 0)                // hide player 5 enter name text
												SetTextVisible(8, 1)                    // player 6 player name text
											Input_Player_Names()                    // player 6 input
										SetTextVisible(8, 0)                 // hide player 6 player name text
									SetTextVisible(9, 1)                // player 7 enter name text
								Input_Player_Names()             // player 7 input
							SetTextVisible(9, 0)                 // hide player 7 player name text
						SetTextVisible(10, 1)   	           // player 8 enter name text
					Input_Player_Names()             // player 8 input
				Endif
			EndCase
				
		EndSelect
									
	Endif
	 
	Input_Player_Names()
	
	
	DeleteAllImages()            // delete menu background image
	DeleteAllSprites()            // delete sprite created from background image
	DeleteEditBox(1)            // delete editbox
	DeleteAllText()
	DeleteEditBox(1)   
	
	
EndFunction

Function Input_Player_Names()
	
	StartTextInput ( )
	text$ = ""
	
	Repeat   
		  
			If GetTextInputCompleted () = 1
				text$ = GetTextInput ()
			endif

		Print (text$)

		Sync()                       // refresh the screen
	 Until GetTextInputCompleted() = 1
	
	
	         // delete editbox
	
EndFunction


// MenuBackground-------------------------------------------------
Function Menu_Background()

	LoadImageResized(1, "football.png", 0.5, 1.0, 0)                     // load background image
	   CreateSprite(1, 1)   
	   SetSpriteSize(1, 1024, 768)
	SetSpritePosition(1, 0, 0)                       // set background sprite postion

EndFunction	


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
Posted: 26th Feb 2022 3:26
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()
Posted: 26th Feb 2022 4:13
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:
+ Code Snippet
    For x = 2 To Account_Num_Players
        For x1 = 3 To 10
            CreateText(x1, "MANAGER " + Str(x) + " ENTER NAME")
...
        Next x1 
    Next x


this is a little different from your set up but hopefully displays a cleaner method to achieve what i think you're after:
+ Code Snippet
SetWindowSize( 1280,720, 0 )
SetWindowAllowResize( 1 )

// set display properties
SetVirtualResolution( 1280,720)
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 30, 0 ) 
SetScissor( 0,0,0,0 )
UseNewDefaultFonts( 1 )

GLOBAL Players as String []
GLOBAL MaxPlayers = 8

Repeat
	Print("Number of Players? (1-"+STR(MaxPlayers)+")")
	NumPlayers = VAL( CHR (GetRawLastKey()) )
	Sync()
Until NumPlayers > 0 and NumPlayers <= MaxPlayers

AddPlayers(NumPlayers)

do

    If GetRawKeyState(27) then End    

    For x = 0 to Players.Length
		Print("Player "+STR(x+1) + ": " + Players[x])
	Next x
    Sync()
loop

Function AddPlayers(Num)
	TempTextID = CreateText("")
		SetTextSize(TempTextID,36)
		SetTextPosition(TempTextID, 100,50)
	For x = 1 to Num
		SetTextString(TempTextID, "Enter Player " + STR(x) + " Name:")
		ThisPlayerName$ = Input_Player_Name()
		Players.Insert(ThisPlayerName$)
	Next x
	DeleteText(TempTextID)
EndFunction

Function Input_Player_Name()
    StartTextInput ( )
    Repeat
		Name$ = GetTextInput ()
        Sync()
    Until GetTextInputCompleted() = 1
 EndFunction Name$
Posted: 26th Feb 2022 12:05
reate 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
Posted: 26th Feb 2022 13:03
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.
+ Code Snippet
Repeat
    Print("Number of Players? (1-"+STR(MaxPlayers)+")")
    NumPlayers = VAL( CHR (GetRawLastKey()) )
    Sync()
Until NumPlayers > 0 and NumPlayers <= MaxPlayers


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:
+ Code Snippet
Function AddPlayers(Num)
	TempTextID = CreateText("")
		SetTextSize(TempTextID,36)
		SetTextPosition(TempTextID, 100,50)
	For x = 1 to Num
		SetTextString(TempTextID, "Enter Player " + STR(x) + " Name:")
		ThisPlayerName$ = Input_Player_Name()
		Players.Insert(ThisPlayerName$)
	Next x
	DeleteText(TempTextID)
EndFunction


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:

+ Code Snippet
Function AddPlayers(NumPlayers)
	TempTextID = CreateText("")
		SetTextSize(TempTextID,36)
		SetTextPosition(TempTextID, 100,50)
	For x = 1 to NumPlayers
		SetTextString(TempTextID, "Enter Player " + STR(x) + " Name:")
		ThisPlayerName$ = Input_Player_Name()
		Players.Insert(ThisPlayerName$)
	Next x
	DeleteText(TempTextID)
EndFunction


i hope that explanation helps (still on my first cup of coffee)
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