Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use C as a scripting language for my engine?

Tags:

c

scripting

lua

I have a game engine right now and I'm looking for a scripting language for it. I tried Lua and find it quite good but I want to have my script to look like C or better C++ or look like unreal engine's script would be better.

Is that even possible?

like image 935
Dark Avatar asked May 24 '11 10:05

Dark


1 Answers

Sure you can :P You can do everything if you want to.

I currently see these three ways:

  • Either you write the code yourself to parse the C/C++-Code, which really isn't an easy task
  • You use a parser which analyzes and interprets C-Code. Ch Standard edition should do the trick as it can be included in own projects as a scripting language.
  • Another way would be to create a script which dynamically compiles the user-generated code to a shared library which is dynamically loaded by your engine. Although this wouldn't be "scripting" anymore.
like image 121
Atmocreations Avatar answered Oct 13 '22 00:10

Atmocreations