Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 1,151 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[SOLVED] - Undeclared identifier weird error #453177
07/10/15 11:26
07/10/15 11:26
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline OP
Member
CyberGhost  Offline OP
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
I made a panel to set the settings of my game. There's a function that saves the changes I've made in the settings (sound volume, ... etc.) into a text file. The problem is that the engine says that some variables are 'undeclared identifiers' although they are declared ...

It was working fine all the time ,and that happened when I changed some stuff in another script file that has nothing to do with the settings ....

Here's the function that saves the settings:

Code:
var settings_file_handle; //the problem is not with that variable, it is the next four variables 
var music_volume;
var sfx_volume;
var music_playable;
var sfx_playable;


function save_settings()
{
	
	
	
	settings_file_handle = file_open_write("settings.txt");
	   
	   //window/fullscreen
	   
	   file_var_write(settings_file_handle,video_screen);
	   
	   //Resolution
	   
	   file_var_write(settings_file_handle,video_mode);
	   
	   //MUSIC
	   
	   file_var_write(settings_file_handle,music_playable);
	   file_var_write(settings_file_handle,music_volume);
	   
	   //SFX
	   
	   file_var_write(settings_file_handle,sfx_playable);
	   file_var_write(settings_file_handle,sfx_volume);
	   
	   file_close(settings_file_handle);
}




Thank you and any help will be appreciated

Last edited by CyberGhost; 07/10/15 12:47.

Nothing to say ....
Re: Undeclared identifier weird error [Re: CyberGhost] #453178
07/10/15 11:55
07/10/15 11:55
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Where exactly do you get the error message, on script compiling? Can you write down the exact error message?
Do you have the variables declared before the function like in your post (maybe you have two save_settings() functions in your script)?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Undeclared identifier weird error [Re: Superku] #453179
07/10/15 12:35
07/10/15 12:35
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline OP
Member
CyberGhost  Offline OP
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
Originally Posted By: Superku
Where exactly do you get the error message, on script compiling?


Yes, while compiling.

Originally Posted By: Superku
Can you write down the exact error message?




Originally Posted By: Superku
Do you have the variables declared before the function like in your post (maybe you have two save_settings() functions in your script)?


Yes, it is. I have only one function. Btw., everytime I comment out the line that uses the variable, it tells me that another one is undeclared identifier. And then I comment it out, then it tells me that the panel itself (that was actually defined before the function too) is undeclared. I re-installed 3DGS ,but the problem persists. I have A8 v8.10.3 btw.


Nothing to say ....
Re: Undeclared identifier weird error [Re: CyberGhost] #453180
07/10/15 12:47
07/10/15 12:47
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline OP
Member
CyberGhost  Offline OP
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
Sorry, it turned out to be a missing-bracket typo grin


Nothing to say ....

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1