Advertisement Jump to content
Sign in to follow this  

Basic Scripting Working Pretty Well! =)

This topic is 4921 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 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
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!