Archived

This topic is now archived and is closed to further replies.

HunterTKilla

Setting Variables Through Scripting

Recommended Posts

HunterTKilla    122
I am making a game and thought it would be a good idea not to hard code some physics values, hp values, etc. I figured I could use config files. They would look somthing like this Gravity 200 P1Hp 100 P2Hp 100 P1Ammo 150 P2Ammo 150 ShowIntro false Is there a function that I could pass a variable name into, and a value then it would set the value to the variable, because i do not want to have to hardcode the varaibles in. Thanks for your time!

Share this post


Link to post
Share on other sites
IndirectX    122
You can try Windows .ini files and Get/WritePrivateProfileInt/String. You may write your own ini file parser that will i.e. handle floating-point values, but these functions are already present and are very easy to use.

Share this post


Link to post
Share on other sites