thomki / ro-rail

Automatically exported from code.google.com/p/ro-rail
0 stars 0 forks source link

RAIL_State.homu.lua reverts to default #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Added some monsters to the configuration
2.Vaporize Homunculus
3.Recall Homunculus

What is the expected outcome? What do you see instead?
Expected - My configuration file to have the changes i made to it
Outcome - Everything reverts back to default file

What revision of the product are you using?
171

What type of homunculus/mercenary are you using?
vanilmirth

Please provide any additional information below.
This is the file i modified
RAIL_State.homu - Backup.lua

This is the file i got after Vaporizing/Recalling Homunculus
RAIL_State.homu.lua

If i'm doing something wrong please let me know, thanks in advance

PD: Thanks for your hard work, this AI is simple more than one can expect when 
you know how to use it.

Original issue reported on code.google.com by Kusanag...@gmail.com on 3 Sep 2010 at 4:26

Attachments:

GoogleCodeExporter commented 8 years ago
When RAIL encounters errors in the state-file, it rebuilds it from scratch. 
This is a feature to prevent the RO client from throwing up endless error 
boxes. So if your state-file is getting rebuilt, you probably have an error in 
it.

In your case, it happens to be that you're forgetting to add the first table 
for each of your actors:

rail_state["ActorOptions"]["ByType"][1152] = {}
rail_state["ActorOptions"]["ByType"][1111] = {}
...
...

This is necessary because of the Lua scripting language. Unless you specify an 
object as a table (using, for example, the {} characters), it will be unable to 
access objects that are part of that table: 
rail_state["ActorOptions"]["ByType"][1111]["Name"] is invalid until the above 
are set. I hope you can understand what I mean.

Original comment by faithful...@gmail.com on 3 Sep 2010 at 4:44

GoogleCodeExporter commented 8 years ago
Yes i understand what you mean, simply arrays have to be declared before adding 
information to them, i'm a programmer myself so i get the point, but i'm a PHP 
programmer in which you can get away with empty declarations like that.

Thank you very much for you quick reply and support, apologize for the 
inconvenience.

Original comment by Kusanag...@gmail.com on 3 Sep 2010 at 4:49

GoogleCodeExporter commented 8 years ago
Ok. No problem. And I don't like to make assumptions about people, so I try to 
make everything as easy as possible when explaining... Glad you like RAIL so 
far :)

Original comment by faithful...@gmail.com on 3 Sep 2010 at 6:25

GoogleCodeExporter commented 8 years ago
As a suggestion though, i think it would be nice if RAIL creates a backup file 
for the errored config, probably pointing out where the error or at least where 
it starts, and then creating the new one; because for a mistake i lose all the 
big setup i did (gladly mine was big but still).

Another solution would be to allow to use a separate file for the actor options.

Also i know this might be disregarded when the GUI comes out.

Original comment by Kusanag...@gmail.com on 3 Sep 2010 at 12:13