Author Topic: Static Shape Questions [Solved]  (Read 970 times)

1. Is there some colorShiftColor for static shapes? If so how do I use it?
2. How would I make a function that grows a static shape from %obj.minScale to %obj.maxScale over time?
« Last Edit: November 18, 2012, 09:54:47 PM by jes00 »

1. Is there some colorShiftColor for static shapes? If so how do I use it?

Just like you'd color players.
object.setNodeColor( node, color );

2. How would I make a function that grows a static shape from %obj.minScale to %obj.maxScale over time?

Combine schedules and object.setScale( value );

1. Is there some colorShiftColor for static shapes? If so how do I use it?

Just like you'd color players.
object.setNodeColor( node, color );
Cool. How do I figure out the nodes? Are they the object names in the module?
2. How would I make a function that grows a static shape from %obj.minScale to %obj.maxScale over time?

Combine schedules and object.setScale( value );
But how do I calculate the value?

Cool. How do I figure out the nodes? Are they the object names in the module?

Nodes are defined in the model. I think the node names are stored as plain text somewhere near the end of the DTS file. Also, if you need to color everything, just use ALL as the node.

But how do I calculate the value?

I'm not here to help you with basic math.
« Last Edit: November 18, 2012, 12:24:38 PM by Port »

But how do I calculate the value?
function staticShape::grow(%this)
{
    %this.setScale(vectorAdd(%this.getScale(),"0.1 0.1 0.1"));
    %this.growSchedule = %this.schedule(100, grow);
}

function staticShape::grow(%this)
{
    %this.setScale(vectorAdd(%this.getScale(),"0.1 0.1 0.1"));
    %this.growSchedule = %this.schedule(100, grow);
}
Alternatively, for exponential growth, use vectorScale(%this.getScale(),"1.1")
I have a feeling you're doing a crops thing though, so the first one is better for you anyway