Skip to main content
gamedev.net
🔒 Locked

basic scripting using text files, how to?

Started by HexDump Jul 20, 2002 at 7:41 AM 0 replies 150+ views
Original Post
HexDump
HexDump
Hello, I would like to have some text files with a basic grammar in order to define objects, etc... from this files. The thing is that I would like to make something abstract to not hardcode every keyword, etc... to use in differents modules, like particle systems (it will have its own grammar), objects creations (its own grammar too), etc... Is there anyway to abstract things this way? any way to templatize?. I think that what I need is a configurable lexer/semantic analizer that when detects a correct stament just like for example: Object_Definition "Ghoul" { Set energy=100;}; call in my C object loader something like: ObjectMgr->CreateEntity("Ghoul"); ObjectMgr->SetProperty("energy",100); or something like that could anybody give any tip pls? NOTE: make a VM/complete script system is too dificult and time consuming for me know, so it is not an option. Thnx in advance. HexDump.
Mulligan
Mulligan
The only tip I could give you is to realize that for what you want to do, it really is necessary to create a somewhat complicated script system. You probably have read the four part tutorial about scripting in the articles section, and found it to be a bit extreme for what you want to do, but the thing is, the more complicated and longer you work on the scripting system, the easier it will be to make easy scripts.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.