• Advertisement

Archived

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

Setting Variables Through Scripting

This topic is 5705 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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

  • Advertisement