Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


O-san

Member Since 19 Apr 2007
Offline Last Active Nov 17 2014 07:09 AM

Posts I've Made

In Topic: Save game

18 June 2012 - 02:23 AM

Oops, now I see the omitted =, that makes it a chunk.. doh! The little things!

I must be missing something, that does not compute for me. My code looks like...

savefile.txt:

newObject=
{
  id = 1,
}
newObject=
{
  id = 2,
}

My script got these few lines:

newObject= function(input)
  print("New object")
  for k,v in pairs(input) do
   print("== "..tostring(k).."="..tostring(v))
  end
end

dofile("savefile.txt")

As soon as I dofile("savefile.txt") my newObject function type becomes a table type and I am missing why it should not. Thanks for taking your time! Posted Image

In Topic: Save game

15 June 2012 - 12:34 AM

Thanks for the comprehensive reply! I think I got most of it but one thing that puzzles me is how the resulting file new_object={...}new_object=... can call the new_object method. The contents looks to me like a table construction and not a function call to new_object(input).

In Topic: Save game

13 June 2012 - 05:19 AM

Exists your game state really only in lua ? What about references (user data) to external (i.e. C++/C) data ?


I got some of my functionality scripted, not all of it by any means. My NPCs can have a behaviour script associated with them. These scripts can read variables from the "engine" and also set new values to these variables in some cases (through lua_register C funcitons). An NPC might have unique variables too, only available in lua. Such as if the player has talked or interacted in someway with the NPC.

Could you describe your serialization a bit, it sounds like something I am leaning towards.

I haven't written a game save system before so this is all quite new to me.

In Topic: Just got my 1st tablet! What should I do now? (Concept Artist)

09 June 2012 - 11:22 AM

Post some of your artwork if you want critique or comments on it, maybe your idea behind it too. I don't think anyone here is going to explicitly teach you how to get your ideas onto canvas.

In Topic: What do you do to check your music is up to standard?

27 May 2012 - 01:40 AM

The way I notice a tune is not up to standard is that I get tired/annoyed/dislike of it after I have put it in the game. Either it doesn't fit the mood of the game or it just sounds bad. I try to differentiate the song; either it being because I heard it a lot of times and I am tired of it that way (which is OK, that's a keeper) or because I think it genuinely doesn't sound good enough.

Its safe to say I'm not a very musical guy.. but I'm making my own music for the games I develop. It's hard to say what makes a good enough song, much depends on how high your goals are.

PARTNERS