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

Need Help For Bison Mod!

Discussion in 'Modding Help' started by qpKillerqp, May 29, 2013.

  1. qpKillerqp

    qpKillerqp Haxor

    Messages:
    99
    Hey everyone,

    So I was working on a mod which adds a saddle item!This would act as a cake(controllable Bison),however,I'm planning to increase the speed of the bison when used.I have faced several problems when it came to scripting...In AnimalBrain.as this is what I typed
    Code:
    // has a saddle
    else if (mode == MODE_SADDLE)
    {
    CBlob@ friend = getBlobByNetworkID(blob.get_netid(friend_property)); 
    if (friend is null )
    {
    mode = MODE_IDLE;
    }
    else
    {
    Vec2f tpos = friend.getPosition(); 
    const f32 search_radius = blob.get_f32(target_searchrad_property); 
    const f32 dist = (tpos - pos).getLength();
    if (dist >= search_radius)
    {
    //mode = MODE_IDLE;  search until death sets us apart
    }
    if (blob.getRadius()*2.0f < dist)
    {
    blob.setKeyPressed( (tpos.x < pos.x) ? key_left : key_right, true);
    //blob.setKeyPressed( (tpos.y < pos.y) ? key_up : key_down, true); hack for land animal
    }
    }
    And so when I spawn any animal,all of them are frozen , leading to that file directory!!!

    Any help?
     
  2. BoiiW

    BoiiW Shark Slayer

    Messages:
    338
    If only I had 1% knowledge of scripting.
     
    miniu, Guitarman and PinXviiN like this.
  3. Invaders

    Invaders Shark Slayer

    Messages:
    249
    If you start from fresh code, there should be a way to change speed as its own variable, or just decrease friction, which would make it a tad funnier.
     
  4. qpKillerqp

    qpKillerqp Haxor

    Messages:
    99
    My main concern is how to add the saddle in the AnimalBrain and not on increasing speed,as it can be changed easily!
     
  5. Invaders

    Invaders Shark Slayer

    Messages:
    249
    If you're trying to make the saddle render the animal friendly, give it that same properties as food, with a 100% chance of making it friendly.