Help on a Script Please

Post » Mon Nov 19, 2012 10:21 am

Spoiler
Scriptname gp_aaa extends ObjectReference  Actor Property PlayerRef  AutoActorBase Property target  Auto Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)        If akAggressor == PlayerRef		Target = GetBaseObject() As ActorBase		Debug.Notification(Target.GetLevel())		EndIfEndEvent
User avatar
Stephani Silva
 
Posts: 3372
Joined: Wed Jan 17, 2007 10:11 pm

Post » Mon Nov 19, 2012 9:09 am

Spoiler
Scriptname gp_aaa extends ObjectReference  Actor Property PlayerRef  AutoActorBase Property target  Auto Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)        If akAggressor == PlayerRef		Target = GetBaseObject() As ActorBase		Debug.Notification(Target.GetLevel())		EndIfEndEvent
User avatar
CHANONE
 
Posts: 3377
Joined: Fri Mar 30, 2007 10:04 am

Post » Mon Nov 19, 2012 12:19 pm

lol it worked at last, thx all
can someone help me now pleaseeeeeeeeeeeeeeeeeeeeeeeeeeee
all i wona do is to make a script and attach it to any actor on map, so i can get his level using on hit event.
if this script will not do the job, then please tell me how do i script it.
thx.
User avatar
Vickey Martinez
 
Posts: 3455
Joined: Thu Apr 19, 2007 5:58 am

Post » Sun Nov 18, 2012 8:19 pm

i am getting an error message : GetLevel Is not a function or does not exist
User avatar
loste juliana
 
Posts: 3417
Joined: Sun Mar 18, 2007 7:37 pm

Post » Sun Nov 18, 2012 9:29 pm

  Debug.Notification(GetLevel())
User avatar
Marguerite Dabrin
 
Posts: 3546
Joined: Tue Mar 20, 2007 11:33 am

Post » Mon Nov 19, 2012 7:24 am

http://www.creationkit.com/GetLevel_-_Actor is a member of the http://www.creationkit.com/Actor_Script, so won't exist for an http://www.creationkit.com/ActorBase_Script.

This should do the trick, although having to attach a script to each actor is not a very good approach to this for what I hope are obvious reasons:
Spoiler
Scriptname gp_aaa extends ActorActor Property PlayerRef AutoEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)	If akAgressor == PlayerRef		Debug.Notification(GetLevel())	EndIfEndEvent
If you want to be able to do this to every actor, you'll want to use a method like the one described here - http://www.creationkit.com/Dynamically_Attaching_Scripts

Cipscis
User avatar
Taylah Haines
 
Posts: 3439
Joined: Tue Feb 13, 2007 3:10 am

Post » Mon Nov 19, 2012 9:02 am

still getting same error message: GetLevel Is not a function or does not exist
i did fix the spoiler thing, did u check my script Justin ?
User avatar
Andy durkan
 
Posts: 3459
Joined: Fri Aug 03, 2007 3:05 pm

Post » Sun Nov 18, 2012 10:54 pm

I just compiled that script just to check and it does compile.

Did you change it to extend http://www.creationkit.com/Actor_Script instead of http://www.creationkit.com/ObjectReference_Script? That's necessary, because http://www.creationkit.com/GetLevel_-_Actor is a member function of Actor, and won't exist for scripts extending ObjectReference directly.

Cipscis
User avatar
sarah taylor
 
Posts: 3490
Joined: Thu Nov 16, 2006 3:36 pm

Post » Sun Nov 18, 2012 10:26 pm

Thx a lot Cipscis it worked fine at Last !
I have Added this in the Debug.Notification before the (GetLevel())
here is the Script, if someone wants to use it, all you need is to attach it to any actor on map in order to get the level without having to use the console everytime you want to get the enemy Level !!

Spoiler
Scriptname gp_aaa extends ActorActor Property PlayerRef  Auto  Auto State AutoStateEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)        If akAggressor == PlayerRef			Debug.Notification("Level " + GetLevel())        EndIf		GoToState("")EndEventEndState
User avatar
Sarah Edmunds
 
Posts: 3461
Joined: Sat Jul 08, 2006 8:03 pm

Post » Sun Nov 18, 2012 10:51 pm

Huh, don't know why I thought that was an actorbase script. Sorry about that, I should have checked the wiki.
User avatar
meg knight
 
Posts: 3463
Joined: Wed Nov 29, 2006 4:20 am

Previous

Return to V - Skyrim