How do you AddScriptPackage now?

Post » Thu Jun 21, 2012 11:25 am

I need to add a package to a non specific NPC using dialogue, but it appears AddScriptPackage has been sent packing, poor pun intended. How do we do it now with Papyrus?
User avatar
Laura-Jayne Lee
 
Posts: 3474
Joined: Sun Jul 02, 2006 4:35 pm

Post » Thu Jun 21, 2012 10:49 am

I use Aliases for it ... But I had to design the quest setup to cope with doing the trick.

At the point I want a new package / behaviour, I start a new Quest, with a new Alias - that uses same base character - with the new packages applied to the Alias. Because of Quest Priority I can keep the old quest running and the newer "sub quest" manages the alias (and the new packages) until I am done with it, then I complete the sub-quest and the NPC's life goes back to normal (the first, main quest).

Works OK, just means thinking about how to implement a main quest and some sub quests.


(there's probably a better way, via script and Evaluate Packages ... or something ... but I couldn't figure it out)
User avatar
carley moss
 
Posts: 3331
Joined: Tue Jun 20, 2006 5:05 pm

Post » Thu Jun 21, 2012 7:50 am

How do you assign the alias to an NPC because I have no idea what NPC we are going to work with? It has to be any NPC in the game that someone would choose.
User avatar
Alexxxxxx
 
Posts: 3417
Joined: Mon Jul 31, 2006 10:55 am

Post » Thu Jun 21, 2012 12:13 pm

yur alias would be Specific Reference, and set the reference to None, tick the optional flag.


then during your quest, when it is time to fill that alias with the specified npc, you would use:

myAlias.ForceRefTo(someNpc)
User avatar
sarah
 
Posts: 3430
Joined: Wed Jul 05, 2006 1:53 pm

Post » Thu Jun 21, 2012 4:07 pm

Or make the quest start from a script event so you can send the NPC as a parameter:

MyKeyword.SendStoryEvent(akRef1 = someNPCref)

and then use Find matching reference: From event to assign the alias.
User avatar
Alexandra walker
 
Posts: 3441
Joined: Wed Sep 13, 2006 2:50 am

Post » Thu Jun 21, 2012 12:27 pm

Could this trick be used to help with my problem of changing a character from follow to flee? I haven't really done much with quests. But perhaps I coulc put the script on my actor to start the flee quest if getdistan e player < 200 and start quest follow if get distance > 500 for example?? That way I could attach the packages to the quests and effectivly start and stop script packages from my actor script? As long as its possible to finish a quest and then restart it again to change the packages as needed??? Does it sound like that may work?
User avatar
Roddy
 
Posts: 3564
Joined: Fri Jun 15, 2007 11:50 pm

Post » Thu Jun 21, 2012 4:14 am

Or make the quest start from a script event so you can send the NPC as a parameter:

MyKeyword.SendStoryEvent(akRef1 = someNPCref)

and then use Find matching reference: From event to assign the alias.

Yes. This seemed to be the best compromise (if you can work it that way).

Using a Forced Alias should be avoided if you can (I read on some code thread I didn't understand ;) (though I did it that way until I read that topic))

... if you set up a Quest, with no aliases, or anything other than a statup stage, but with a single line of Question-and-Topic that every voice (valid) type can say ... only run when whatever conditions you want (Quest Stage is 19, or Story Manager Event_X called, or at 2am every other sunday) are met. akSpeaker, or akActor (or whatever it is) lets you at the base_actor in script? And then do Story Manager to fill the optional Alias in the new quest (with all it's packages).

Worked that way for me ... but I don't know what you want to do ... so it's a bit difficult ... will be possible though I think
User avatar
Rob
 
Posts: 3448
Joined: Fri Jul 13, 2007 12:26 am

Post » Thu Jun 21, 2012 10:42 am

As long as its possible to finish a quest and then restart it again to change the packages as needed???


You can certainly restart a finished quest. If it's started by the StoryManager, though, you'll need to put a
Stop()
in the ShutDown stage, or the StoryManager won't restart it afterwards.
User avatar
Kelli Wolfe
 
Posts: 3440
Joined: Thu Aug 23, 2007 7:09 am

Post » Thu Jun 21, 2012 3:37 pm

Ok thanks all! Hopefully I can figure out this part pretty easily. At least I know the script part well enough that I can put plenty of conditions in to make my actors do lots of stuff at different times.
User avatar
Jade Barnes-Mackey
 
Posts: 3418
Joined: Thu Jul 13, 2006 7:29 am

Post » Thu Jun 21, 2012 1:51 pm

This is turning out to be slightly more difficult than I thought. I need to assign the Reference Alias for this actor from the Actor Script attached to the actor. But I cannot use

myAlias.ForceRefTo(someNpc)

from my actor script. And I have no idea how I would get

MyKeyword.SendStoryEvent(akRef1 = someNPCref)

to work for me...

The problem is this is not a specific Actor, it is an Actor Base and there will be more than one of them at a time and they each will have to have their own seperate packages going, one may be following while another is fleeing etc..

So I will have to use something like this from inside the actor script when they are created.

If Skeleton1 == 0	  SkelAlias1.ForceRefTo(self)		  Skeleton1 = 1EndifIf Skeleton2 == 0		  SkelAlias2.ForceRefTo(Self)		  Skeleton2 = 1Endif

That way I can assign Each individual skeleton to a particular Alias even though there is more than one active at a time. But I'm not sure how to get the ForceRefto or the other option of MyKeyword.SendStoryEvent(akRef1 = someNPCref) to work from inside the Actor Script... =/

Actually it will have to be something more like

if PsiNecroQuest.Skeleton1 == 0	   SkelAlias1.ForceRefTo(Self)	   PsiNecroQuest.Skeleton1 = 1endif

But you get the idea anyways..
User avatar
{Richies Mommy}
 
Posts: 3398
Joined: Wed Jun 21, 2006 2:40 pm

Post » Thu Jun 21, 2012 6:49 am

^^^ Without knowing exactly what you are trying to do, it's difficult ... but:

The SendStory concept is going to be tough to work if you want to assign a unknown number of actors to an unknown number of aliases (indeed, impossible is probably better than tough) ... So you might want to ignore it?

(MAYBE you could send the Story Manager a FormList, of some type - as akRef1 and akRef2 - that you can iterate through to fill your multiple aliases?)

But this trick requires that you know, at Design-Time, what and how many Aliases are going to be filled - If it was a movie, you have the script and you know what parts need filling. And you setup that template as a sub-quest, which then fills the optional Aliases (no need for ForceTo) at run time (given a set of script conditions that you make)

But, if any number of skeletons could fill any number of roles, then you're stuffed for using it, because you cannot design the sub-quest.

However, what is wrong with the script as you currently have it? ^^^ What doesn't it do that you need it to do?
User avatar
rae.x
 
Posts: 3326
Joined: Wed Jun 14, 2006 2:13 pm

Post » Thu Jun 21, 2012 7:32 am

The problem I am currently having is just switching packages when they need to be switched. For example having a follow package if the actor is more than a certain distance from the player, and having a flee package if they get right on top of the player and block him. And If I can get that worked out then I want to do more complex things like having the actor cast a certain spell at the start of combat or if they get Less than 50% health etc..

It just seemed that being able to add and remove packages via scripting on the Actor Script was the best option for that and looks to be the only way to do that is through managing them with a quest. Ive already tried adding multiple packages to the actor setting conditions for the package and OnUpdate for the Actor Script reevaluating the package stack But it never changes packages even if the conditions for the package to change are correct from what I can see.
User avatar
Lucy
 
Posts: 3362
Joined: Sun Sep 10, 2006 4:55 am

Post » Thu Jun 21, 2012 10:11 am

It's impossible to know at design time though what and how many Aliases will be filled.. So it would seem that would completely bar me from doing the SendStoryEvent as you say.

So looks to be the only way to manage it would be to force an actor into a reference. If that's even possible.
User avatar
Krystina Proietti
 
Posts: 3388
Joined: Sat Dec 23, 2006 9:02 pm

Post » Thu Jun 21, 2012 11:51 am

Of course things like Casting spells etc. I could really do all through scripting and setting conditions in an OnUpdate event But Ive tried about every way I can think to change the packages just through a package list on the actor and conditions for packages and for some crazy reason its not working even though I can see no reason it should not be..
User avatar
Sophie Miller
 
Posts: 3300
Joined: Sun Jun 18, 2006 12:35 am

Post » Thu Jun 21, 2012 3:56 pm

The fast answer is that, yes, for what you want to do AddPackage would have been easier than the hoops you will need to jump through to make it work without that Command.

The basic prinicple appears to have changed (I did not Mod Oblivion, so I am not encountering this "issue") - The principle is that an Actor (a Base-Actor) can take on a number of identified "roles" in a number of identified "movies".

A role is an Alias and a Movie is a Quest.

But you appear to want a single - unidentified - actor to play two different roles in the same movie ... And there are many real movies that you can go watch that will demonstrate how difficult that is - and often result in a rubbish movie ;)

(and Beth designers sometimes had a hell of a time getting the system to do what they wanted ... as witnessed by many comments in many of the quests!)
User avatar
Timara White
 
Posts: 3464
Joined: Mon Aug 27, 2007 7:39 am

Post » Thu Jun 21, 2012 10:45 am

Packages are quite slow, possibly too slow for what you want. But just to check: are you calling Skeleton.EvaluatePackage anywhere? Aliases and their associated packages are assigned at the start of your quest - thereafter they have to be made to change packages, they don't evaluate the conditions continuously.

I have a quest which stops and starts in response to a StoryChangeLocation event, and if a certain kind of marker is found in that area, it fills as many aliases as it can with local members of a certain faction (using Find matching reference: in loaded area: closest). The aliases add a 'Demonstrate' package to any NPCs in the player's area that are in that faction. The quest also has an alias for the player which adds a Cloak spell to me, which has a script effect which only affects members of that faction (it makes them chant protests). The player alias script uses RegisterForSingleUpdate() to make the player put on and take off the cloak at irregular intervals, so that I get the effect of occasional unified chanting, while the rest of the time the NPCs follow their Demonstrate packages and say whatever comes into their heads.

Perhaps you could do something similar but put a EvaluatePackage command in your magic effect?
User avatar
Jason Wolf
 
Posts: 3390
Joined: Sun Jun 17, 2007 7:30 am

Post » Thu Jun 21, 2012 6:23 am

No on the Actor Script I am calling

Event Onupdate()	Self.EvaluatePackage()

Cant really put evaluate package inside the MagicEffect script because its not actually a summoned creature.. Its a placed actor.. Because as it turns out Packages like follow or flee do not work at all on Summoned Creatures which I have verified to be true.

Why the hell they didn't just put some sort of basic follow or flee command available for use inside scripts is beyond me.
User avatar
Daniel Holgate
 
Posts: 3538
Joined: Tue May 29, 2007 1:02 am

Post » Thu Jun 21, 2012 6:07 am

The fast answer is that, yes, for what you want to do AddPackage would have been easier than the hoops you will need to jump through to make it work without that Command.

Yes if AddPackage & RemovePackage worked it would be ideal for what I want to do... I have not verified myself that it doesn't work but then the whole topic of this post was that it does not work so I'm assuming that that is correct.
User avatar
sarah simon-rogaume
 
Posts: 3383
Joined: Thu Mar 15, 2007 4:41 am

Post » Thu Jun 21, 2012 8:06 am

But you appear to want a single - unidentified - actor to play two different roles in the same movie ... And there are many real movies that you can go watch that will demonstrate how difficult that is - and often result in a rubbish movie :wink:

(and Beth designers sometimes had a hell of a time getting the system to do what they wanted ... as witnessed by many comments in many of the quests!)

Actually what I would be doing is having a different Subquest for each action I want it to take. for example a follow quest and a flee quest. So that would be two movies. Just stopping one movie and starting another when the conditions are right..
User avatar
James Shaw
 
Posts: 3399
Joined: Sun Jul 08, 2007 11:23 pm

Post » Thu Jun 21, 2012 8:56 am

Just had a crazy idea about this.. But I wonder if it might be possible to actually say once the skeleton is within 200 distance from player disable() and Place an identical skeleton with a flee package at its location Then when that skeleton is a correct distance Delete him and enable the original at the new location.. Don't really know if I could enable it at the new location or not but there might be a way.. Would be a funky way of doing things. And in the end it might be better just to say screw the whole thing and wait until they fix Addpackage if they ever do..
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Thu Jun 21, 2012 9:08 am

Oh, you want crazy ideas :wink:

How good is your maths/trig? (someone will help, if it is as poor as mine! :wink:)

If you could calculate a place to flee to ... then package conditions on just a Follow Package should work (that is, stop the npc following) and a TranslatetoRef command (or similar) would send it running (to the place) ... Or run away on a particular heading ... Or via a route, if you also setup "markers" via script.



I also wonder how/if you could use the Combat-Style Type settings that allow an NPC to runaway when attacked?
User avatar
Jaylene Brower
 
Posts: 3347
Joined: Tue Aug 15, 2006 12:24 pm


Return to V - Skyrim