# Basic Scripting Working Pretty Well! =)

## Recommended Posts

I just wanted to say thanks again for the help I've had from everyone here. The "scripting" system I'm working on is coming along well now. It can now print messages to the console (or just return the string in the 'print' command). It can also add, subtract, multiply, and divide numbers. It automatically recognizes decimal numbers, and performs the mathematical actions the the two numbers specified. I still haven't added support for using the math functions on my variable class. Right now, I have a simple application (SDL) that I created with the 2D/3D SDL engine I am working on right now. It draws a simple white rectangle. I created a 'rectScript.script' file. This file uses the variables 'mouseX' and 'mouseY' to move the rectangle to the coordinates of the mouse everytime I move the mouse. It's just a simple test. It works well, though. =) This is what the script looks like:

// This script is used to move the rectangle around the screen.
// The coordinates are to be set to the mouse's current
// position.

set_var rectX mouseX
set_var rectY mouseY


'rectX', 'rectY', 'mouseX', and 'mouseY' are variables I created with my 'MystVar' class, which is part of the engine. It is called the 'Mystique' engine, by the way. 'Mystique' is French for 'Mystic' or 'Mystical' also. Anyhow, the variable system is the same idea as it is in the Quake games from id Software. I downloaded the source code for QI, QII, and QIII: A/TA. That is where I got the idea. But theirs is all in C, and mine is OO in C++. Anyhow, that's all for now. Thanks again for the help. I'll be back, once again! =P

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627648
• Total Posts
2978393

• 10
• 12
• 22
• 13
• 33