Jump to content
  • Advertisement
  • entries
  • comments
  • views

Scripting update

Sign in to follow this  


The compiler for the scripting virtual machine is finished. It supports a very basic C-like syntax but with C++ reference parameters and C99-ish declare-local-variables-anywhere sort of thing.

The only flow-control supported at the moment are if/else and while statements and I haven't bothered with static local variables at the moment since I doubt they'll be needed.

You can do stuff like:


int value()
return 10;

proc 123
int x=10;

out x,"\n";

f(int &a)

The vm calles back an output function when you print with the out command, so unless you supply one nothing happens. It's there more for debugging the compiler.

As planned, you have service() and register() commands for interfacing with the owning application, so if, say, service 22 returned the player X position in register 3, you can wrap it in a script function and call it like:

int getplayerx()
service(22); return register(3);

activate(int id)
register(0)=id; service(19);

proc 0

Actually, while typing this, I've just remembered that I haven't actually implemented the comparison or logical operators yet, so I best go get on with that really.

[EDIT] Sorted. Now just need to integrate it into Udo.
Sign in to follow this  


Recommended Comments

There are no comments to display.

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
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!