PDA

View Full Version : Faster ruleset debugging cycle



ianmward
July 4th, 2014, 09:24
Hi,

I am currently doing some ruleset development using eclipse as my ide. I have a project which points to the fg data ruleset folder and I am making changes and testinga lot ('cos I haven't got much idea what I'm doing yet) and the issue that I have is having to keep manually changing to the FZg app and /reload to update or if it's a module change, quit and restart.

Is there any way to call fg with command line arguments to load a given campaign or to anything like that? Also is there any way to remote control fg using an external program like eclipse or ant? Maybe, again using command line arguments to send chat commands...

Cheers,

Ian

Mask_of_winter
July 4th, 2014, 10:19
In the chat window type /reload

Moon Wizard
July 4th, 2014, 10:28
For modules, you can close and reactivate from the Module Activation screen.

For rulesets, the /reload chat command is the the mechanism. Also, make sure to use the Debug.chat/Debug.console commands to help you output Lua variables to uncover details of issues.

Regards,
JPG

Valarian
July 4th, 2014, 10:29
Without a visual layout editor (Psicodelix's project), there's no way to check the results of the XML changes without loading the changes in to FG. Editor on one screen, FG on a second. Type /reload to view the changes just done in the editor in the FG window. If you're working in a ruleset in the rulesets folder, this is the quickest method. Extensions can also be worked on in the unzipped form, in a sub-folder of extensions. Modules, as yet, can't.

ianmward
July 4th, 2014, 10:57
I know that I can manually switch from eclipse to fg and type /reload in the chat window but Inwas looking fir a way to automate this and/ or other actions from eclipse using ant. It would mean I could just make a change and have fg reload and open a character (for example) without having to do it manually each time. It would require fg client to have a listener for chat commands and a way to send them to it (maybe simply have a command line argument which forwards the command to a running fg).
I think it might be useful in other situations too you could have an external program sending messages to the chat window.

Trenloe
July 4th, 2014, 16:16
Another good tip for ruleset/extension debugging: remove all tokens from you /tokens folder while debugging (copy them back when you're playing). All tokens in these folders are loaded each time you type /reload. If you have a bunch of tokens in the /tokens directory it can make a few seconds difference in load time if you temporarily remove them while developing.

Moon Wizard
July 5th, 2014, 03:12
The same goes for modules and extensions. Close or disable ones that you are not specifically developing them.

Also, I usually type /reload in chat entry and drag to F12 so that I reload with a single key press.

Regards,
JPG

ianmward
July 5th, 2014, 03:51
That's a good idea!
I guess I can make a chat window command to open up a character sheet or open the combat tracker (depending which I'm debugging) and use a F key to reload and open?

ianmward
July 5th, 2014, 03:55
Whould it be possible to add LuaSocket support? I tried but it seem that FG doesn't support the required dynamic lua package stuff it needs.
With luasocket maybe I can add a listener socket and send it commands.

Ian

Moon Wizard
July 5th, 2014, 21:49
If you are trying to send commands between client/host use the OOB message support in the Comm package.

No plans to add socket support, since this creates some security questions and then you have even more port forwarding issues. The Lua within FG is deliberately sandboxed.

Regards,
JPG