Difference between revisions of "Talk:GetSex - ActorBase"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Fg109
imported>Kahmul
Line 31: Line 31:
EndEvent</source>
EndEvent</source>
--[[User:Fg109|Fg109]] 19:36, 4 May 2012 (EDT)
--[[User:Fg109|Fg109]] 19:36, 4 May 2012 (EDT)
:Still doesn't work. But when I use the console ("getissex") it returns the right value. Strange.
<source lang="papyrus">
Notification("sex = " + target.getactorbase().getsex())
</source>
The only error source, that makes sense, could be that target = none. But I get it through gettargetactor() and all other functions are working.
Maybe there's a problem with getbaseobject() or getactorbase()? But that cannot be, because it is working for you but not for me.
--[[User:Kahmul|Kahmul]] 07:40, 5 May 2012 (EDT)

Revision as of 06:40, 5 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)

Still doesn't work. But when I use the console ("getissex") it returns the right value. Strange.
Notification("sex = " + target.getactorbase().getsex())

The only error source, that makes sense, could be that target = none. But I get it through gettargetactor() and all other functions are working.

Maybe there's a problem with getbaseobject() or getactorbase()? But that cannot be, because it is working for you but not for me. --Kahmul 07:40, 5 May 2012 (EDT)