Can Rimworld do animations?

Started by Makani, October 02, 2014, 01:06:50 AM

Previous topic - Next topic

Makani

Like for buildings and such... is it possible to use an animated graphic?

mrofa

No it cant use animated graphic, but with .dll you can do animation per frame.
All i do is clutter all around.

Evul

Quote from: mrofa on October 02, 2014, 01:19:55 AM
No it cant use animated graphic, but with .dll you can do animation per frame.

As above yes. :-)

Rikiki

You can look at Clutter Hologram lamp or Deepdriller Mobile mineral sonar.
Those mods both have animations.
You change the texture parameters (rotation, scale, material~=texture path, fading) you want in the Tick() function and the Draw() function will reflect that.

Haplo

If you want to have an example how it could be done, I'm working on upgrading the .dll example at the moment.
You'll have a wind turbine in there, which uses 12 different frames to animate it.
Give me a few more days and it is ready for presentation :)

Makani

Thanks everyone. Haplo, I'm looking forward to that--your existing example has been really helpful.

While this thread is going, I'm going to try a slight hijack to avoid thread clutter...^^; Two more questions!

How do I get info on amount of sunlight, a la solar panels?
How can I change if something transmits power or not (i.e. switch type things)?

Haplo

You can find it in the dll of the Building_PowerPlantSolar:

            if (!Find.RoofGrid.Roofed(base.Position))
            {
                this.powerComp.powerOutput = Mathf.Lerp(0f, 1700f, SkyManager.curSkyGlowPercent);
            }
            else
            {
                this.powerComp.powerOutput = 0f;
            }


And switch.. I would suggest a peek into my power switch mod :)
That is not as trivial ;)

Makani

Hmm. Pardon my ignorance, I don't normally develop in a .net environment... how are you able to expose the dll's code like that? The best I can get is definitions from the object browsers, at least trying to figure this out on my own...

mrofa

All i do is clutter all around.

Makani

You all are awesome. Thanks very much for your help!

Haplo

Personally I like the Telerik JustDecompile better, but that is just personal preference ;)

skullywag

I have a local copy of my morepower mod that has the betterpower wind turbine in it (slightly tweaked to my liking) that has the full animation the original artist intended. Ill be releasing it shortly with source code.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Haplo

First one ;)
The example project has been updated.
In there you'll find a wind turbine with animations too :)

skullywag

Quote from: Haplo on October 02, 2014, 04:13:52 PM
First one ;)
The example project has been updated.
In there you'll find a wind turbine with animations too :)

Lol

Good job. I've had mine for weeks locally as I do with a lot of stuff I mess with.

Be interested to see if you did it how I did it.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Haplo

I'm warning you though that the finished mod wind turbine is a bit more enhanced than what is in the source code..
I've decided to leave a bit of the harder part out, so that the source code is at least a little bit readable for a beginner :)