Lua: Script help

Nibbie
Posts: 1
Joined: 2008.09
Post: #1
So far ive been using special variables for my game, with their own apps to set their values. I have characters, control panels, vehicles etc. I heard somewhere that scripting would allow me to make one variable and then use scripts to make it do anything in its capacity. This means i wouldnt have to use seperate variables with their own apps to make them but instead i could use one universal one. I searched apples cocoa documentation and i only found stuff on applescript.

I have several questions too.
1) When a script goes into an app, how does it get converted to code?
2) Does the script need to be translated constantly to perform tasks?

sorry if this does not make sense, im completely lost, and completly tired.ZZZ
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2008.09
Post: #2
cant stop thinking........
..........
..........

ok i got an idea.

translate the script to pure code.
save it to the hard drive as a source code file
load it dynamically using NSBundle this will make a class
make as many variables as there are of that one script

untested. Is this feasible? Is it healthy for the app?is it cheating?Grin
once again i am a complete nooB with scripts, the only reason i want to use them is to make my code better and to allow users to make stuff to the last iota as it exists in my app.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
Read the other threads on this forum about scripting. I think they'll give you an idea of what scripting can and can't do for you.

I'll give you a clue: the second idea isn't feasible Wink
Quote this message in a reply
Member
Posts: 304
Joined: 2002.04
Post: #4
If you want to use Javascript as you scripting engine check out <http://www.mozilla.org/js/spidermonkey/> This is what ggadwa's Dim3 uses for scripting. And he scripts almost everything you see with it.

A couple of uDG2002 entries used Lua <http://www.lua.org/> (like OSC's 'Smiley Tag' and Monster Kodi's 'Kiki the Nanobot') - so when the source code is made available you can look at that and see how it was embedded.

Python <http://python.org/> is used often for games. There is even a cross-platform SDL/Python game developement <http://pygame.org/>

good luck!
Codemattic
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2008.09
Post: #5
ok ill check those out. Thanx for the advice.Wink
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
IIRC, Kiki uses Python...
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Running a .APP from within a shell script (osx) Jamie W 3 3,444 Dec 8, 2009 03:06 AM
Last Post: Jamie W
  java script using UNITY imaumac 6 6,269 May 16, 2009 08:07 AM
Last Post: imaumac
  What do you think about this free cute doggie script :) Polycount Productions 1 2,431 Apr 7, 2006 04:04 AM
Last Post: Taxxodium
  Running a lua script multiple times... errors on 2nd,3rd etc Joseph Duchesne 10 5,486 Jul 19, 2005 05:01 AM
Last Post: unknown
  Lua: Script glue resources Fenris 5 4,293 Oct 7, 2004 07:24 AM
Last Post: AnotherJake