Sign in to follow this  

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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this