dvkkha Posted November 5, 2016 Share Posted November 5, 2016 Hi again, something odd is happening with the GetRace command. When i use this script on generic npcs like guards, or forsworn I get 'FoxRace' as a result wich cant be right. Predefined NPCs like Townfolks correctly show their race. The script works on mammoths and cows too but not on giants ('foxrace' again). I don't understand whats going on.When I check their race via console I get the correct results, but the script doesn't. Even when i use the target condition isRace directly in the ck it works correctly. Event OnEffectStart(Actor Target, Actor Caster) victim = target ;debug.messagebox("victim == " + victim + ", is this right?") EndEvent ; When Victim dies.... Event OnDying(Actor Killer) ;Get Race ActorBase VictimBase = Victim.GetBaseObject() as ActorBase VictimRace = VictimBase.GetRace() debug.messagebox("Victim is: " + VictimRace ) Can someone explain to me whats wrong here?Or is there another way to get the race through script`? Link to comment Share on other sites More sharing options...
FrankFamily Posted November 5, 2016 Share Posted November 5, 2016 on the wiki of actorbase's getrace it sais: This will not work for a template NPC or LeveledActor as the actor references (ACHR) are dynamically created. it doesn't say so on the actor script version so i'd give it a try and save the casting Link to comment Share on other sites More sharing options...
dvkkha Posted November 5, 2016 Author Share Posted November 5, 2016 (edited) It works!! Changing ActorBase VictimBase = Victim.GetBaseObject() as ActorBase VictimRace = VictimBase.GetRace()to VictimRace = Victim.GetRace()did the trick. I'm using http://www.creationkit.com/fallout4/index.php?title=GetRace_-_ActorBase as wiki. Wich one where you refering to? Edited November 5, 2016 by dvkkha Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 5, 2016 Share Posted November 5, 2016 GetRace - ActorBase Skyrim sideThe one you linked is obviously incorrect for Skyrim as it has Fallout4 in the URL. Link to comment Share on other sites More sharing options...
Recommended Posts