Developing FATE on Ares

Hey there!

So I’ve got the FATE plugin installed and I’m digging into its guts. (EDIT: I found the tutorials sooooo nevermind about the original question here. This will just be a placeholder for discussion I guess!)

OK SO!

I had been mucking my way through adding a command to the Fate plugin, and I keep getting an error:

image

I want a Powers command that works basically the same way Stunts does, so I basically duplicated Stunts and changed the relevant bits:

image

I added a powers attribute to the character model, I made a powers .yml config file, and also ham-fisted an entry in fate.rb?

image

I am a pretty rank beginner and I know I’m doing SOMETHING wrong, I’m just not sure what?

1 Like

If you look at the debug log (instructions here) there should be additional information about exactly which line of code the error is coming from. I’m going to hazard a guess that it’s line 9 of your PowersCmd file:

list = powers.sort_by { |s| s['name'] }

Assuming that’s the case, it means that something it’s trying to sort is nil. This can happen if:

  1. The entire powers list is nil.
  2. The ‘name’ field for one of the powers is missing, which makes it default to nil.

When you created your fate powers.yml config file, is it putting the powers in the fate section? Does every power have a name? It should look like so:

fate:
    powers:
       - 
         name: Super Strength
         description: Whatever
         etc.
       -
         name: Super Speed
         description: Whatever
         etc.

Also be sure you did a load fate in-game to reload the fate code and configuration after messing with things on disk.

1 Like

Hmm! This is the error from the log:

2018-10-16 16:30:46 ERROR - Error in power: client=30 error=undefined method `sort_by' for nil:NilClass 
backtrace=["/home/ares/aresmush/plugins/fate/plugin/commands/powers_cmd.rb:9:in `handle'", 
"/home/ares/aresmush/engine/aresmush/plugin/command_handler.rb:25:in `on_command'", 
"/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:82:in `block (3 levels) in on_command'", 
"/home/ares/aresmush/engine/aresmush/error_block.rb:6:in `with_error_handling'", 
"/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:77:in `block (2 levels) in on_command'", 
"/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:75:in `each'", 
"/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:75:in `block in on_command'", 
"/home/ares/aresmush/engine/aresmush/error_block.rb:6:in `with_error_handling'", 
"/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:136:in `with_error_handling'", 
"/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:66:in `on_command'"] 

Here is the config file:

image

I think that’s referring to line 9 like you said, but I don’t see anything missing?

Yep, the backtrace shows that the error originated in powers_cmd.rb line 9.

The part of the config file you shared looks fine to me. Where is it, though? I noticed in the Ares fork that you seem to have it in plugins/fate/game/config but that’s not where config files live. Config files go in aresmush/game/config. Unless you copied it over, it’s not getting read.

(The automated plugin installer should place the files from the ares-extras repo in the right spot for you. Only stuff in the fate/plugin directory belongs under aresmush/plugins/fate. If you think the installer went awry, let me know!)

Oh no haha, the installer worked fine! I sort of reverse-engineered the stunts cmd and saw that that config file lived there in the plugin, so I assumed the powers one should go there as well. But that’s what the installer pulls from initially, right?

I can’t seem to find the directory you’re referring to on Git though. I know it’s there on my actual server, I’m able to find it when I log into the shell, but it doesn’t show up online, why is that? I have to plug it in through FTP?

1 Like

Yeah the ares-extras repo files are laid out so the auto-installer can grab them and shuttle them to the right places. It’s not the same directory structure as the regular code.

The game/config directory is excluded from GitHub control by default. This ensures there are no merge conflicts between the default game configuration and everyone’s individual games.

If you want to control your game config via GH, you can. Just edit the .gitignore file. You’ll want to remove this line ignoring the entire game directory:

(There are other lines in the git ignore file that ignore specific pieces of the game dir - like uploads and the secrets.yml config file - which you don’t typically want to put into source control.)

1 Like

EDIT: Didn’t realize git push had to be done from the shell, n/m.

alt text

WOOT!

Thanks @Faraday! :smiley:

1 Like