Author Topic: Ravens (and other birds) landing on the ground  (Read 339 times)

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Ravens (and other birds) landing on the ground
« on: August 24, 2011, 10:07:50 pm »


                <watching birds through a spyglass...>

I've just watched one of _Six's videos. Nice. There is a spot of really well designed atmosphere where the player startles a couple crows up and away from a corpse...

One of the things that has always annoyed me about my familiar (Bother,a very cynical raven) is that she would just hang aroound flapping, even if I was resting.

_Six: Are those crows custom creatures? Do normal crows (and other birds) have an animation that lets them land and perhaps hop about a bit *on the ground*?

I never realized how much that bugged me until I saw your crows on the ground... has me in a tizzy, it does. :-/

I only have about an hour on the laptop when I get home, and I *was* gonna spend it in GMax, but...

<...and he's not talking about avians>
               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Ravens (and other birds) landing on the ground
« Reply #1 on: August 24, 2011, 10:27:56 pm »


               Crows are a custom creature - a reskin and slight model change of the 1.67 patch 'walking' seagulls. You'd need to make another seagull-based version to get the same effect. I don't think the 'small' animation set supports resting animations unfortunately. My crows are in Project Q, if you're interested. I may well add other birds if I get chance to.

The appear and disappear effects are used for taking of and landing. In the mod I just made the birds disappear on a timer with a condition to reappear only if there's no player within a certain distance. I ended up going to laggy way of a delayed pseudo heartbeat in between heartbeats to prevent a delay between approaching the birds and them flying away. You could do it much more efficiently with a trigger.
               
               

               


                     Modifié par _six, 24 août 2011 - 09:28 .
                     
                  


            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Ravens (and other birds) landing on the ground
« Reply #2 on: August 24, 2011, 10:38:17 pm »


               Here's a script for you. Select the flying creature of a seagull - or other bird with associated appearance.

OnDamage

//::///////////////////////////////////////////////
//:: Name n_dam_seagull
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Seagull On Damaged
*/
//:://////////////////////////////////////////////
//:: Created By: nereng
//:: Created On: 018.05.06
//:://////////////////////////////////////////////
#include "nw_i0_generic"
void main()
{
    object oDamager = GetLastDamager();
    if (!GetIsObjectValid(oDamager)) return;
    if (GetIsDead(OBJECT_SELF) == TRUE) return;
    SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_SEAGULL_FLYING);
    // I am damaged, so I won't return
    effect eFly = EffectDisappear();
    DelayCommand(0.7, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFly, OBJECT_SELF, 30.0));
    if (GetCreatureSize(oDamager) > 1)
    {
        //Shout for friends to flee as well
        SpeakString("N_FLEE_ALL", TALKVOLUME_SILENT_TALK);
        PlaySound("c_seagull_atk2");
    }
    // Send the user-defined event signal
    if(GetSpawnInCondition(NW_FLAG_DAMAGED_EVENT))
    {
        SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DAMAGED));
    }
}

OnDisturbed


//::///////////////////////////////////////////////
//:: Name
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
     Seagull OnDisturbed
*/
//:://////////////////////////////////////////////
//:: Created By: nereng
//:: Created On: 18.05.06
//:://////////////////////////////////////////////
#include "nw_i0_generic"
void main()
{
    object oTarget = GetLastDisturbed();
    if (GetIsObjectValid(oTarget))
    {
        // Someone nicked a feather? Fly away and don't come back!
        SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_SEAGULL_FLYING);
        effect eFly = EffectDisappear();
        DelayCommand(0.7, ApplyEffectToObject(DURATION_TYPE_INSTANT, eFly, OBJECT_SELF));
    }
    // Send the disturbed flag if appropriate.
    if(GetSpawnInCondition(NW_FLAG_DISTURBED_EVENT))
    {
        SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DISTURBED));
    }
}

OnPhysicalAttacked


//::///////////////////////////////////////////////
//:: Name n_att_seagull
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
     Seagull On Physical Attacked
*/
//:://////////////////////////////////////////////
//:: Created By: nereng
//:: Created On: 18.08.05
//:://////////////////////////////////////////////
void main()
{
    object oAttacker = GetLastAttacker();
    if (GetIsObjectValid(oAttacker))
    {
        if (GetCreatureSize(oAttacker) == 1)
        {
            // Not running away from tiny creatures
            ExecuteScript("nw_c2_default5", OBJECT_SELF);
        }
        else
        {
            // Need to delay it in order to see if we got wounded or killed.
            DelayCommand(1.5, SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_ATTACKED)));
        }
    }
}

OnSpawn


//::///////////////////////////////////////////////
//:: Default: On Spawn In
//:: n_sp_seagull
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Seagull OnSpawn
*/
//:://////////////////////////////////////////////
//:: Created By: nereng
//:: Created On: 18.05.06
//:://////////////////////////////////////////////
#include "x0_i0_anims"
void main()
{
    SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
    SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT);
    SetListeningPatterns();
    SetListening(OBJECT_SELF,TRUE);
    SetListenPattern(OBJECT_SELF, "N_FLY_AWAY", 2001);
    DelayCommand(1.5, SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_SEAGULL_WALKING));
}

OnUserDefined


//::///////////////////////////////////////////////
//:: Custom User Defined Event
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By: nereng
//:: Created On: 18.05.06
//:://////////////////////////////////////////////
void main()
{
    int nUser = GetUserDefinedEventNumber();
    if(nUser == 1004) // ON DIALOGUE
    {
        int nMatch = GetListenPatternNumber();
        if(nMatch == 2001)
        {
            // Someone shouted to fly away. Do that, but return later.
            SetLocalInt(OBJECT_SELF, "BUSY_WITH_ANIMATION", 1);
            SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_SEAGULL_FLYING);
            effect eFly = EffectDisappearAppear(GetLocation(OBJECT_SELF));
            DelayCommand(0.7, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFly, OBJECT_SELF, 30.0));
            DelayCommand(22.1, SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_SEAGULL_WALKING));
            DelayCommand(22.2, SetLocalInt(OBJECT_SELF, "BUSY_WITH_ANIMATION", 0));
        }
    }
    else if(nUser == 1005) // ATTACKED
    {
        int nMax = GetMaxHitPoints();
        int nCurrent = GetCurrentHitPoints();
        if (GetIsDead(OBJECT_SELF) == FALSE &&
            nMax == nCurrent)
        {
            // Neither dead nor damaged; fly away and return later
            SetLocalInt(OBJECT_SELF, "BUSY_WITH_ANIMATION", 1);
            SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_SEAGULL_FLYING);
            effect eFly = EffectDisappearAppear(GetLocation(OBJECT_SELF));
            DelayCommand(0.7, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFly, OBJECT_SELF, 30.0));
            DelayCommand(22.1, SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_SEAGULL_WALKING));
            DelayCommand(22.2, SetLocalInt(OBJECT_SELF, "BUSY_WITH_ANIMATION", 0));
        }
    }
}

Now you'll have birds that fly away when approached and land again when the player has moved away.

FP!
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Ravens (and other birds) landing on the ground
« Reply #3 on: August 24, 2011, 11:09:54 pm »


                <looks...>

Well, at least it's not based on the chicken :-P

Thank you both. Guess I'll stick to the plan (GMax) tonight and worry 'bout Bother later.

I don't think the 'small' animation set supports resting animations unfortunately. 

_Six: From the CCP forums (Lesson 8) one of the animations (and it *should* have been on the default birds IMOHO) is

cpause1- (Pause)- This is the animation a creature does when it its not actively engaged in combat or threatened. Generally the creature looks around a bit, shifts somewhat, wags it’s tail etc. *

I think all the birds should land and maybe hop a bit on the pause anim.  Definitely not hover in the air like a big dark humming bird :-P Maybe one day I'll do something about it :-/

My crows are in Project Q, if you're interested.

I am :-)

Now you'll have birds that fly away when approached and land again when the player has moved away.

FP: Thanks :-) I do like to give creatures behaviors =) Lobotomized creatures drive me batty. Er, *more* batty :-)

Add a quick check for animal empathy... ;-) Gotta support your local ranger!

Still hate the chickens, though...

<...hen-pecked>
               
               

               


                     Modifié par Rolo Kipp, 24 août 2011 - 10:14 .