User Tools

Site Tools


en:tutorials:retrieving_changing_config_values

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:tutorials:retrieving_changing_config_values [2018/02/14 04:46 (2 years ago)]
iarwain ↷ Page moved from tutorials:retrieving_changing_config_values to en:tutorials:retrieving_changing_config_values
en:tutorials:retrieving_changing_config_values [2019/03/25 14:29 (14 months ago)]
iarwain Fixed parameter to orxConfig_GetListString call
Line 59: Line 59:
 Please note that this only changes the value in memory. Your ''​Level''​ property in your config file stored on disk is not affected. When your application is restarted, the original values are loaded back from the configuration files in your filesystem. Please note that this only changes the value in memory. Your ''​Level''​ property in your config file stored on disk is not affected. When your application is restarted, the original values are loaded back from the configuration files in your filesystem.
  
-If you are interested in persisting values back to disk in a separate config file, see [[tutorials:​save_games|Saving Game information to the Config]].+If you are interested in persisting values back to disk in a separate config file, see [[en:tutorials:​save_games|Saving Game information to the Config]].
  
  
Line 77: Line 77:
  
 <code c> <code c>
- orxConfig_PushSection("​Scene"); + orxConfig_PushSection("​Runtime"); 
- const orxSTRING value = orxConfig_GetListString("​ChildList", ​3);+ const orxSTRING value = orxConfig_GetListString("​Titles", ​2);
  orxConfig_PopSection();​  orxConfig_PopSection();​
 </​code>​ </​code>​
  
-You can also choose a random value from the list by supplying ​an orxNULL value instead of an index int:+You can also choose a random value from the list by supplying ​a -1 index value:
  
 <code c> <code c>
- orxConfig_PushSection("​Scene"); + orxConfig_PushSection("​Runtime"); 
- const orxSTRING value = orxConfig_GetListString("​ChildList", ​orxNULL);+ const orxSTRING value = orxConfig_GetListString("​Titles", ​-1); 
 + orxConfig_PopSection();​ 
 +</​code>​ 
 + 
 +An alternative way to get a random value from a list is to instead use ''​orxConfig_GetString'':​ 
 + 
 +<code c> 
 + orxConfig_PushSection("​Runtime"​);​ 
 + const orxSTRING value = orxConfig_GetString("​Titles"​);
  orxConfig_PopSection();​  orxConfig_PopSection();​
 </​code>​ </​code>​
en/tutorials/retrieving_changing_config_values.txt · Last modified: 2019/03/25 17:29 (14 months ago) (external edit)