Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

345 Neutral

About janta

  • Rank
    Advanced Member
  1. I did know that, I think I just didn't explain myself well. Anyway I found this: http://stackoverflow...ion-in-lua?rq=1 And the poster had about the same question as me. It turns out that returning the function chunk does the trick. My data therefore is like this body = "return function (msg) print(msg) end" name = "print_message" And my (pseudocode) is like this void CreateFunc(char* name, char* body) { // verify if the function already exists assert(!funcs.contains(name)); luaL_loadstring(L, body); lua_pcall( L, 0, 1, 0 ); lua_setglobal(L, name); funcs.insert(name) } I'm open to other suggestion or remarks of course
  2. Hi I am a Lua beginner, and I have a problem. I want to let my users (designers) create some Lua functions, but I want to keep track of the function they create So for example, I dont want them to give me this: "function SayHello() print('hello') end" I want them to give me these - name: SayHello - body: function () print('hello') end And do along the lines like luaL_loadstring(body); lua_setglobal(L, name); But this won't work because the function's body does not compile on its own. Is there another way for me to do that, besides manually formatting the script like sprintf(buffer, "%s =%s", name, body) Thank you for your help
  3. janta

    Use const!

    Ahah very nice parody use const!!!! I LOL'ed Edited for the 1998 o phobic...
  4. Nevermind, finally found it. 5.3.5
  5. Someone here is quoting the standard but I couldn't find where in the standard he got this from http://social.msdn.m...9a-3b66c929f898 "if the static type of the operand object to be deleted is different from its dynamic type, the static type shall be a base class of the operand’s dynamic type of the object to be deleted and the static type shall have a virtual destructor or the behavior is undefined"
  6. Hi Apparently this is undefined behavior, but I looked it up in the C++ standard (12.4 - Destructors) but couldn't find anything about this case class base { ~base() {} }; class derived : base { virtual ~derived(); } base* p = new base; delete p; // undefined behavior Can anyone qute the standard on this? (unless behavior is not undefined? This causes a crash in VS2008, though) Thanks for your help
  7. janta

    Cost to make a 10 minute demo

    it depends on what kind of demo you want. What do you want to DEMOnstrate? If you want a "demo" like in "commercial demo" (think XBoxLive) then you basically have to make the whole game and then carve a demo out of it. Then your question becomes how much dos it cost to set up a video game development studio. If you just want to prove a concept (which sounds way more realistic), then you may get away with a 2 or 3 persons team (programmer, artist, designer). Of course that depends on you concept. For a musical game, you may need a sound guy, and so on. Getting more persons on board than you actually need will just make your project more likely to fail, start small. To create your demo, you should not involve any money directly (unless you're already a professional with a serious track record, which apparently you are not otherwise you would not be asking here). I assume your programmer, artist and you already own a computer. What you need now is free tools (modeling software, source control, perhaps set up one of your computers as a file server, etc.) and a lot of time and efforts and perseverance. In other words if you are what you appear to be (to me: an individual with no experience and a game idea that you think is great), money will not be the limiting factor here. Last, what makes you think ATVI is the right publisher to present your project to? They mostly exploit license based games, plus a few original IPs. They're not big risk takers these days, I don't see them funding an indie developer with no experience. And I don't see your girlfriend helping much here (unless she's got a very high level of influence at ATVI but I'm guessing she doesn't) There are other companies out there that might fund you though, if you can convince them that your idea is actually worth it Sorry if I went a bit off topic, I hope I helped a bit. Best of luck...
  8. janta

    I have a problem with char*

    <insert usual disclaimer about using std::string rather than char*> 1) your code is wrong because you make s point to a constant literal string which can not be modified (s should have type const char* in your example) If you want to initialize a char array from a literal, use: char s[] = "hello"; You can then modify that array. 2) there are many ways to do that. unless you use std::string instead (which offers high level string manipulation functions), it boils down to manual array manipulation. An *example* (I encourage you to use std::string instead) char s[] = "FirstName:Jack"; for (int i = 0 ; i < 5 ; i++) s = s[i+10]; // because 'J' is at index 10
  9. janta

    Humble Indie bundle 2?!

    I picked it up too a couple days ago. I addition to direct download links, I received a key to redeem all 5 games on steam (actually 3 of them, and I'll get the last 2 when they are finally released) And a few minutes ago I received all 6 games from bundle #1 for free! (direct download and steam key -- excepted samorost 2, direct d/l only) (edit:apparently, free bundle #1 is only for those who payed at least 7.33$) So.. wow. [Edited by - janta on December 22, 2010 8:20:26 AM]
  10. Hi I looked into my C++ standard book but couldn't find anything specific to this situation (in the "typedef" section) class A { public: typedef char MyType; // intendedly private }; class B : public A { public: typedef float MyType; void PrintSize() { printf("%d", sizeof(MyType)); // prints 4, ok printf("%d", sizeof(A::MyType)); // prints 1, ok } }; What would be the standard here? 1) Is "Overriding" a typedef from a base class permitted at all? (visual studio accepts it) 2) If it is, does it follow the usual rules of overriding? (say, like a class member) What do you think? Thanks for your help.
  11. Hello GDNet,I am looking for some quality material regarding code review practices in general. I have looked online and in online bookstores such as amazon and found stuff, but before I buy anything I thought I could get somme personal recommendations here. Would someone here recommend some material? The best rated (if that's worth anything) book on amazon seems to be this one: Thank for your time
  12. janta

    Japanese language question Toki is often used with "ano toki", "sono toki". In my understanding it is used to refer to a particular point in time, and not to a time interval. This seems to provide a much better explanation than mine.
  13. janta

    I like black people

    Kind of reminds me about this
  14. janta

    Japanese language question

    Is it possible that you mean "dou iu koto"?
  15. janta

    Graph design software

    Quote:Original post by Antheus Write XML by hand? This is an unusual question, since graphs are made of some data. There isn't much point in writing in graph information by hand, any more than there is a tool to write trees or lists. Any text editor will to, you either need an indent or a comma. There are graph processing toolkits which allow processing, and as mandatory part offer a way to create graphs manually as well, Gremlin and neo4j have seen some press recently. Still, it's an unusual task. For example, a graph can be stored as a 2D array in just about any language, and if you're writing by hand, could just use that. I also don't understand why plotting isn't acceptable, I'd imagine it's easier to use one of GUI-based tools to draw the graph, rather than enter it by hand. To adress your two questions, - Why not edit a text file: because I'm not the one creating the graph, it will be a game designer. So it needs to be visual - Why not use plotting: I may not have use the proper word. For me, plotting is something like this, and I don't see how I could create a graph with that. What does plotting mean, to you? (and probably to most other people :P) I will take a look to the links posted, thank you
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!