1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Help with dropping grain from grain plant

Discussion in 'Modding Help' started by Tsilliev, Aug 18, 2013.

  1. Tsilliev

    Tsilliev Haxor

    Messages:
    414
    Hi, do you know how to enable the grain to be dropped when the grain plant is destroyed? I searched a lot around the code I found the
    Code:
    void onDie(CBlob@ this)
    {
        if (getNet().isServer())
        {
       
            if (this.hasTag("has grain"))
            {
                for (int i = 1; i <= 3; i++)
                {
                    CBlob@ grain = server_CreateBlob( "grain",this.getTeamNum(),this.getPosition() + Vec2f(0,-12));
                    if (grain !is null) {
                        grain.setVelocity(Vec2f(Random(5)-2.5f,Random(5)-2.5f));
                    }
                }
            }
        }
    }
    I guess it should be here but what to change or to add?
     
    norill likes this.
  2. uncomment line 94 in GrainPlant.cfg
     
    Tsilliev likes this.
  3. Tsilliev

    Tsilliev Haxor

    Messages:
    414
    Omg i deleted the # and now its okay, thanks, farming is back :D
    --- Double Post Merged, Aug 18, 2013, Original Post Date: Aug 18, 2013 ---
    And do you know how to respawn migrants from dorms?