Can Rimworld do animations?

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

Previous topic - Next topic

skullywag

Quote from: Haplo on October 02, 2014, 04:19:37 PM
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 :)

I've got mine changing power output based on weather. I'm guessing your doing something similar..

Going off topic here...anyone thought of a mod dev irc?
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Haplo

#16
You dont even want to know all the influences that this one has :)
weather is only one of it. Then there is also the blocking of the wind path or roofing there, a windpath thats shown, and so much more. Because of all the stuff it actually has, I removed a few things to don't loose a beginner too much in there ;)

Edit:
At least the animation is rather easy compared to some other stuff. And it's easy to find out how it works in there. So back to topic, you can find out how animation is doable through the sourcecode. And I'll take a look into your code skullywag and look how you're doing it in comparision :)

skullywag

Quote from: Haplo on October 02, 2014, 04:32:51 PM
You dont even want to know all the influences that this one has :)
weather is only one of it. Then there is also the blocking of the wind path or roofing there, a windpath thats shown, and so much more. Because of all the stuff it actually has, I removed a few things to don't loose a beginner too much in there ;)

Oooh id be interested in seeing the windpath stuff I've done the roof part just felt the wind path stuff would be too much hassle for the user, space is a premium in RW after all. However I haven't seen how you've done it so ill be quiet now..:)
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Haplo

Tell me when you're releasing yours. I'd like to take a look into how you're doing yours. I'm always open to learn new ways how to tweak some RimWorld code ;)

skullywag

Haplo ive yoinked yer codes!

you did it way more efficient than I did, i banged my head on my desk when i saw your code. I was working completely in the ticker with mapchanged....yours is soo....elegant.

Also your wind code... o.O  broke me....I get it....but I dont...
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Haplo

The wind code is originally an adaption from the code that's used in GenAdj. But as that is used to find the fields around an object, I had to adapt it to my requirements. Unfortunately it isn't really easy to understand if you don't know what I did. But a hint: The base variables mark the corner of the object. Independent of the rotation. And the 1 variable always is smaller than the 2 variable. And if you then remember that the position 0,0,0 is in the lower left corner, you can work with it :)
OK, yes I stop now. It took me a while to work out an easy to remember system to do what I needed..

mrofa

I i could just just clone your brain :D
All i do is clutter all around.

Makani

One more question^^;

Is there a way to pull in info from the XML defs directly? Like if I have two variations of a very similar bit of machinery, rather than mostly duplicate my code into two classes, I'd like to have both XML defs point to the same class and then just tweak the behavior a bit based on which variant was constructed...

mrofa

If i understand you right you want to have one class that is used by 2 defs, then yes its possible, just add a check
if(this.def.defname == "My_thing1")
All i do is clutter all around.

Makani

Quote from: mrofa on October 03, 2014, 02:06:19 PM
If i understand you right you want to have one class that is used by 2 defs, then yes its possible, just add a check
if(this.def.defname == "My_thing1")

This is exactly what I needed. Cheers!