Author Topic: Model growth 'farm' script  (Read 571 times)

Hey guys, Dionysus here, and I need a little help.

So for a while now, I've wanted to implement farming into CityRPG, and then later on, screwed the idea of CityRPG and just decided to make my own mod. I need a little help with farming, and mainly, the model growth part.

So if you've ever played Destiny/Zack0Wack0's DRPG, you know when you hit stuff with a pickaxe or axe it tells you how much damage is needed to harvest the ore, and does the same for farmable things and whatnot. That was when terrains were around and sadly I guess, that's changed because the crops in the mod grew on the terrain, not the brick.

I want to make certain blocks that grow models off of them, like, for every tick that passes, while that tick had passed, it had grown a bit. So say, i have like a 1x1f thats a CARROT PLANT. I plant it, water it, wait about 6 minutes, then its harvest time to i crack out my sickle and tear away at it. If its not ready to be harvested, i want it to say so.

Can anyone help me on this? I'd give credit in the credits part of my mod.
« Last Edit: November 02, 2012, 01:40:38 PM by Cnaibedoge »

You can use .setScale respectively assuming the 'plant' isn't an actual brick.

You can use .setScale respectively assuming the 'plant' isn't an actual brick.

Well, that's great to know, but that doesn't address how do I get it to grow off a certain brick, because terrains are no longer with us :(....that and I don't want people only growing crops in their basements.

Well, that's great to know, but that doesn't address how do I get it to grow off a certain brick, because terrains are no longer with us :(....that and I don't want people only growing crops in their basements.

With coding? Have a crop type brick that creates new crops when it is planted. Tell me, what class type is your crop?

The crops in DRPG are static shapes.

All you need is a position value...

With coding? Have a crop type brick that creates new crops when it is planted. Tell me, what class type is your crop?

But how would i get about making the brick spawn a dts model when placed?

Along the lines of:



Code: [Select]
function yourBrick::onPlant(%this)
{
     parent::onPlant(%this);
    %crop = new whateverTheCrop'sClassIs()
     {
           datablock = ...
           position = ...
           etc
     };

     missonCleanup.add(%crop);
}

Along the lines of:


Code: [Select]
[code][/code]
Code: [Select]
function yourBrick::onPlant(%this)
{
     parent::onPlant(%this);
    %crop = new whateverTheCrop'sClassIs()
     {
           datablock = ...
           position = ...
           etc
     };

     missonCleanup.add(%crop);
}

Thank you :)