Formlist Question

Post » Thu Feb 06, 2014 6:24 am

Hi all,

I'd like to use a script specifically to detect all game / animals nearby (and then output the distance to that animal from the player).

My script is:

nearestPrey = Game.FindClosestReferenceOfAnyTypeInListFromRef(prey, Game.GetPlayer(), 2048)
where prey is a FormList.
To build the list, I typed 'goat' in the CK, under the 'all' section, and dragged every NPC/LevelledList item and anything that vaguely resembled a goat (except sounds, art, etc) and put it in the list and saved.
I did the same for deer, elk, foxes.
When i go into the wild, and run the script, it can't find anything, even while standing right in front of a fox or a goat. Is there a way I can get their ID in the game and then somehow figure out where they are in the CK? The ID when you click on an animal in game is the REFID, right, and not the FORMID, so I can't just use that ID correct?
I have about 90 mods installed but don't really think any of them affect the goats or foxes (but if they did, wouldn't they be part of the GoatFaction or FoxFaction?). And if those factions are on the formlist, wouldn't the goat come up in my script?
..To prove the thing wasn't broken in another way, I just typed help "goat" 4 and about 15 matches came up. then I spawned all 15 and when I ran the command it found one of them (only one, however).
What do you think is happening?
Thanks!
User avatar
Euan
 
Posts: 3376
Joined: Mon May 14, 2007 3:34 pm

Post » Thu Feb 06, 2014 8:22 pm

Try again using a formlist that has only Actor type objects in it. Including multiple types of things in a formlist can sometimes break functionality, it is only intended to hold a group of the same types of forms. You should only need actor types anyways, leveled lists are just used to generate the animal actors.

User avatar
JaNnatul Naimah
 
Posts: 3455
Joined: Fri Jun 23, 2006 8:33 am

Post » Thu Feb 06, 2014 11:42 am

this is great thanks for sharing - under actor I see all the races, like 'alduinrace' and 'goatrace'

so bascially just take every item from under 'goat race' 'fox race' 'deer race' etc and keep it from the same form and good to go?

thanks!

User avatar
keri seymour
 
Posts: 3361
Joined: Thu Oct 19, 2006 4:09 am


Return to V - Skyrim