Skip to main content
gamedev.net
🔒 Locked

Setting Variables Through Scripting

Started by HunterTKilla 0 replies 150+ views
Original Post
HunterTKilla
HunterTKilla
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!
IndirectX
IndirectX
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.
---visit #directxdev on afternet <- not just for directx, despite the name

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.