• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

moboko

LUA-script gives: unexpected symbol near ' '

9 posts in this topic

Hello, I am new to Lua and when I run the following code, I always get the same errormessage saying: "test.lua:1: unexpected symbol near '' '' ".. Am I forgeting something?.. Here is my samplecode: #include <iostream.h> extern "C" { #include <lua.h> #include <lauxlib.h> #include <lualib.h> } #include <luabind/luabind.hpp> using namespace luabind; class CTest { public: CTest(){}; void Boo(){ cout << "LLaP"; } }; int main( int argc , char* argv []) { lua_State* luaVM = lua_open(); luabind::open( luaVM); module( luaVM) [ class_("Test") .def(constructor<>()) .def("Boo", &CTest::Boo) ]; lua_dofile( luaVM, "test.lua"); lua_close( luaVM); cin.get(); return 0; } *----- test.lua -----* T = Test() T:Boo()
0

Share this post


Link to post
Share on other sites
I changed it in #include <iostream> but when I do that I''ll get compiler-errors :

error C2065: ''cout'' : undeclared identifier
error C2297: ''<<'' : illegal, right operand has type ''char [5]''
error C2065: ''cin'' : undeclared identifier
error C2228: left of ''.get'' must have class/struct/union type
Error executing cl.exe.
0

Share this post


Link to post
Share on other sites
Of course... using namespace std!
I changed it and it compiled but I still get the former error:
test.lua:1: unexpected symbol near '' '' ... I don''t understand why...
0

Share this post


Link to post
Share on other sites
quote:
Original post by moboko
Of course... using namespace std!
I changed it and it compiled but I still get the former error:
test.lua:1: unexpected symbol near '' '' ... I don''t understand why...


I can''t really take a peek at the code just yet to see what''s going on. I''m in the midst of a move right now across the country and my home gear is still in transit. I''ll take a peek at the problem here in the next couple of days (when my stuff lands), unless you get a fix before hand.
0

Share this post


Link to post
Share on other sites
Okay, thx for the effort Ashley Matheson... good luck with your "translation" through the country.... I''ll have cleaned and rebuild the Lua5.0 and the luabind-b6 libs. Tomorrow I''ll test them and see if I''ll get the same error...
0

Share this post


Link to post
Share on other sites
Aaaah.... I solved the problem... I used notepad and/or wordpad to edit my scriptfiles, these editors set extra control-characters in the files invisible to the eye, but visible to
the lua-interpreter... using my plain old dos-edit solves the problem :-)....
0

Share this post


Link to post
Share on other sites
quote:
Original post by moboko
Aaaah.... I solved the problem... I used notepad and/or wordpad to edit my scriptfiles, these editors set extra control-characters in the files invisible to the eye, but visible to
the lua-interpreter... using my plain old dos-edit solves the problem :-)....


Really? I've never had that problem with lua. Even older version.

And it's Ash.



[edited by - ashleymatheson on January 23, 2004 5:13:38 PM]
0

Share this post


Link to post
Share on other sites
So You didn''t have this problem I had with the control-chars Mr. Ashley?.... hmmm, that sounds strange indeed... I noticed by accident that the filesize was different between 2 lua-scripts that looked apparently the "same"... So I opened the file that had a bigger size and saw a couple of extra control-chars in it.... The only thing I noticed aside from this was when I used "setlocale( LC_ALL, NULL);" before the lua_dofile... the lua_dofile returned a different error-code.... maybe it has something to do with the language and region settings but I am not familiar with that, so it remains a guess to me... thanks for your reactions and have a nice time on your new location Mr. Ashley.
0

Share this post


Link to post
Share on other sites