Jump to content

Wierd result from GetRace (Guards are FoxRace)


dvkkha

Recommended Posts

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

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

  • Recently Browsing   0 members

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