Difference between revisions of "Talk:GetSex - ActorBase"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Kahmul
(Wrong return values?)
 
imported>Fg109
Line 23: Line 23:
Can anyone confirm this?
Can anyone confirm this?
--[[User:Kahmul|Kahmul]] 18:46, 4 May 2012 (EDT)
--[[User:Kahmul|Kahmul]] 18:46, 4 May 2012 (EDT)
:It worked fine with this script:
<source lang="papyrus">Scriptname fg109TestMEScript extends ActiveMagicEffect
Event OnEffectStart(Actor akTarget, Actor akCaster)
Debug.Notification(akTarget.GetActorBase().GetSex())
EndEvent</source>
--[[User:Fg109|Fg109]] 19:36, 4 May 2012 (EDT)

Revision as of 18:36, 4 May 2012

Wrong return values?

Hey there, I got some problems with this function. It always returns 0, regardless of what I use and what gender the target is. Example:

ActorBase targetBase = target.getbaseobject() as ActorBase
if(targetBase.getsex() == 0)
  ; do stuff
endif

I also tried this:

ActorBase targetBase = target.getbaseobject() as ActorBase
if(targetBase.getsex() != -1) && (targetBase.getSex() != 1)
  ; do stuff
endif

And as I expected it's the same result. "Target" is a valid actor, excluding this as a error source.

Can anyone confirm this? --Kahmul 18:46, 4 May 2012 (EDT)

It worked fine with this script:
Scriptname fg109TestMEScript extends ActiveMagicEffect

Event OnEffectStart(Actor akTarget, Actor akCaster)
	Debug.Notification(akTarget.GetActorBase().GetSex())
EndEvent

--Fg109 19:36, 4 May 2012 (EDT)