Airships Mod [WIP]

You have 2 options

"mixintos" : {
         "/stonehearth/jobs/weaver/recipes/recipes.json" : "/airships_mod/jobs/weaver/recipes/recipes.json"
 }

"mixintos" : {
         "/stonehearth/jobs/weaver/recipes/recipes.json" : "file(jobs/weaver/recipes/recipes.json)"
 }

From PHP include when a "root forward slash" precedes the included path like: "/folder/file.php" - Stack Overflow

A path starting with / is usually interpreted as an absolute path (relative to the environment). So Dreamweaver might interpret the root (i.e. /), as the projectā€™s root path, while a unix server (and as such php that runs on it) interprets the path as the root in the directory system. And on HTTP, it usually refers to the document root of the current domain.

The best solution would be to simply use relative paths, i.e. paths starting with ., like ā€¦/ā€¦/folder/file.php.

In our case of using " / ", the absolute path is $(stonehearth_install_path)/mods/ + what you write.

Your "/jobs/weaver/recipes/recipes.json" equates to

$(stonehearth_install_path)/mods/jobs/weaver/recipes/recipes.json

Which does not exist :wink:

Hope this helps

EDIT

Side Note

I use http://jsonlint.com/ to format and verify my .json files.

2 Likes

Hmm? Thatā€™s fine I donā€™t care.

Also thanks once again. You helped a lot.

EDIT: @honestabelink I edited everything to what you said and for some reason it still wonā€™t work. it will not show up in the weavers menu. It just isnā€™t there. is there a way i can tell if the game is even loading the mod?

1 Like

Yes, itā€™s hacky and lame, but you could specify a client or server startup script. In the script, call a function that doesnā€™t exist, the error would be found in the Stonehearth log file, locate in the ā€œstonehearthā€ folder, just before the mods folder. It seems though with the recent updates it is lacking even more error printing, making tracking down bugs harder. But if the error shows up then it is indeed loading your mod. :wink:

Client or Sever, theyā€™re just .lua files

 "client_init_script" : "file(stonehearth_client)",
 "server_init_script" : "file(stonehearth_server)",

Add it to your manifest, check stonehearthā€™s to see an example.

Then just call to something that doesnā€™t exist. Like

radiant:error_so_i_know_my_mod_loads()

Figured I check what you have again, and it works fine on my end. If I had to guess what was going onā€¦

Are you just placing the ā€œairships_modā€ folder in your modā€™s folder, or are you copying the whole git. Only ā€œairships_modā€ should go into the modā€™s folder.

Try doing that and removing anything extra.

Overall, I would recommend setting up your project again.

  1. Iā€™d have git create the repo right in my mods folder, this avoids having to maintain two copies of the mod. Maintaining two copies is very error prone.

  2. Iā€™d move the the whole repo under a new name, ā€œairshipsmodā€, then remove ā€œairships_modsā€ folder, and place it contents right into the root folder for the repo. Then rename a few thingsā€¦ :wink:

    There is no real reason to have that extra folder in the way, having it would also prevent what I discussed in suggestion #1 from working.

This is only a suggestion, but it would make things simpler in the long run as your project grows in size. I donā€™t know how git will handle the re-naming change, if I was in your position, Iā€™d back up my work, delete the repo and create a new one under the new name, then add the files back that are needed.

If you have anymore questions feel free to ask, :wink:

1 Like

If the log does not contain any error message including your modā€™s name, your mod is likely loaded. I havenā€™t had one example where this wasnā€™t the case yet.

Iā€™ve come across errors not being caught beforeā€¦ off the top of my head I remember

"mixintos": {
        "/stonehearth/jobs/carpenter/recipes/recipes.json": [
            "file(mixins/carpenter_recipes.json)",  <- EXTRA COMMA HERE
        ]
    },

logged no errors but is invalid and did not load.

1 Like

Hm, thatā€™s new to me. I know that the JSON library theyā€™re using is everything but proper standardised, but so far these errors in the manifest have been ignored (but not elsewhere) to my knowledge. In any case, proper feedback about JSON validation would be nice.

Then again, thereā€™s Jofferson for that.

@honestabelink Would you mind sending me your completed working airships_mod folder? It simply will not work. I have tried just putting the airships_mod folder in but it will not work. I will recreate my repo but I think putting it in the mods folder would be troublesome wouldnā€™t it?

New repo: GitHub - nicedude80/airshipsmod: A Stonehearth mod thast adds airships.

Iā€™ve never had any trouble with the extra files git creates. Currently Iā€™m working with someone on a mod and this is what both of us are doing. Itā€™s possible in the future it might be, but as of now it seems fine. Plus you donā€™t have two copies to manage. :wink:

Hereā€™s a .smod for ā€œairshipsmodsā€, just place it right into your mods folder.

Whatā€™s currently in your mods folder? Perhaps something else is getting in the way. Other than that because of the re-name, the files currently in the new git need to be updated to reflect the change.

You have to change all occurrences of

airships_mod

to 

airshipsmod

I would suggest removing everything in your mods folder, leaving only

stonehearth.smod
radiant.smod

Then adding my file in.

This is just to ensure there nothing that could be getting in the way. If this still wonā€™t load, then I canā€™t advice you any further. The only thing Iā€™d say is, itā€™s possible youā€™ve modified stonehearthā€™s/radiantā€™s files perhaps without knowing, I would recommend a fresh install, un-install then check and remove any left over files before re-installing, followed by placing only my file back into the mods folder and seeing what turns up.

Hereā€™s to hoping :wink:

2 Likes

Still didnā€™t work :frowning: It must be something on my side then. I will reinstall the stonehearth.smod and the radiant.smod

I didnā€™t realize this before, are you by chance not using the stream client, or have not opted in for the latest release?

After youā€™ve re-installed, check in main menu to see what version you are running, you should see
"release 195" in the bottom left hand corner.

1 Like

I am indeed using steam and the latest build. (r 195) Also should I use the ā€œcompressionā€ option in Qubicle?

No, in the past Iā€™ve seen error catching for compressed .qbā€™s, I canā€™t say for sure if itā€™s still there but I donā€™t see why not. If that was the problem it would be very clear it was the cause.

So itā€™s still not working?

2 Likes

No, reinstalling fixed everything. The only problem now is I have a very tiny .png icon lol. One thing though, where do I find the thing to set the render scale for the placed object?

Great :smile:

Looks like you had been running a different version of stonehearth all alongā€¦ at least that would be my guess now.

Scaling is applied in the ghost.json files for entities that are placeable.

Hereā€™s what your balloon_1_ghost.json would look like with scaling applied.

{
    "components": {
        "model_variants": {
            "default": {
                "models": [
                    "file(balloon_1.qb)"
                ]
            }
        },
        "render_info" : {
           "scale" : 0.2
        },
        "unit_info": {
            "name": "Balloon 1",
            "description": "Allows villagers to fly.",
            "icon": "file(balloon_1.png)"
        },
        "stonehearth:material": {
            "tags": "cloth refined crafted decoration"
        },
        "mob": {
            "model_origin": {
                "x": -0.05,
                "y": 0,
                "z": 0
            },
            "region_origin": {
                "x": 0.5,
                "y": 0,
                "z": 0.5
            }
        }
   }
}

What you should be concerned with

   "render_info" : {
      "scale" : 0.2
   },

Just change the value around, see what looks good. :wink:

If youā€™d like examples, there are lots of use of scaling in

stonehearth\entities\decoration\    

Again glad everything is working, if you have any other questions be sure to ask :slight_smile:

2 Likes

So it isnt working againā€¦ I did find this in the stonehearth.log though:

2015-Jan-11 18:32:28.989395 | server | 1 |                        resources | Could not find hash for module "airshipsmod".
2015-Jan-11 18:32:29.033449 | server | 1 |                        resources | Modules have been modified by the user!

Iā€™ve just run your git with no problemsā€¦

This is normal.

This is not and is likely the cause of the trouble, I donā€™t really know the cause, I havenā€™t see that issue before. Try removing ā€œairshipsmodā€, running Stonehearth maybe even making a save, close Stonehearth and put your mod back. Like I said I havenā€™t come across this issue.

If that doesnā€™t work try packaging up airsshipsmod back to a .smod and removing anything other than the stonehearth.smod and radiant.smod from the mods folder.

2 Likes