Jump to content

How to separate creatures from other actors in a script


Recommended Posts

Posted

my script gives the actors (those in the location, gradually everyone) a bottle of wine,

 

actor opens his mouth and drinks it (an animation from the Taberu mod is played), but I noticed that the hares in the forest also started running with bottles of wine,

 

this surprised me, because that I recruited actors at index 43 (Cell.GetNthRef(index, 43), I did not know that animals were also there.

 

Posted

Bunny is 'actor'. Even mamuth is actor.

 

But not everyone(race) has keword ActorTypeAnimal. Or ActorTypeNPC. And so on.

 

In CK, check which Keywords a specific race has.

 

 

Posted

Giant is a creature but no animal.

Troll is creature and animal.

Sometimes you need to check the race, too.

e.g. have only trolls, you need a race check.

Posted (edited)
2 hours ago, Tlam99 said:

Giant is a creature but no animal.

Troll is creature and animal.

Sometimes you need to check the race, too.

e.g. have only trolls, you need a race check.

 

4 hours ago, Fotogen said:

Bunny is 'actor'. Even mamuth is actor.

 

But not everyone(race) has keword ActorTypeAnimal. Or ActorTypeNPC. And so on.

 

In CK, check which Keywords a specific race has.

 

 

 

What exactly to check? Take a function from a race or an actor?

=======================================

 

In short, I wrote -

 

        ObjectReference a =pCELL.GetNthRef(i, 43)
        if a != none
            Actor npc= a as Actor


            if ( npc.IsInCombat()==0) &&  (npc.IsDead()==0) &&(npc.IsDisabled()==0)
            if (npc.HasKeyWordString("ActorTypeAnimal"))==False
            if (npc.HasKeyWordString("ActorTypeCreature"))==False


                c2[i2] =npc

            endif
            endif

            endif

           

        endif

 

I don’t know whether it works or not, have to follow everyone, it’s a long time, I hope it works.

Edited by TDA
Posted (edited)

The keyword string thing won't work. Or do you use skse functions just for that ?

You need something like keyword property mykeyword auto.

For race

Race property my race auto

and fill this properties.

 

Like 

If !(npc.getactorbase().getrace(myrace) ll (npc.getactorbase().haskeyword(animal))

 

 

Edited by Tlam99
Posted

In general, 'humanoids' (man, mer, argonians, khajit) have ActorTypeNPC keyword.  'drink from a bottle' animation should only work on ActorTypeNPC.

 

 

Posted
4 hours ago, Fotogen said:

In general, 'humanoids' (man, mer, argonians, khajit) have ActorTypeNPC keyword.  'drink from a bottle' animation should only work on ActorTypeNPC.

 

 

Animation does not work on hares, just a bottle is attached to them, and they run with it that's why I noticed

Posted
On 7/15/2022 at 12:46 PM, TDA said:

my script gives the actors (those in the location, gradually everyone) a bottle of wine,

 

actor opens his mouth and drinks it (an animation from the Taberu mod is played), but I noticed that the hares in the forest also started running with bottles of wine,

 

this surprised me, because that I recruited actors at index 43 (Cell.GetNthRef(index, 43), I did not know that animals were also there.

 

Except for werewolf or vampire lord it is enough to check "IsPlayable" attribute (e.g. as a condition for alias or in Form Script). Trolls, giants, rabbits, etc. are not playable races.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...