EvaluatePackage on the Alias AI Packages - is this right

Post » Wed Jun 20, 2012 2:20 am

Can someone help me with my code?

I need to run EvaluatePackage on the AI Package stack belonging to the Alias (not on the AI stack on the editor NPC's filling the alias).

This code is attached to the alias I intend to run the script on.

Spoiler
Scriptname Temp_EvaluatePackageScript extends ReferenceAliasReferenceAlias Property Follower Auto   ; or should the property type be alias instead?Event OnLoad();some code	 RegisterForUpdate(5);some codeEndEventEvent OnUpdate();some code	 Follower.EvaluatePackage()	 ; This must run on the AI belonging to the alias (Follower), not the AI on the NPC currently filling the alias;some codeEndEvent

I'll unregister for update later :smile:

EDIT: I know these will compile...

Self.GetActorRef().EvaluatePackage()

...but the wiki says "Attempts to retrieve the actor this alias is pointing at", so it will not run on the packages actually on the alias. At least, as far as I know. :blink:

or even...

Self.GetRef().EvaluatePackage()

Here the wiki says it "Attempts to retrive the object reference this alias is pointing at", so this will probably not work as again, it will not run on the alias AI stack. Or at least I think so :ermm:

EDIT 2 I also tried this... but the compliler hates it. Its gives this error...

\steam\...\temp\prefix_EVPScript.psc(20,9): EvaluatePackage is not a function or does not exist

So all that means is the function is not visible to the compiler atm. So what would I need to do to make this function visible to the compiler.

Spoiler
Scriptname EvaluatePackageScript extends ReferenceAliasquest property DialogueFollower AutoEvent OnLoad(); some code	 RegisterForUpdate(5); some codeEndEventEvent OnUpdate();some code	 Alias myAlias = DialogueFollower.GetAlias(0)	 myAlias.EvaluatePackage();more codeEndEvent
User avatar
Daniel Lozano
 
Posts: 3452
Joined: Fri Aug 24, 2007 7:42 am

Post » Tue Jun 19, 2012 4:46 pm

Can someone help please... I can't get this to work without really understanding how elements depend on each other. Things like when to cast or other data to include. It reminds me of "classes" in other OOP languages like C# /C++, not that I have done much of that. It seems like an elementry thing to do, simply to evp the current follower, but when you have not done enough to get used to the new way we have to code - its not so easy. Or am I wrong in my assumption that the code that does compile will not evp the AI on the alias.

EDIT: I trying to make the second version of the script work, and just need to make EvaluatePackage visible to the compiler.

EDIT:
hmmmn.... still stumbling about in the catacombs, blooded and without a torch - but perseverence wins, right?

so I tried this, since EvaluatePackage is a member of the Actor Script. I think this is the biggest clue to get this working btw, but casting is not doing it.

Alias myAlias = DialogueFollower.GetAlias(0) as Actor
myAlias.EvaluatePackage()

Also I cant bring in the actor script such as ,,, nameofscript property scriptproperty auto e.g.

Actor property myActor Auto

since the script name is also a type.
User avatar
hannah sillery
 
Posts: 3354
Joined: Sun Nov 26, 2006 3:13 pm

Post » Wed Jun 20, 2012 12:22 am

Have you tried myAlias.GetActorRef().EvaluatePackage() ? Or depending on the situation, myAlias.http://www.creationkit.com/TryToEvaluatePackage_-_ReferenceAlias could also work--that's a better choice if you are not sure if the alias is filled or not.

As far as I know, the distinction you're worried about between the actor's "default" package stack and the reference alias's package stack doesn't exist--calling EvaluatePackage() on the actor reference will get them to evaluate all available packages, including those in the alias quest. At least, it has worked that way for me. If the follower is not responding correctly, it could be because the quest the alias is attached to doesn't have a high enough priority.
User avatar
Cody Banks
 
Posts: 3393
Joined: Thu Nov 22, 2007 9:30 am

Post » Tue Jun 19, 2012 5:16 pm

Have you tried myAlias.GetActorRef().EvaluatePackage() ? Or depending on the situation, myAlias.http://www.creationkit.com/TryToEvaluatePackage_-_ReferenceAlias could also work--that's a better choice if you are not sure if the alias is filled or not.

As far as I know, the distinction you're worried about between the actor's "default" package stack and the reference alias's package stack doesn't exist--calling EvaluatePackage() on the actor reference will get them to evaluate all available packages, including those in the alias quest. At least, it has worked that way for me. If the follower is not responding correctly, it could be because the quest the alias is attached to doesn't have a high enough priority.


myAlias.GetActorRef().EvaluatePackage()
Tried it but got this error for boths evp versions: I'm preety sure the alias is filled as its the vanilla Follow alias.

...\steam\...\temp\EVPScript.psc(18,9): GetActorRef is not a function or does not exist
...\steam\...\temp\EVPScript.psc(18,23): none is not a known user-defined type

EDIT: Probably because its looking in myAlias to find the functions (which in my case is also type Alias).
GetActorRef is part of ReferenceAlias & Evp, I think belongs to the Actor Script.


I did run the version that compiled earlier, (on the actor) but it didn't seem to have an affect on the AI stack on the alias. The description of GetActorRef and GetRef both point away from the alias. The quest I'm using is "DialogueFollower" is the one that controls all followers in the game. At least most of the time. That one has Prority 50, but really that only affects the dialogue according to the wiki.

EDIT 2: I tried...

(myAlias as referenceAlias).GetActorRef().EvaluatePackage()

which compiled, but the AI packages on the alias stack are unaffected. Response times are just as slow as before when the alias NPC realises the need to switch packages. I need it to check the conditions more often - and that stack is slooow. :shrug: For my mod, its the only way because of a missing function to detect if the player is on a horse. I'd much rather use script than the stack, and add packages from there and not use evp.
User avatar
Eric Hayes
 
Posts: 3392
Joined: Mon Oct 29, 2007 1:57 am

Post » Wed Jun 20, 2012 1:07 am

:ahhh: Still ain't working. Help
User avatar
Maddy Paul
 
Posts: 3430
Joined: Wed Feb 14, 2007 4:20 pm


Return to V - Skyrim