Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Stupid Unity / Lua question

Author
Message
Duffer
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 9th Nov 2012 01:19 Edited at: 9th Nov 2012 01:21
Been considering LUA scripts to hold data for an RPG but -

can you push strings, ints, floats back in to tables in a LUA script from within DBPro (I know you can do this first bit in DBPro in memory when you've loaded in the original LUA script) AND THEN save out a fresh LUA script file incorporating the additions you have made (within DBPro) to the LUA script - without writing a massive parser/writer programme yourself...?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Duffer
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 9th Nov 2012 09:51
ping

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 11th Nov 2012 17:46
You'd probably have to write that yourself (I don't have the Unity plugin, but I find it hard to believe it would come with such functionality).
You could just store the main script source in sections and replace the variable declaration parts as need be I guess, no need for a parser. Unless I misinterpreted what you were asking for?


"Why do programmers get Halloween and Christmas mixed up?"
Duffer
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 11th Nov 2012 17:53
@ Rudolpho - nope, you understand it.

As a sort of aside, but on nodes and data, an idea just occurred - if you used a standard DBPro array (ok, with perhaps udts of NodeTreeID, NodeName, Value as a subtype, etc etc) and you included the full path of the node in the NodeName (ie. in the RPG sense, a fifth level of depth node 'Longsword' would have the full string '[NodeTree]1 /Items/Weapons/Swords/Longsword') you could sort or reverse sort the array by the first field (the NodeName) and it would always keep all the Nodes in order wouldn't it? Also you could easily parse lines if you wanted to say delete the children and maybe grandchildren etc nodes of the node you deleted... and if you added any node in correct format (correct naming convention for NodeName) and sorted the array, it would place that node in the correct position too? Am I right?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...

Login to post a reply

Server time is: 2025-06-25 09:14:41
Your offset time is: 2025-06-25 09:14:41