MichaelCrook

Members
  • Content count

    73
  • Joined

  • Last visited

Everything posted by MichaelCrook

  1. I've decided to start working on a cross platform (windows/linux) game.. Too bad it's a total mind F*(&.. I've got a svn repository setup and now I'm getting everything else done, I want to use the SFML library, but this is where the problem comes in.. How do I deal with linking to the libraries from multiple platforms.. I wanted to use codeblocks (as it is cross platform) to develope so I could just use the same project file, but now it seams as if that may be implausable.. Do I need to use a makefile?? if so, would somthing as such as cmake be better? I only have used basic makefiles and personally I hate having to go to the extra effort which an ide does for you, which is why I'm dreading this.
  2. Developing Cross platform

    I think the smartest thing to do will be learn to use cmake properly then use that, so I'ma do some cross platform development research like I should have in the first place then I'll report back any tips
  3. Ok. I have been doing some research for the upcoming semester of uni. And I know that we will need animation, so I'm currently trying to way up easy implimentation over flexibility. My current three choices are: Collada: I know very little about this format, other than allot of people love it FBX: I have done a little bit of experimenting with this. I love how easy it is to get it setup and running, although I am concerned that the closed end of the library might limit my ability to adapt the file format to work with physics interactions inside of my game. I understand that I could write my own phaser rather than use Autodesks, but that kinda defeats the purpose of using FBX, which is easiness. my goal is to make the system highly facaded interface for any system to hook into, so thats another con of FBX MD5: I have done a tiny bit of a look into this, this looks like the same deal in collada, but maybe a little bit more simple, but I am probably wrong. My main concern is that this unit is known for it's intense work load, so if I choose a format which has too many features and thus take too long to impliment, sure, ill have a fancy animation setup, but I won't have a game. But if I choose something too easy, requirements of the engine which I didn't for see might cause jelly code to occur as I patch and stretch the abilities of the format. The main things that I believe are essential are: easy access to the mesh so I can grab individual triangles and do collision detection control over the rendering, I would like to use a oct tree to free up GPU animation ease of creation of file, as in, an exporter from popular 3D modeling software. What would be good: the ability to attach things to bones, i.e. to attach a gun to a hand. animation which was not model specific, i.e. a walk sequence which can be used by all NPC's with the same bone system animation blending, both blending animation presets + IK caused from physics interactions (second one more of a wish than a requirement) ============================================================================================================================== ===========================================read this if you don't have all day============================================================ ============================================================================================================================== So in summary, I need an animation file format which will add some sparkle and added feature to the game, but not one that will take too long to setup, maybe a tutorial as such as [url="http://3dgep.com/?p=1053"]this[/url] which would speed up development. I am using Windows and GLUT (possibly will impliment DirectX through use of a facade, i.e. all md5/collada/fbx will call a draw triangle / what ever access they need to the rendering interface. ============================================================================================================================== ============================================================================================================================== ============================================================================================================================== Thanks for reading, thanks for the help. #EDIT# i realize that some of my wants are probably non related to the format, i.e. IK, that's probably done on my end
  4. easiest animation file format + flexible

    In the past team members have done the model format systems, but I decided that Ide do some research cus it's probably good to know.
  5. Currently my A star can run 500 tests every second on this map: is this good or bad? if I lower the Heuristic weighing it takes about 1.5 -> 2 seconds, although due to the simplicity of the map I am making for my game I can afford a high Heuristic [img]http://img820.imageshack.us/img820/899/mapyf.png[/img]
  6. I recently made my own A* algorythm.. It works great with an exception that there are some weird mini paths on big grids... % = wall [img]http://img85.imageshack.us/img85/7729/crinkcle.png[/img] I'm kinda confident with my code, maybe this is a glitch in my execution.. but I don't know.. here's my code, feel free to use it if you want to, but as shown by this picture, atm it aint 100% functional [left][url="http://www.filefactory.com/file/2cediqtrsepx/n/astarhelp_zip"]http://www.filefacto...n/astarhelp_zip[/url][/left] [left][font=sans-serif]I ran some tests, here they are:[/font][/left] [url="http://www.filefactory.com/file/256b56xyajyv/n/testb_zip"]http://www.filefacto...jyv/n/testb_zip[/url] [url="http://www.filefactory.com/file/6kcbde0f4407/n/testa_zip"]http://www.filefacto...407/n/testa_zip[/url] thanks, it's really boggling me (btw, the file numbers on the test run print outs is the Heuristic multiplier (increases likely hood to go towards goal) testb is the more important of the two as it is a mock up of the map I am using edit: like maybe is there some way I could crush the number of points so that it says, start = 1,1 next = 10, 50 next = 70, 50 end = 90, 5 edit 2: one solution I can think of is add another propert called divide amount.. this will split the original path up into x divide amounts, it will then go from start, to end of first divide, then start of first divide to end... until it gets to secondlast divide end to last divide end.. this would work as a stronger Heuristic would automatically make the path push towards the more correct direction, say in testb, if I split into two it would head up strait away instead of down, making it so that the most optimal directions don't all verge down causing the path to have to crinkcle over spots this good or bad idea?
  7. ironing out crinkles in an A*

    I'm assuming the glitch is in the cost assignment, ill look through it later
  8. ironing out crinkles in an A*

    when I have time I will show splitting it into 3, 4, 5, 6, 7 and how much it effects performance, i can also upload a visual studio solution file if it will help anyone who is still learning
  9. ironing out crinkles in an A*

    [img]http://img26.imageshack.us/img26/3305/smoothq.png[/img] anyone looking for a solution, splitting up the A star into multiple mini astars once you are done is more efficent this is splitting it once.
  10. I am currently making a game as a part of an assignment, I exported my model to a .x, I then went to load it into a .X model viewer and there was no textures [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img] I looked through the many miles of info on the display, and aparently the .x wasn't specifying a texture (it was using default, black) I was wondering, how do I export a .dds (preferred format) or whats a better way than with pandasoft directx exporter to export .X models with textures.. Here's the troublesome model [url="http://speedy.sh/VMkc4/tree.zip"]http://speedy.sh/VMkc4/tree.zip[/url] (or just click the attachment) I put in there the .max folder and the .x folder the .max might not even have textures as I had to manually set the path of the textures on my system, if you hit render and it renders grey, you just need to set texture paths
  11. URGENT: how can I export texture: 3DS Max 2012

    turns out it was my model view app that was having issues, although when I export my model it doesn't keep my custom texture (I have a leaf texture in which I have removed the non leaf parts with an opacity modifier, it didn't work
  12. I am currently developing a RTS game and I have gotten to the stage where I am planning the GUI.. I have came up with two option at the current time. Either make my own, OR find an API which will accelerate development. Originally I actually had no plan to use an external GUI library, but recently a team member dropped out so we need to cut some corners This is my current GUI UML that I was going to impliment myself. [url="http://img7.imageshack.us/img7/3519/guiuml.jpg"]see it here[/url] (too big, it would make post massive) and here is a plan of my GUI [url="http://img687.imageshack.us/img687/7613/guiforgame.png"]see it here[/url] so far I have found one library, [url="http://gigi.sourceforge.net/index.php"]GiGi[/url] although, I am not sure how hard development will be also.. just spent 1 million years attempting to install.. It seams they have a facination with scons.. I can't get scons working so I can't compile.. SADFACE
  13. OpenGL GUI interface library: Warcraft 3 style

    Ive spent up until 4:30am looking for solution.. I have found it.. Make.. My.. Own TUDAHHH!
  14. OpenGL GUI interface library: Warcraft 3 style

    [quote name='Dunge' timestamp='1336484261' post='4938372'] [quote name='falconmick' timestamp='1336483457' post='4938366'] Cannot open include file: 'ft2build.h': No such file or directory Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory [/quote] Seems like you don't have external dependencies. Read the "Requirements to Use GG" section on the website:[list] [*]You must use these other open-source libs that GG requires: FreeType, DevIL, and Boost. [/list] [/quote] I have all the req.. fixed one, the other isn't existant in boost might just download the version 1.32.0 which is what they used... also, kinda almost got scons working.. I get this now: [CODE] scons: Reading SConscript files ... ImportError:No module named build_support: File "G:\GiGi ags\GIGI_VERSION_0_6_0\GG\SConstruct", line 7: from build_support import * [/CODE]
  15. OpenGL GUI interface library: Warcraft 3 style

    I will look into it, but I have no knollage in non basic HTML and no knollage in CSS I got GiGi almost building.. I'm just getting the following errors.. any ideas: [CODE] 1>------ Build started: Project: GiGiNet, Configuration: Release Win32 ------ 1>Build started 8/05/2012 9:15:11 PM. 1>InitializeBuildStatus: 1> Touching "Release\GiGiNet.unsuccessfulbuild". 1>ClCompile: 1> All outputs are up-to-date. 1> All outputs are up-to-date. 1>Link: 1> Creating library Release\GiGiNet.lib and object Release\GiGiNet.exp 1> GiGiNet.vcxproj -> G:\GiGi ags\GIGI_VERSION_0_6_0\GG\msvc\GG\GiGiNet\Release\GiGiNet.dll 1>FinalizeBuildStatus: 1> Deleting file "Release\GiGiNet.unsuccessfulbuild". 1> Touching "Release\GiGiNet.lastbuildstate". 1> 1>Build succeeded. 1> 1>Time Elapsed 00:00:01.57 2>------ Build started: Project: GiGi, Configuration: Release Win32 ------ 2>Build started 8/05/2012 9:15:13 PM. 2>InitializeBuildStatus: 2> Touching "Release\GiGi.unsuccessfulbuild". 2>ClCompile: 2> GGApp.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory 2> GGBrowseInfoWnd.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>G:\GiGi ags\GIGI_VERSION_0_6_0\GG\include\GGBrowseInfoWnd.h(135): error C2059: syntax error : '__is_abstract' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory 2> GGButton.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGClr.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2> GGColorDlg.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGControl.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>G:\GiGi ags\GIGI_VERSION_0_6_0\GG\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGDrawUtil.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory 2> GGDropDownList.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGDynamicGraphic.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGEdit.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGEventPump.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory 2> GGFileDlg.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGFont.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>G:\GiGi ags\GIGI_VERSION_0_6_0\GG\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory 2> GGLayout.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory 2> GGListBox.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGMenu.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGMultiEdit.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGPtRect.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2> GGScroll.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGSlider.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> Generating Code... 2> Compiling... 2> GGStaticGraphic.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGTextControl.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory 2> GGTexture.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory 2> GGThreeButtonDlg.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory 2> GGWnd.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory 2> GGWndEditor.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory 2> GGZList.cpp 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2> XMLDoc.cpp 2>G:\GiGi ags\GIGI_VERSION_0_6_0\GG\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 2> G:\GiGi ags\GIGI_VERSION_0_6_0\GG\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 2>G:\GiGi ags\GIGI_VERSION_0_6_0\GG\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>G:\GiGi ags\GIGI_VERSION_0_6_0\GG\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 2>CL : warning : This header is deprecated. Please use: boost/spirit/include/classic.hpp 2> Generating Code... 2> 2>Build FAILED. 2> 2>Time Elapsed 00:00:51.98 3>------ Build started: Project: GiGiSDL, Configuration: Release Win32 ------ 3>Build started 8/05/2012 9:16:05 PM. 3>InitializeBuildStatus: 3> Touching "Release\GiGiSDL.unsuccessfulbuild". 3>ClCompile: 3> SDLGGApp.cpp 3>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2143: syntax error : missing ';' before '<' 3> g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(124) : see reference to class template instantiation 'GG::detail::make_sp_counted_base_impl<T>' being compiled 3>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 3>g:\gigi ags\gigi_version_0_6_0\gg\include\GGBase.h(123): error C2238: unexpected token(s) preceding ';' 3>g:\gigi ags\gigi_version_0_6_0\gg\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory 3> 3>Build FAILED. 3> 3>Time Elapsed 00:00:01.96 ========== Build: 1 succeeded, 2 failed, 0 up-to-date, 0 skipped ========== [/CODE] This I can't see as fixable.. boost doesn't have this.. [CODE] 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGControl.h(38): fatal error C1083: Cannot open include file: 'boost/serialization/is_abstract.hpp': No such file or directory [/CODE] and i fixed this, I forgot to link the text library [CODE] 2>g:\gigi ags\gigi_version_0_6_0\gg\include\GGFont.h(41): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory [/CODE]
  16. SDL: playing videos

    There's a simular topic here: [url="http://www.gamedev.net/topic/348340-play-video-files-in-sdl/"]http://www.gamedev.net/topic/348340-play-video-files-in-sdl/[/url] the best post in there being this: [quote name='Drew_Benton' timestamp='1128162726' post='3282104'] I'll refer you to my new post here at [url="http://www.gamedev.net/community/forums/topic.asp?topic_id=348801"]this thread[/url], Link66. [/quote]
  17. The project I am working on is a little bit to big to upload.. So I will link the only parts I can immagine are causing the issue. I have a class called LuaInstance... I have been using it for quiet a while, when ever I get a new thing I wish to add to it (so lua can interact with it) here's the header: [CODE] #ifndef LUAINSTANCE_H #define LUAINSTANCE_H #include <map> #include <iostream> #include <cstring> #include <lua.hpp> #include <luabind/luabind.hpp> #include "../ComponentFactory/ComponentCompiler.h" #include "../Component/DrawComponent.h" #include "../../ManiacsMayhem entity testing/entManager.h" /** \class LuaInstance * \brief holds several instances of lua_State and grants access to them, using namespaces would have probably been a better * solution, but there is insufficient information on how they work for me to be confident to use them properly * @author Michael Crook * @date 6/4/2012 */ class LuaInstance { public: // variables enum instID { construction = 0, keyboard = 1, draw = 2, character = 3 }; /**< instID enum, this is used to make calling of an instance more readable.. that way when you call an instance, other people reading your code will understand which instance it is */ // functions /** * default constructor... creates lua instances and places them into states. * if you want another luaState you have to add it in here! also don't forget to modify the instID enum */ LuaInstance(); ~LuaInstance(); /** * LuaInstance is a singleton, this call will allow you to access LuaInstance * @return the lua instnace */ static LuaInstance *getInstance(); /** * returns the luaState specified in instEnum * @param instID instEnum, is used to access the coresponding lua state * @return a pointer to a lua state */ lua_State *getLuaState(instID instEnum) const; /** * returns a pointer to an array of strings containing all of the errors thrown during lua execution for given lua state * this will clear the lua stack, so if you just want to clear the stack don't catch the string it returns * @param instID inst, the instance ID that you wish to get the stack for * @return std::string ** a pointer to a string array, "/0" = no more elements */ std::string *stackDump(instID inst); //int compileLua(std::string luaStream, instID instEnum); /** * given a number of arguments, if it returns anything AND the lua instance enum this will execute the function * that has been pushed onto the lua stack (to do so, use pushLuaFunc to push the function, then a pushInt if the function needs it) * @param int NumArgs (the number of arguments sent to the function), bool hasRet(if the funtion expects a return/you need one), instID instEnum(the instance which has the scope you need to forfill your task) * @return void *, needs to be cast into the data that you were expecting from the function */ void *doLua(int NumArgs, bool hasRet, instID instEnum); /** * pushes an int onto the given lua_instance stack * @param instID instEnum(the instance ID that you wish to use), int data(the data you want added to the stack) */ void pushInt(instID instEnum, int data); ///////////////////////////void pushString(instID instEnum, std::string data); /////////////// currently fixing, DO NOT IMPLIMENT /** * given an instance and a function name will add it to the given lua instance, if it fails, it will return false * @param instID instEnum(the instance ID that you wish to use), std::string funcName(the function you wish to pop onto the stack so it can be called) * @return what does it return * @todo things that need to be added/moded to function */ bool pushLuaFunc(instID instEnum, std::string funcName); /** * there really is no need for this instance, luaL_dostring will do the same * it is included as it uses the instance enum which makes everything so much more clean * also, the name, do n load makes more sense, so that when people are using the functions * they will understand that it means that the file is both compiled and done. * #NOTE# if lua is wrapped in function....end it will not be executed, BUT, the function will * be added to globals and will be pushable onto the lua stack using pushLuaFunc, if it isn't in a chunk, it will be executed #/NOTE# * @param instID instEnum, the enumarator for the required lua instance std::string luaString, * the string which contains the lua file * @return 0 = success, 1 = fail */ int do_n_LoadLua(instID instEnum, std::string luaString); //void bindObject(instID instEnum, const char *luaVarName, void *object); glitched, impliment later private: // variables std::map<instID, lua_State*> states; /**< holds a pointer to all of the avaiable lua instances */ static LuaInstance *singleton; /**< a pointer to the single instance of LuaInstance */ // functions //const char* istream_ChunkReader( lua_State *L, void *data, size_t *size ); }; #endif /* doxy comments: functions: /** * information on calss * more lines * EVEN MORE LINES! * @param paramaters and what they need to be * @return what does it return * @todo things that need to be added/moded to function */ // int someFunction(); /* variables bool someVar /**< insert variable description here */ [/CODE] When I remove #include "../../ManiacsMayhem entity testing/entManager.h" all of my errors go away. and here's the implementation: [CODE] #include "LuaInstance.h" LuaInstance* LuaInstance::singleton = 0; LuaInstance *LuaInstance::getInstance() { if(singleton == 0) { singleton = new LuaInstance(); } return(singleton); } int LuaInstance::do_n_LoadLua(instID instEnum, std::string funcName) { return(luaL_dostring(getLuaState(instEnum), funcName.c_str())); } /* int LuaInstance::compileLua(std::string luaStream, instID instEnum) { return(luaL_loadstring(getLuaState(instEnum), luaStream.c_str())); } */ bool LuaInstance::pushLuaFunc(instID instEnum, std::string funcName) { bool retVal = true; lua_getglobal(getLuaState(instEnum), funcName.c_str()); //uncomment for debugging //int i = lua_type(getLuaState(instEnum), -1); if (lua_type(getLuaState(instEnum), -1)!=LUA_TFUNCTION) { //std::cout << funcName; retVal = false; } return(retVal); } /* being worked on void LuaInstance::pushString(instID instEnum, std::string data) { lua_pushstring(getLuaState(instEnum), data.c_str()); // uncomment for debugging //int i = lua_type(getLuaState(instEnum), -1); // } */ void LuaInstance::pushInt(instID instEnum, int data) { lua_pushnumber(getLuaState(instEnum), data); ///* uncomment for debugging //int i = lua_type(getLuaState(instEnum), -1); //*/ } /* void LuaInstance::bindObject(instID instEnum, const char *luaVarName, void *object) { luabind::globals(getLuaState(instEnum))[luaVarName] = object; } */ void *LuaInstance::doLua(int NumArgs, bool hasRet, instID instEnum) { int i, luaData; int numRet = 0; int pcallResult; void *returnVal = NULL; std::string debugging; // on creation of user UI, at the end of doLua, this will be sent to the error handler, if "" is sent, no errors, if string exists, there's errors //std::string *debugging2; //temporary returnTypes bool b_tmpRet; int i_tmpRet; const char * s_tmpRet; lua_State * ls_tmpRet; size_t *strSize; strSize = new size_t(); //NumArgs++; // number of arguments I inteperate as number of objects passed, +1 is for the function that it passes lua_State *L = getLuaState(instEnum); if(hasRet) { numRet = 1; } /* int a, b, c, d; a = lua_type(getLuaState(instEnum), 1); b = lua_type(getLuaState(instEnum), 2); c = lua_type(getLuaState(instEnum), 3); d = lua_type(getLuaState(instEnum), 4); */ pcallResult = lua_pcall(L, NumArgs, numRet, 0); /* int a, b, c, d, e, f, g; a = lua_type(getLuaState(instEnum), 1); b = lua_type(getLuaState(instEnum), 2); c = lua_type(getLuaState(instEnum), 3); d = lua_type(getLuaState(instEnum), 0); e = lua_type(getLuaState(instEnum), -1); f = lua_type(getLuaState(instEnum), -2); g = lua_type(getLuaState(instEnum), -3); int aa, bb, cc; aa = lua_tointeger(getLuaState(instEnum), 1); bb = lua_tointeger(getLuaState(instEnum), 0); cc = lua_tointeger(getLuaState(instEnum), 1); */ if(hasRet) // if the function is expecting data to be returned { luaData = lua_type(getLuaState(instEnum), -1); if(pcallResult != 0) { luaData = 9; // this indicates syntax error in function } switch(luaData) // switching the diferent possible return types to be placed inside of { case LUA_TNIL: debugging.append("error running function: "); debugging.append("no data returned"); break; // nill returned case LUA_TBOOLEAN: b_tmpRet = lua_toboolean(getLuaState(instEnum), -1); memcpy(&returnVal, &b_tmpRet, sizeof b_tmpRet); break; case LUA_TLIGHTUSERDATA: debugging.append("error running function: "); debugging.append("returning bound objects is currently not supported"); //returnVal = lua_touserdata(L, -1); case LUA_TNUMBER: i_tmpRet = lua_tointeger(getLuaState(instEnum), -1); memcpy(&returnVal, &i_tmpRet, sizeof i_tmpRet); break; case LUA_TSTRING: s_tmpRet = lua_tolstring(getLuaState(instEnum), -1, strSize); memcpy(&returnVal, &s_tmpRet, *strSize); break; case LUA_TTABLE: debugging.append("error running function: "); debugging.append("tables not supported"); break; case LUA_TFUNCTION: debugging.append("error running function: "); debugging.append("returning functions not supported"); break; case LUA_TUSERDATA: debugging.append("error running function: "); debugging.append("returning bound objects is currently not supported"); //returnVal = lua_touserdata(L, -1); break; case LUA_TTHREAD: ls_tmpRet = lua_tothread(getLuaState(instEnum), -1); memcpy(&returnVal, &ls_tmpRet, sizeof ls_tmpRet); break; case 9: debugging.append("error running function: "); debugging.append(lua_tostring(L, -1)); break; default: debugging.append("error running function: "); debugging.append("return of unknown datatype"); break; } lua_pop(L, 1); // pop returned value } else { if(pcallResult != 0) { debugging.append("error running function: "); debugging.append(lua_tostring(L, -1)); } } return(returnVal); } LuaInstance::LuaInstance() { states.insert(std::make_pair(construction, lua_open())); states.insert(std::make_pair(keyboard, lua_open())); states.insert(std::make_pair(draw, lua_open())); states.insert(std::make_pair(character, lua_open())); // setting up the compiler to be usable in lua std::map<instID, lua_State*>::iterator iter; // opens all lua instances for(iter = states.begin(); iter != states.end(); ++iter) { luaL_openlibs(iter->second); luabind::open(iter->second); lua_pcall(iter->second, 0, 0, 0); // initiates pcall } //CompCompiler::setupLuaBinds(getLuaState(construction)); //keyBinds::setupLuaBinds(getLuaState(keyboard)); ComponentCompiler::setupLuaBinds(getLuaState(construction)); DrawComponent::setupLuaBinds(getLuaState(draw)); CharacterComponent::setupLuaBinds(getLuaState(character)); } LuaInstance::~LuaInstance() { std::map<instID, lua_State*>::iterator iter; // closes all lua instances for(iter = states.begin(); iter != states.end(); ++iter) { lua_close(iter->second); } } lua_State *LuaInstance::getLuaState(instID instEnum) const { return(states.find(instEnum)->second); } std::string *LuaInstance::stackDump(instID inst) { lua_State *L = getLuaState(inst); int top = lua_gettop(L); if(top == 0) { return(NULL); } //std::string* stkDmp; std::string* retVal; //stkDmp = new std::string[top]; retVal = new std::string[top+1]; int i = 0; while(lua_gettop(L) != 0) // every time you call lua_remove, it shuffles all of the stack down, thus, eventually the stack will equal 0, thus stack cleared { if(lua_isstring(L, 1)) { retVal[i] = (std::string)lua_tostring(L, 1); // pushes stack element by element onto stkDmp** } lua_remove(L, 1); // i++; } retVal[top] = "/0"; return(retVal); } [/CODE] here's the header for entManager.h [CODE] #pragma once #include <map> #include "../src/Tools/LuaInstance.h" #include "../src/Entity/Entity.h" // this is a demo class, therefore it isn't following the design patern we have class entManager { public: entManager(void); ~entManager(void); //entity stuff /** * this will create an entity, if it fails it will return 0, else 1 (so luabind can use) * @param std::string entityIcz link to the entity file * @return entity ID (or -1 if failed) */ int makeEntity(std::string entityIcz, int entID); /** * this will kill the given entity (killing all of it's components) * @param int entID the entity to kill * @return will return false if entity does not exist */ bool killEntity(int entID); static void setupLuaBinds(lua_State *L); private: std::map<int, Entity*> m_entitys; }; [/CODE] and implementation: [CODE] #include "entManager.h" entManager::entManager(void) { } entManager::~entManager(void) { } int entManager::makeEntity(std::string entityIcz, int entID) { int retVal = 1; Entity *tmpEnt; tmpEnt = new Entity(entityIcz, entID); //std::make_pair if(tmpEnt->getEntId() == -1) { //failed retVal = 0; } else { m_entitys.insert(std::make_pair(entID, tmpEnt)); } return(retVal); } bool entManager::killEntity(int entID) { return(m_entitys.erase(entID)); // this will call the entity's deconstructor which will in return call set } // all of the components to be deleted on next itteration. void entManager::setupLuaBinds(lua_State *L) { luabind::module(L) [ luabind::class_<entManager>("entManager") .def(luabind::constructor<>()) .def("entManager", &entManager::makeEntity) ]; } [/CODE] although the errors that are produced during compilation are mostly imo bogus (i.e. somthing is causing a big stuff up, which in return is causing working code to apear as if it isn't) here it is: [CODE] 1>------ Build started: Project: maniacsMayhem, Configuration: Debug Win32 ------ 1>Build started 16/04/2012 1:19:42 AM. 1>InitializeBuildStatus: 1> Creating "Debug\maniacsMayhem.unsuccessfulbuild" because "AlwaysCreate" was specified. 1>ClCompile: 1> CharacterCF.cpp 1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch 1> Generating Code... 1> Compiling... 1> entManager.cpp 1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch 1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.cpp(32): warning C4800: 'unsigned int' : forcing value to bool 'true' or 'false' (performance warning) 1> LuaInstance.cpp 1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.cpp(131): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.cpp(67): warning C4101: 'i' : unreferenced local variable 1> entTest.cpp 1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch 1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(30): error C2065: 'Entity' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(30): error C2059: syntax error : '>' 1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(33): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(20): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(23): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(25): error C2065: 'keyboard' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(26): error C2065: 'draw' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(27): error C2065: 'character' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(28): error C2143: syntax error : missing ',' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(28): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(66): error C2065: 'instID' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(100): error C2065: 'instID' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(104): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(25): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(63): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(71): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(3): error C2146: syntax error : missing ',' before identifier 'argv' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(3): error C2065: 'argv' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(3): error C2059: syntax error : ']' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(4): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(7): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(8): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(8): fatal error C1004: unexpected end-of-file found 1> Entity.cpp 1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch 1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(30): error C2065: 'Entity' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(30): error C2059: syntax error : '>' 1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(33): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(20): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(23): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(25): error C2065: 'keyboard' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(26): error C2065: 'draw' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(27): error C2065: 'character' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(28): error C2143: syntax error : missing ',' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(28): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(66): error C2065: 'instID' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(100): error C2065: 'instID' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(104): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(25): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(63): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(71): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(3): error C2653: 'Entity' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(4): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(14): error C2653: 'LuaInstance' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(14): error C2653: 'LuaInstance' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(25): error C2065: 'buffer' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(25): error C2065: 'fileSize' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(25): error C2143: syntax error : missing ',' before ')' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(27): error C2653: 'LuaInstance' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(27): error C2653: 'LuaInstance' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(27): error C2065: 'buffer' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(28): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(30): error C2653: 'LuaInstance' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(30): error C2653: 'LuaInstance' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(32): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(39): error C2653: 'LuaInstance' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(39): error C2653: 'LuaInstance' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(40): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(43): error C2653: 'Entity' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(44): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(46): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(48): error C2653: 'Entity' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(49): error C2143: syntax error : missing ';' before '{' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(50): error C2065: 'entId' : undeclared identifier 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(51): error C2143: syntax error : missing ';' before '}' 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(53): error C2653: 'Entity' : is not a class or namespace name 1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(53): fatal error C1903: unable to recover from previous error(s); stopping compilation 1> DrawCF.cpp 1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch 1> ComponentCompiler.cpp 1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch 1> Generating Code... 1> 1>Build FAILED. 1> 1>Time Elapsed 00:00:20.21 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== [/CODE] luainstance, entity were bug free till now, and through looking through the errors, for instance [CODE] 1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(20): error C2143: syntax error : missing ';' before '{' [/CODE] which is referring to this: [CODE] class LuaInstance { // <------- this is what it is refering to public: [/CODE] I believe that the including of the header is in some way doing somthing I shouldn't without me knowing (ive already gone through all of my headers an made sure I have used [CODE] #ifndef #define #endif [/CODE] or equivalent. What I suspect might be the problem is that entManager is including some file, then another file is reclairing it, causing some sort of mumbo jumbo.. I just can't figure out why note: during creation of this monster post I found out that if I include entManager in any headder it causes the things that attach to that hedder to expload... I am going to further examine my code, hopefully I can find a solution myself, but I am still going to post as this assignment is due soon and I'm kinda lacking time [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]
  18. [quote name='rip-off' timestamp='1334531816' post='4931578'] I'm not talking about precompiled headers. I'm talking about a compiler switch which causes the compiler to output the pre-processed source to disk. The preprocessor is the part of the c++ compilation process that handles #include, #define etc. The compiler works not on the source, but the output of of the pre-processor. If circular dependencies are the problem, you'll see something like this: [code] // Pages and pages of standard headers and library headers class Foo { // ... // Example of a reference to another class not defined yet void frobnicate(Bar bar) { } }; // Sometime later class Bar { // ... }; [/code] In fact, looking closer at your original post, it could be as simple as moving the following preprocessor directives from the lua instance header file to the lua instance source file (nothing in the header obviously depends on the detail in these included files): [code] #include "../ComponentFactory/ComponentCompiler.h" #include "../Component/DrawComponent.h" #include "../../ManiacsMayhem entity testing/entManager.h" [/code] [/quote] I think I will attempt to create a function which will allow users to add their classes without needing to be known of inside of luaInstance, It was what I wanted to do originally, I was just trying to save time
  19. I've never looked at precompiled thingamabobs... Anything I should be looking for? btw, [url="http://www.filedropper.com/debug_1"]they are here:[/url]
  20. [quote name='rip-off' timestamp='1334517910' post='4931513'] Depending on what is going on, it might be better to actually remove the dependency. A quick skim suggests that the dependency is in the LuaInstance constructor. Instead of setting the bindings in the constructor, try passing the bindings into the constructor. A separate file can link these together, using a "factory" function. [/quote] I was actually going to do that, but I was running out of time so I took the lazy approach, boy does it look like that has come back to bite me I will in the morning, 6 hours before the assignment is due attempt to impliment a function iniside of LuaInstance which will accept a pointer to a function which needs a lua state to bind a class to lua using typedef void (*classBinder)(lua_instance*) and hope like billoes that that will accept a function reference which has a void return and needs a lua_instance pointer
  21. as a side note... when ever I look at my #includes of parts of the project that I have created, the #include is red... it says the following: [img]http://img137.imageshack.us/img137/2043/errorjl.png[/img] although during compilation it finds the files without issue... Any idea why? it's been like this for a while and hasn't causesd the program not to compile edit: what is odd, is that most files are doing this... but I found about 20% arn't... for example, this file isn't [CODE] #ifndef DRAWCF #define DRAWCF #include "ComponentFactory.h" #include "../ResourceHandler/IczOpener.h" #include "../Component/DrawComponent.h" #include "../Tools/LuaInstance.h" #include <iostream> class DrawCF : public ComponentFactory { public: static ComponentFactory * createComponentFac(int entID); Component *createComp(std::string linkToLua); bool linkOtherComponent(int linkToSetup, ComponentFactory *linkedComponentF); DrawCF(int entID){m_entID = entID;}; private: DrawComponent* drwCmp; }; #endif [/CODE] Although luaInstance does get the not found error... edit 2: and when I include [CODE] #include "../../ManiacsMayhem entity testing/entManager.h" [/CODE] in the headers which don't get that weird error, it doesn't cause problems.. Ok.. I might be onto it edit: I've had a read through my team mates code... they for some STUPID STUPID reason insist on having half of their #includes in the header, and half in the implementation... I've told them that I don't like this, but because they love making me cry they still do it.. So, in an attempt to fix the problem, I started moving their #includes so that they were all inside of the headers.. I even found that in some places they had #included in the cpp and in the h... which I believe can cause issues... after moving everything into .h I am still getting the problem, but there is a chance I have missed one double up.. I'm going to keep an eye out, but is this the kinda thing that could cause this error? sorry, for post spam, but every time I make a post, I tell myself I'm getting off, yet I havn't yet :\
  22. ok, here's an update... if I remove [CODE] #include "../src/Entity/Entity.h" [/CODE] from entManager, the errors go away. here's the code for Entity: .h [CODE] #ifndef ENTITY_H #define ENTITY_H #include <vector> #include <string.h> //#include "../Component/Component.h" #include "../Tools/LuaInstance.h" #include "../ComponentFactory/ComponentCompiler.h" #include "../ResourceHandler/IczOpener.h" /** \class Entity * \brief Entity holds all components of a game entity, it knows nothing of what they do or how to use them, entity just holds them * all entities will be in a vector in the game instance, when a entity is deleted, it will call constructor, marking all * components it holds for removal * @author Michael Crook * @date 21/3/2012 * @todo add function which compiles a .efcg file (entity configuration file) this will be done through this ROUGH psducode * loop(all needed components) * { * Component* newComponent; * ComponentCompiler::make(newComponent, componentID, linkToLuaMakefile); * } */ class Entity { public: // variables // functions /** * returns if the entity is still in use * @return if t he entity is still "alive" (killme==1 = dead) */ //bool entityIsDead(); // returns this.killme /** * default constructor */ Entity(); /** * constructor accepts a file containing the data required to build an entity, runs createEntity after running default constructor * @param entityInfoLuaFile a string argument linking to a entity creation lua file * @see Entity() * @see createEntity() * @return The test results */ Entity(std::string ICZLoc, int entId); /** * default deconstructor, will call all of it's components kill function, this will make all of the components have their isKilled flagged as true and run the childs kill() */ ~Entity(); /** * creates entity, will flush all current entities (mark the component for removal from component controller/free memory during removal from controller) * after that it will read in the file at 'entityInfoLuaFile' (this will later be changed to a char pointer once physicsFS zip library is installed * creating the components using their component factory (the CF will set the component up and add to the controller) * @param entityInfoLuaFile a string argument linking to a entity creation lua file */ void createEntity(std::string ICZLoc, int entId); int getEntId(){return(m_entID);}; private: // variables //bool m_killme; /**< if true, the entity has been flagged for removal, all components will destroy them selves if their holding entity is flagged for this */ std::vector<Component*> m_component_holder; /**< holds all of an entities components, they have to be pointers so that once the entity is deleted, its components are removed from the controllers */ int m_entID; // functions void clear(); }; #endif [/CODE] .cpp [CODE] #include "Entity.h" void Entity::createEntity(std::string ICZLoc, int entId) { m_entID = entId; clear(); // will call all of the kill functions of all of the components m_component_holder = *(new std::vector<Component*>); // lets go of tracking the components in m_component_holder, clear() MUST be called first char *buffer; std::string *errStr; ComponentCompiler *compiler; compiler = new ComponentCompiler(); lua_State *L = LuaInstance::getInstance()->getLuaState(LuaInstance::construction); luabind::globals(L)["CC"] = compiler; IczOpener *zipInstance; zipInstance = IczOpener::getInstance(); zipInstance->setArchive(ICZLoc); int fileSize = zipInstance->getFileLength("entLoad.lua"); buffer = new char[fileSize]; zipInstance->getFileStream("entLoad.lua", buffer, fileSize); // lua file is now inside of Entity if(LuaInstance::getInstance()->do_n_LoadLua(LuaInstance::construction, buffer) != 0) { // entity loading failed errStr = LuaInstance::getInstance()->stackDump(LuaInstance::construction); entId = -1; } //luaL_dostring(L, buffer); // runs the lua file entLoad.lua zipInstance->deInit(); // unloads zip, allows for data access outside of program, for example, once you load all of the lua you need from an // icz, you unload it, that way during balancing you can modify the lua, it will then reload/unload with new values std::string *tmpStr = LuaInstance::getInstance()->stackDump(LuaInstance::construction); } Entity::Entity() { } Entity::Entity(std::string ICZLoc, int entId) { createEntity(ICZLoc, entId); } Entity::~Entity() { clear(); } void Entity::clear() { std::vector<Component*>::iterator it; for (it = m_component_holder.begin(); it != m_component_holder.end(); ++it) // itterates through all Components { (*it)->setIsKilled(true); // marks them to be destroyed next controller itteration } } [/CODE] I recently changed it, before this is what it was: .h [CODE] #ifndef ENTITY #define ENTITY #include <vector> #include <string.h> //#include "../Component/Component.h" #include "../Tools/LuaInstance.h" #include "../ComponentFactory/ComponentCompiler.h" #include "../ResourceHandler/IczOpener.h" /** \class Entity * \brief Entity holds all components of a game entity, it knows nothing of what they do or how to use them, entity just holds them * all entities will be in a vector in the game instance, when a entity is deleted, it will call constructor, marking all * components it holds for removal * @author Michael Crook * @date 21/3/2012 * @todo add function which compiles a .efcg file (entity configuration file) this will be done through this ROUGH psducode * loop(all needed components) * { * Component* newComponent; * ComponentCompiler::make(newComponent, componentID, linkToLuaMakefile); * } */ class Entity { public: // variables // functions /** * returns if the entity is still in use * @return if t he entity is still "alive" (killme==1 = dead) */ //bool entityIsDead(); // returns this.killme /** * default constructor */ Entity(); /** * constructor accepts a file containing the data required to build an entity, runs createEntity after running default constructor * @param entityInfoLuaFile a string argument linking to a entity creation lua file * @see Entity() * @see createEntity() * @return The test results */ Entity(std::string ICZLoc); /** * default deconstructor, will call all of it's components kill function, this will make all of the components have their isKilled flagged as true and run the childs kill() */ ~Entity(); /** * creates entity, will flush all current entities (mark the component for removal from component controller/free memory during removal from controller) * after that it will read in the file at 'entityInfoLuaFile' (this will later be changed to a char pointer once physicsFS zip library is installed * creating the components using their component factory (the CF will set the component up and add to the controller) * @param entityInfoLuaFile a string argument linking to a entity creation lua file */ void createEntity(std::string ICZLoc); private: // variables //bool m_killme; /**< if true, the entity has been flagged for removal, all components will destroy them selves if their holding entity is flagged for this */ std::vector<Component*> m_component_holder; /**< holds all of an entities components, they have to be pointers so that once the entity is deleted, its components are removed from the controllers */ // functions void clear(); }; #endif [/CODE] .cpp [CODE] #include "Entity.h" void Entity::createEntity(std::string ICZLoc, int entId) { clear(); // will call all of the kill functions of all of the components m_component_holder = *(new std::vector<Component*>); // lets go of tracking the components in m_component_holder, clear() MUST be called first char *buffer; std::string *errStr; ComponentCompiler *compiler; compiler = new ComponentCompiler(); lua_State *L = LuaInstance::getInstance()->getLuaState(LuaInstance::construction); luabind::globals(L)["CC"] = compiler; IczOpener *zipInstance; zipInstance = IczOpener::getInstance(); zipInstance->setArchive(ICZLoc); int fileSize = zipInstance->getFileLength("entLoad.lua"); buffer = new char[fileSize]; zipInstance->getFileStream("entLoad.lua", buffer, fileSize); // lua file is now inside of Entity if(LuaInstance::getInstance()->do_n_LoadLua(LuaInstance::construction, buffer) != 0) { // entity loading failed errStr = LuaInstance::getInstance()->stackDump(LuaInstance::construction); } //luaL_dostring(L, buffer); // runs the lua file entLoad.lua zipInstance->deInit(); // unloads zip, allows for data access outside of program, for example, once you load all of the lua you need from an // icz, you unload it, that way during balancing you can modify the lua, it will then reload/unload with new values std::string *tmpStr = LuaInstance::getInstance()->stackDump(LuaInstance::construction); } Entity::Entity() { } Entity::Entity(std::string ICZLoc, int entId) { createEntity(ICZLoc, entId); } Entity::~Entity() { clear(); } void Entity::clear() { std::vector<Component*>::iterator it; for (it = m_component_holder.begin(); it != m_component_holder.end(); ++it) // itterates through all Components { (*it)->setIsKilled(true); // marks them to be destroyed next controller itteration } } [/CODE] Hmmm, I just found out that before I had no headers implimenting entity, only a .cpp [CODE] #include "../Entity.h" int main(int argc, char *argv[]) { Entity entManager("testUnit.icz"); return(0); } [/CODE] which was from a test program... Is there anything inside of Entity.h's header which when placed as an include in another header could cause problems
  23. The first rule of Thesaurus Club is, you don't talk about, mention, speak of, discuss or chat about Thesaurus Club.
  24. ok, I've been working on a helper function to help simplify calling a lua function (so my group members who havn't spent 4 days beating their head against the keyboard can use it) only problem... when I call [code]lua_getglobal(getLuaState(instEnum), funcName.c_str());[/code] (getLuaState returns the desired lua_state and funcName = the function wanting to be added) it returns 0 (lua.h defined as: #define LUA_TNIL 0) aka it isn't accepting the lua files function add... ok, this is EXACTLY what happens (aka my source) [code]..... // lua_States are defiend above and are working on code that just executes a string // iczOpener opens a zip and extracts char buffers of the data inside of the zip IczOpener zipInstance("test.icz"); int fileSize = zipInstance.getFileLength("compTest4.lua"); char *buffer; buffer = new char[fileSize]; zipInstance.getFileStream("compTest4.lua", buffer, fileSize); int arguments[2]; arguments[0] = 2; arguments[1] = 5; //*arguments = new int[2]; //*arguments = tmpArgs; // order MUST be compileLua -> pushLuaFunc -> pushVar -> doLua int testing = LuaInstance::getInstance()->compileLua(buffer, LuaInstance::construction); LuaInstance::getInstance()->pushLuaFunc(LuaInstance::construction, "add"); LuaInstance::getInstance()->pushVar(LuaInstance::construction, &arguments[0]); LuaInstance::getInstance()->pushVar(LuaInstance::construction, &arguments[1]); //compileLua int reternedData; reternedData = (int)(LuaInstance::getInstance()->doLua(2, true, LuaInstance::construction)); .....[/code] and here is luaInstance: H: [code]#ifndef LUAINSTANCE_H #define LUAINSTANCE_H #include <map> #include <iostream> #include <lua.hpp> #include <luabind/luabind.hpp> #include "CompCompiler.h" #include "keyBinds.h" /** \class LuaInstance * \brief holds several instances of lua_State and grants access to them, using namespaces would have probably been a better * solution, but there is insufficient information on how they work for me to be confident to use them properly * @author Michael Crook * @date 6/4/2012 */ class LuaInstance { public: // variables enum instID { construction = 0, keyboard = 1 }; /**< instID enum, this is used to make calling of an instance more readable.. that way when you call an instance, other people reading your code will understand which instance it is */ // functions /** * default constructor... creates lua instances and places them into states. * if you want another luaState you have to add it in here! also don't forget to modify the instID enum */ LuaInstance(); ~LuaInstance(); /** * LuaInstance is a singleton, this call will allow you to access LuaInstance * @return the lua instnace */ static LuaInstance *getInstance(); /** * returns the luaState specified in instEnum * @param instID instEnum, is used to access the coresponding lua state * @return a pointer to a lua state */ lua_State *getLuaState(instID instEnum) const; /** * returns a pointer to an array of strings containing all of the errors thrown during lua execution for given lua state * this will clear the lua stack, so if you just want to clear the stack don't catch the string it returns * @param instID inst, the instance ID that you wish to get the stack for * @return std::string ** a pointer to a string array, "/0" = no more elements */ std::string *stackDump(instID inst); int compileLua(std::string luaStream, instID instEnum); void *doLua(int NumArgs, bool hasRet, instID instEnum); void pushVar(instID instEnum, void *data); void pushLuaFunc(instID instEnum, std::string funcName); private: // variables std::map<instID, lua_State*> states; /**< holds a pointer to all of the avaiable lua instances */ static LuaInstance *singleton; /**< a pointer to the single instance of LuaInstance */ // functions }; #endif [/code] CPP (cut down so you don't spend 100 years browsing it) [code] ... int LuaInstance::compileLua(std::string luaStream, instID instEnum) { std::cout << luaStream; return(luaL_loadstring(getLuaState(instEnum), luaStream.c_str())); } void LuaInstance::pushLuaFunc(instID instEnum, std::string funcName) { lua_getglobal(getLuaState(instEnum), funcName.c_str()); int i = lua_type(getLuaState(instEnum), -1); if (lua_type(getLuaState(instEnum), -1)!=LUA_TFUNCTION) { std::cout << funcName; } } void LuaInstance::pushVar(instID instEnum, void *data) { lua_pushlightuserdata(getLuaState(instEnum), data); } void *LuaInstance::doLua(int NumArgs, bool hasRet, instID instEnum) { int i; int numRet = 0; void *returnVal = NULL; std::string debugging; std::string *debugging2; NumArgs++; // number of arguments I inteperate as number of objects passed, +1 is for the function that it passes lua_State *L = getLuaState(instEnum); if(hasRet) { numRet = 1; } if(lua_pcall(L, NumArgs, numRet, 0) != 0) { debugging.append("error running function: "); debugging.append(lua_tostring(L, -1)); } if(hasRet) { returnVal = lua_touserdata(L, -1); lua_pop(L, 1); /* pop returned value */ debugging2 = stackDump(instEnum); } return(returnVal); } ... [/code] test.icz -> compTest4.lua [code]function add ( x, y ) CompCompiler:setSomeData(10) // don't worry about this, it was a test (before i found out about checking for errors using getLuaState, it was there as the lua state had a working variable CompCompiler that I knew was callable return(2) end[/code] when LuaInstance::compileLua is executed it returns 0 (success) and I get it to print out the file, it prints exactly what is in the lua file including return carriages, just so that nobody questions the icz loader (I'm pretty sure the icz loader is very working (i.e. not bugged up like my current problem) the issue I get is when I call pushLuaFunc that add isn't being accepted... and then after that I can say for certain that the lua string is not executing as CompCompiler:setSomeData(10) doesn't pause my debugging (I have the luabind'd class with a debug pause marker on setSomeData Anybody want to help me [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] haha it's probably somthing simple, for ages I had problems as my NumArgs was one too little (I took args literary, not including the function as an argument, DOH) Thanks for your time, I really appreciate it.