Advertisement

Stack based scripting language

Started by September 21, 2000 02:41 PM
0 comments, last by Yanroy 24 years, 3 months ago
Ok... Of all the different scripting projects I have undertaken, I can actually make this one work. I know it. I am going to make a REALLY screwed up ASM interpreter, with some java and basic thrown in for good measure, something like this: 60% improper ASM, core language 25% BASIC, string manipulation, goto, gosub 10% Java, class-like system of accessing stack and registers 5% Other cool features grabbed from different places I am going to make it instantly interpretable, so I can do a command line type thing. I am also going to have "fields" which are pointers to data stored in the native C++ program. They can be accessed and changed. Just one problem... If my C++ program that uses the scripting language is OO, and the scripting language isn''t, after I pass all of the members of the main class to the script, how do I know what other elements the script needs (aka a player standing next to the main character, a tree, AI code that runs in the background)? I can''t have the script ask for it, because then I would need to have a WindowProc() type function passed into the script, which would mean one script per object, instead of one script per class or even per game. The language would be used for things like magical spells or trade centers on undiscovered planets. Even as the AI for an added-in creature. It has the ability to call native C++ functions, but can''t pass any parameters. Its only real connection with the "real" world are the fields. --------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.

--------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming
You are unique. Just like everybody else.
"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor

Yanroy@usa.com

quote: Original post by Yanroy

Ok... Of all the different scripting projects I have undertaken, I can actually make this one work. I know it. I am going to make a REALLY screwed up ASM interpreter, with some java and basic thrown in for good measure, something like this:

60% improper ASM, core language
25% BASIC, string manipulation, goto, gosub
10% Java, class-like system of accessing stack and registers
5% Other cool features grabbed from different places

I am going to make it instantly interpretable, so I can do a command line type thing. I am also going to have "fields" which are pointers to data stored in the native C++ program. They can be accessed and changed. Just one problem... If my C++ program that uses the scripting language is OO, and the scripting language isn''t, after I pass all of the members of the main class to the script, how do I know what other elements the script needs (aka a player standing next to the main character, a tree, AI code that runs in the background)? I can''t have the script ask for it, because then I would need to have a WindowProc() type function passed into the script, which would mean one script per object, instead of one script per class or even per game.

The language would be used for things like magical spells or trade centers on undiscovered planets. Even as the AI for an added-in creature. It has the ability to call native C++ functions, but can''t pass any parameters. Its only real connection with the "real" world are the fields.

--------------------


You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.




In my opinion, you are using a backwards way to impliment scripting. Its hard to understand what you are saying. But I think you are attempting to run the scripts as local functions. Instead make all objects or fields you pass to the scripting system globals and manipulate these globals inside the language. Just a guess.






cmaker

- its not the principle. its the money.
cmaker- I do not make clones.

This topic is closed to new replies.

Advertisement