power on stuff

Started by mrofa, March 11, 2014, 12:27:27 PM

Previous topic - Next topic

mrofa

Is it possible to change  object texture dependable on its power state ?
And is it possible to use power state to stuff like <beauty>
All i do is clutter all around.

Tynan

You'd have to program this functionality. Which isn't really possible in alpha 2 I'm afraid.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Darker

I fear that even alpha 3 will not let you change the beauty of things. Changing textures might be easier, though non-trivial.
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Tynan

Quote from: Darker on March 11, 2014, 02:26:09 PM
I fear that even alpha 3 will not let you change the beauty of things. Changing textures might be easier, though non-trivial.

I'll make Beauty and Transmitspower overridable properties.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Darker

Might be a better idea to make whole def overridable by some getter. Though this will cost some performance.

e.g.:

class ... {
    //Using some changes
    public override ThingDef getDef() {
       return this.changedDef;
    }
    //No changes
    public override ThingDef getDef() {
       return base.def;
    }
}



Of course, it would be beatiful to be able to ask directly for a property, but I can't see this possible without using strings. And using strings doesn't sound like a good idea.
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Tynan

Quote from: Darker on March 11, 2014, 02:57:25 PM
Might be a better idea to make whole def overridable by some getter. Though this will cost some performance.

e.g.:

class ... {
    //Using some changes
    public override ThingDef getDef() {
       return this.changedDef;
    }
    //No changes
    public override ThingDef getDef() {
       return base.def;
    }
}



Of course, it would be beatiful to be able to ask directly for a property, but I can't see this possible without using strings. And using strings doesn't sound like a good idea.

This would be a bad design because it breaks the basic paradigm of defs, which is that they represent static data associated with a kind of something.

If data is runtime - changeable by instance, it should be expressed in the instance, not by using defs to point an object at different versions of its own definition.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Darker

You're right Tynan. And I can see already some issues with that actually (e.g. a.getDef()!=b.getDef anymore).

Seems that the only option is then moving stuff from defs to classes, like the requires power or beauty.
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Tynan

Quote from: Darker on March 11, 2014, 03:33:00 PM
You're right Tynan. And I can see already some issues with that actually (e.g. a.getDef()!=b.getDef anymore).

Seems that the only option is then moving stuff from defs to classes, like the requires power or beauty.

Stuff can also be put in components (Comps in the RW codebase).

You could argue that I should have made Transmitter a component. Beauty - maybe. It's possible to go too far.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

mrofa

#8

This is essentialy what i did, and the general idea was for it to replace plants in beauty prodution at the cost of power insted of colonist time.
Now my plan B workaround is to make it a normal plant that just grows instantly and dont require colonist, will this work ?
All i do is clutter all around.

Darker

Your design is nice, but your logic not. It will be humans to plant and take care of house plants, I believe even in future. (I don't mean that apocalyptic future where mutated house plants take care of us of course)
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

mrofa

Its a holographic emmiter to project the plant, its kinda hard to plant there something by human :D
Anyways the plan b is a code method, since as for now its only 1 object, making the holograph as a plant would need 2 objects, basin and the projection. If i do projection as a plant object it can grow on itself meaning it will be independant of basin in terms of creating beauty, but dependand on basin energy consumption. This means basicly that if you turn of power the plant will dissapear and there would be no beauty prodution. Since at the moment emmiter produce beauty effect without power.
But i need more research on this since im a newbie in xml :)
All i do is clutter all around.

Darker

QuoteIts a holographic emmiter to project the plant
Oh didn't get it. But then your idea is awesome!!! Can't wait for Alpha 3 when you implement it!
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT