This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
scripting:ccm [2006-08-20 15:07] Carsten created |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== The ccm Library ====== | ||
- | |||
- | The functions of the ''ccm'' (Console Command Manager) library allow you to run console functions and to set and get the values of console variables as if they had been typed into the Ca3DE in-game console by the user. | ||
- | |||
- | |||
- | ===== Functions ===== | ||
- | |||
- | ==== ExecuteCommand(s) ==== | ||
- | |||
- | Executes the console command ''s'' as if the user had typed it to the Ca3DE in-game console directly. | ||
- | Use this to run console functions and to set the values of console variables. | ||
- | |||
- | <code lua> | ||
- | -- Example 1: | ||
- | -- Set the value of the convar "quit" to true. | ||
- | ccm.ExecuteCommand("quit 1"); | ||
- | |||
- | -- Example 2: | ||
- | -- Run the confunc "list" with the parameter "he". | ||
- | ccm.ExecuteCommand("list he"); | ||
- | </code> | ||
- | |||
- | |||
- | ==== GetValue(s) ==== | ||
- | |||
- | Retrieves the value of the convar ''s''. | ||
- | The returned value can be of type ''string'', ''integer'', ''boolean'' or ''number'', depending on the type of the convar, or ''nil'' if a convar with name ''s'' does not exist. | ||
- | |||
- | <code lua> | ||
- | -- Example: | ||
- | showFrames=ccm.GetValue("showFPS"); | ||
- | </code> | ||