Need Help on calling my function Please

Post » Mon Nov 19, 2012 11:38 am

Hello !
I have already made my function, and called it within the same script file i placed it in , and test it out it works fine.
now i would like to save my function on a separate script file, and then call it from any script file i would like in the game.
First, in order to do that I would like to know what type of script Extends i need to give the file, Example: Scriptname GP_myfunctionScript extends (???) . Shall i give it Actor, Objectreference, Script or what ?
Second, how do I call it from another script file ?
here is an example of the file i want to call it from using an Event OnDeath


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("")EndEventEndStateEVENT OnDeath(Actor akKiller)	if (akKiller == Game.GetPlayer())		;Call My Function in here.	EndIfEndEvent	
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am

Post » Sun Nov 18, 2012 11:43 pm

Spoiler
ScriptName gp_aaa Extends ActorImport GP_myfunctionScriptActor Property PlayerRef Auto  Auto State AutoState	Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)		If akAggressor == PlayerRef			Debug.Notification("Level " + GetLevel())		EndIf		GoToState("")	EndEventEndStateEvent OnHit()	; Do NussinkEndEventEvent OnDeath(Actor akKiller)	If akKiller == PlayerREF		YourFunction()	EndIfEndEvent
ScriptName GP_myfunctionScriptFunction YourFunction() GlobalEndFunction
User avatar
Taylrea Teodor
 
Posts: 3378
Joined: Sat Nov 18, 2006 12:20 am

Post » Mon Nov 19, 2012 11:25 am

Thank you Justin, it works Perfect now !
Gus.
User avatar
Danny Warner
 
Posts: 3400
Joined: Fri Jun 01, 2007 3:26 am


Return to V - Skyrim