Allotrope wrote:I'm aliiive.
Good to hear. I have also been AWOL the last few days but I am back on track (haha, track) with the mod
OK, i worked on this today. I managed to get it sorted quite early on but I had to run a full render a few times and the latest version takes my machine about an hour to run. Here is a rundown of the changes I made
I set the animation end to be 256, a full rotation as the power wagon is not symmetrical. I set a keyframe at 257 that had a rotation on the Camera/Light node of Z:360. I also deleted the plane you were using for what I assume was a nicer light source, not because I didn't think it looked good but because I had no idea what it did until it was way too late and I didn't want to start from scratch again. I added a new dun and messed with the angle of the light. I also changed the render size to be 285x215 (what I thought was the same as the current wagon, it should be 218... whoops....) and the camera to a orthographic camera, not sure why put there is a factorio modding tutorial that says to use this camera so I did.
That sorted the animation out for the sprite but we were still missing the ground shadow. I moved the plane.02 (the ground) to a different scene and gave it a default material. I also enabled shadow rendering in it. Then i created a bunch of nodes so it overlays a transparent version of that shadow onto the ground. I found this
image, it is a great example of how to set it up. I added an alpha scale into it as well as the shadow was way too harsh, you can see that in the blend file.
Once that was done I installed
Spritify and
ImageMagick (needed for spritify) and set it to 4 tiles across (rows) and 0 offset. I am not sure if this gets saved into the blend file or if you will have to do it yourself but you will defiantly need to install ImageMagick.
Once you render the animation and you get a huge sprite sheet you need to cut it up. You can use Image Magick if you are lazy like me, this command should do it, just run it in windows from the command line. You will need to be in the correct directory:
Code: Select all
convert sprites.png +gravity -scene 1 -crop 1140x1744 cargo-wagon-spritesheet-%d.png
Right, that covers the changes I made... I think, if I missed anything or you need my explanation to be clearer just let me know. I'll probably write a tutorial on this at some point, if i do is it OK to use your blend file as an example? This should work now for all the wagons you want to make if you leave the animation and the scenes alone, just replace the model. if the model you have is symmetrical you can get away with only half the frames so set the end of the animation to be 128 before rendering to save a buttload of time.
Download the blend file
here and the updated version of Wagons (0.0.8)
https://drive.google.com/file/d/0B5wuQo ... sp=sharing. The only change in 0.0.8 is the new sprite and the associated fixes to the entity for the new sprites. I'm not going to update the first post with it because I am not sure how happy you are with the model. I think it is ready and if you are happy I'll make the edit asap, just let me know what you want to do.
Allotrope wrote:How were you handling the liquid storage wagons? Attaching a storage tank to them essentially?
I basically was dropping an invisible tank when the carriage was stopped. It would connect to a near by pipe and fill up. Then when you started to move I read the amount of the liquid in the tank and stored it so it could be restored later. The issue come up that I can't actually write that value to the tank when it gets put down, there is just no function call for it sadly. I did think of a really dodgy hack involving an invisible assembly machine and a bunch of recipes that create liquids, then an invisible pump that had a really high pump rate to fill the storage tank but it was to dirty, even for my standards. I have not given up but unless I come up with less dodgy plan it will have to stay out.
GewaltSam wrote:Looks good, I think I'll try this out

Awesome, let us know of any bugs or issues. It is pretty stable now but I am sure i missed some
starxplor wrote:As for liquid carts, isnt that the point of using barrels? fill barrels, stick em on a cart, and empty at the destination.
It is at the moment but it feels like a quick fix. The development road map talks about oil wagons so I assume that will replace barrels long term. It would have been cool to see it working though.
starxplor wrote:Any chance it might be uploaded somewhere else at a later date?
Here is a non google drive link, it is version 0.0.8. The only change from 0.0.7 is a awesome new sprite. Any reason you don't like google drive? I use it because I have an account and I know the file won't disappear in 6 months time. Is there a better option?
Rahjital wrote:It's the thing I'm looking towards to the most in this mod, although the other things are really useful as well.
As mentioned above I can't think of an easy way to implement this. I will get off my ass and request the feature be added to the API asap but I am not sure if/when they will happen. Maybe I could try my dodgy idea with the crafting recipes...