Quick Questions, Quick Answers Thread #9

Post » Tue Nov 20, 2012 9:38 am

What is the Papyrus Version of "GetContainer"?

In Oblivion, I would just use "Set TArget to GetContainer", but trying "Target = GetContainer()" throws up an issue about 'GetContainer' not being a function.

I'm trying to make a Token get the Reference of the Person carrying it, so I can do en-mass effects on NPCs without directly adding scripts to them, if that matters.
User avatar
Marcia Renton
 
Posts: 3563
Joined: Fri Jan 26, 2007 5:15 am

Post » Tue Nov 20, 2012 7:05 am

I created a spell tome and dropped it in the Bannered Mare. In-game it is showing as owned (ie. if I take it I'm stealing). I'm not seeing any reason as to why it would be owned. How do I fix this?
User avatar
Emilie Joseph
 
Posts: 3387
Joined: Thu Mar 15, 2007 6:28 am

Post » Tue Nov 20, 2012 9:36 am

I've got a script that teleports the player from the spot they're in to another, but in this state, no time passes, and it's a fair distance; what's the script for making time pass a certain amount?
User avatar
Jason Wolf
 
Posts: 3390
Joined: Sun Jun 17, 2007 7:30 am

Post » Tue Nov 20, 2012 11:46 am

I've got a script that teleports the player from the spot they're in to another, but in this state, no time passes, and it's a fair distance; what's the script for making time pass a certain amount?

GameHour.SetValue(Value)
GameDay.SetValue(Value)

Will set the time.

You'll probably want something like
GameHour.SetValue( GameHour.GetValue() + 1 ) ; To increase GameTime by 1 hour

But then you'll want to check for midnight which might be a bit more complicated; not sure if this script would work, but it would be something like:
Float TempFloat Temp2Temp = GameHour.GetValue() ; Gets Current Game TimeIf ( Temp &--#60; 22.99 ) ;If it's not 11PM   GameHour.SetValue( GameHour.GetValue() + 1 ) ; Just go forward one hour, can only get to 23:59ElseIf ( Temp &--#62;= 23 ) ; If it is 11PM or laterGameDay.SetValue( GameDay + 1 ) ; Go one day forward, since we cross MidnightTemp2 = ( GameHour.GetValue() - 23 )  ;GameHour.SetValue(Temp2) ; Set the new timeEndIf


You might also want to look at a carriage driver, since I think they use a different method, but I've never really looked into it and have always used this kind of work around when I have to mess with time.
User avatar
Angus Poole
 
Posts: 3594
Joined: Fri Aug 03, 2007 9:04 pm

Post » Tue Nov 20, 2012 2:50 am

GameHour.SetValue(Value) GameDay.SetValue(Value) Will set the time. You'll probably want something like GameHour.SetValue( GameHour.GetValue() + 1 ) ; To increase GameTime by 1 hour But then you'll want to check for midnight which might be a bit more complicated; not sure if this script would work, but it would be something like:
 Float Temp Float Temp2 Temp = GameHour.GetValue() ; Gets Current Game Time If ( Temp &--#60; 22.99 ) ;If it's not 11PM GameHour.SetValue( GameHour.GetValue() + 1 ) ; Just go forward one hour, can only get to 23:59 ElseIf ( Temp &--#62;= 23 ) ; If it is 11PM or later GameDay.SetValue( GameDay + 1 ) ; Go one day forward, since we cross Midnight Temp2 = ( GameHour.GetValue() - 23 ) ; GameHour.SetValue(Temp2) ; Set the new time EndIf 
You might also want to look at a carriage driver, since I think they use a different method, but I've never really looked into it and have always used this kind of work around when I have to mess with time.

Wow, thanks for the reply; as for the whole complication with midnight, it doesn't really cause me any concern...

But I was wondering, how do I change, or add to, the "GameHour.SetValue( GameHour.GetValue() + 1 )" line so it will work as a fragment script on a Quest Update?
User avatar
XPidgex Jefferson
 
Posts: 3398
Joined: Fri Sep 08, 2006 4:39 pm

Post » Tue Nov 20, 2012 7:37 am

Any danger or risks associated with overriding a follower's current package?
I'm planning an activator that get's their current package, forces them into a very specific one, then once done restore's the package they had just before.

Will/can this cause problems?

*EDIT: How to even add a package to an NPC via script????
User avatar
LittleMiss
 
Posts: 3412
Joined: Wed Nov 29, 2006 6:22 am

Post » Tue Nov 20, 2012 8:44 am

No, overriding a follower's AI should not cause any problems. You cannot add packages to an actor package stack through script, the only way to do that is through the use of quest aliases.
User avatar
Tanya Parra
 
Posts: 3435
Joined: Fri Jul 28, 2006 5:15 am

Post » Tue Nov 20, 2012 2:20 am

No, overriding a follower's AI should not cause any problems. You cannot add packages to an actor package stack through script, the only way to do that is through the use of quest aliases.
Noooooo. :bolt:
Quest Alias' the bane of my modding endeavours.
Thanks though, I guess I'll have to man up and give it a go.
User avatar
Robert Bindley
 
Posts: 3474
Joined: Fri Aug 03, 2007 5:31 pm

Post » Tue Nov 20, 2012 10:34 am

Will alias package's be put at the top of the package stack? How can I make sure my quest-added package will take priority and override any current packages?
User avatar
Your Mum
 
Posts: 3434
Joined: Sun Jun 25, 2006 6:23 pm

Post » Mon Nov 19, 2012 10:38 pm

Will alias package's be put at the top of the package stack? How can I make sure my quest-added package will take priority and override any current packages?

Nevermind, found this on http://www.creationkit.com/Bethesda_Tutorial_Quest_Aliases:
We can make quest-specific packages that will only govern the actor's behavior during the quest. (Note: the alias package stack sits on top of the actor's normal package stack, so alias packages will have priority.)
User avatar
Joey Avelar
 
Posts: 3370
Joined: Sat Aug 11, 2007 11:11 am

Post » Tue Nov 20, 2012 6:23 am

If I have an alias in a quest. How can I fill that alias remotely from an activator?
User avatar
Jessie Butterfield
 
Posts: 3453
Joined: Wed Jun 21, 2006 5:59 pm

Post » Mon Nov 19, 2012 10:42 pm

Do you mean you want the actor that activates the activator to fill the alias?
User avatar
Joe Bonney
 
Posts: 3466
Joined: Tue Jul 17, 2007 12:00 pm

Post » Tue Nov 20, 2012 10:13 am

Do you mean you want the actor that activates the activator to fill the alias?

Yes, very much so!
User avatar
Tyler F
 
Posts: 3420
Joined: Mon Aug 27, 2007 8:07 pm

Post » Tue Nov 20, 2012 6:31 am

I created two separate plugins, both of which are interiors, but I'm having trouble when trying to add doors that teleport from one interior to the other. It keeps creating a duplicate cell filled with nothing and that's what it teleports me to. Is it not possible to link two separate plugins that way?
User avatar
patricia kris
 
Posts: 3348
Joined: Tue Feb 13, 2007 5:49 am

Post » Tue Nov 20, 2012 10:28 am

I created two separate plugins, both of which are interiors, but I'm having trouble when trying to add doors that teleport from one interior to the other. It keeps creating a duplicate cell filled with nothing and that's what it teleports me to. Is it not possible to link two separate plugins that way?

Short answer, it is impossible for . esp plugins to communicate.

You'll have to make one of them a "master" of the other.
User avatar
Angus Poole
 
Posts: 3594
Joined: Fri Aug 03, 2007 9:04 pm

Post » Tue Nov 20, 2012 12:00 am

@Antares

Ok, I think I know how you could do it.

Create your quest and in the quest data tab select, from the event drop down list, script event.

Then go to the SM event node tab in the object window and double click the script event object.

Right click on Stacked Event Node:Script Event and select new branch node. A new stacked branch node will appear at the bottom of the list, right click on it and select new quest node.

On the stacked quest node that is created, tick the shares event box and right click on the stacked quest node and select add quests. This will bring up a list of quest forms, select your quest from this list and on your quest node add a condition to check if your quest is already running (GetQuestRunning [Yourquest] ==0).

Go back to your quest and create a new reference alias. In the quest aliases tab add your AI package to the alias package data tab and for the fill type select find matching reference from event and in the event data drop down select Ref1. To be safe also tick the optional checkbox in the alias tab.

Then attach a script to your activator that sends a story event to the story manager to start your quest.
Spoiler
ScriptName MyActivatorScript extends ObjectReferenceKeyword Property QuestEventProperty AutoEvent OnActivate(ObjectReference akActionRef)    QuestEventProperty.SendStoryEvent(akRef1 = akActionRef)EndEvent

The only problem is I don't know what the keyword should be! I think it should be a custom keyword that you attach to your activator but I honestly have no idea...
User avatar
Katie Pollard
 
Posts: 3460
Joined: Thu Nov 09, 2006 11:23 pm

Post » Tue Nov 20, 2012 2:30 am

@Zartar,

Ok, I think I am following everything. What if my quest is start game enabled? Also, this alias will need to be filled multiple times, by different actors. Does this complicate things?

*EDIT: I used the keyword "ActorTypeNPC" and it seems to have worked!!! I need them to be forced out of the alias when the package complete's though..........
User avatar
Code Affinity
 
Posts: 3325
Joined: Wed Jun 13, 2007 11:11 am

Post » Mon Nov 19, 2012 10:47 pm

You are starting the quest with the story manager so it will not be SGE. If your actor needs to complete his/her package routine just once you could attach a script to the alias:
Spoiler
ScriptName MyAliasScript extends ReferenceAliasPackage Property MyPackage AutoEvent OnPackageEnd(Package akOldPackage)If akOldPackage == MyPackage  GetOwningQuest().Stop()EndIfEndEvent

This should stop the quest and the next time an actor activates your activator the story manager will check if the quest is running (it won't be since the above script stopped it) and will start it again, this time with your new actor in the alias.

EDIT: Make sure you untick the Run Once box in the quest data tab of your quest.
User avatar
+++CAZZY
 
Posts: 3403
Joined: Wed Sep 13, 2006 1:04 pm

Post » Tue Nov 20, 2012 12:03 am

I created a spell tome and dropped it in the Bannered Mare. In-game it is showing as owned (ie. if I take it I'm stealing). I'm not seeing any reason as to why it would be owned. How do I fix this?

I am guessing you have set the ownership to player on the ownership tab of the object?
User avatar
candice keenan
 
Posts: 3510
Joined: Tue Dec 05, 2006 10:43 pm

Post » Mon Nov 19, 2012 8:35 pm

You are starting the quest with the story manager so it will not be SGE. If your actor needs to complete his/her package routine just once you could attach a script to the alias:
Spoiler
ScriptName MyAliasScript extends ReferenceAliasPackage Property MyPackage AutoEvent OnPackageEnd(Package akOldPackage)If akOldPackage == MyPackage  GetOwningQuest().Stop()EndIfEndEvent

This should stop the quest and the next time an actor activates your activator the story manager will check if the quest is running (it won't be since the above script stopped it) and will start it again, this time with your new actor in the alias.

EDIT: Make sure you untick the Run Once box in the quest data tab of your quest.

I've done all this and it seems to work great the first time. 2nd time however things aren't going so well.......
User avatar
Ross
 
Posts: 3384
Joined: Thu Aug 10, 2006 7:22 pm

Post » Mon Nov 19, 2012 9:26 pm

After it works the first time use the sqv yourquestname console command to see if the quest has stopped.
User avatar
Lucky Boy
 
Posts: 3378
Joined: Wed Jun 06, 2007 6:26 pm

Post » Tue Nov 20, 2012 9:52 am

Quest is stopped, Alias = NONE at that juncture.

I've set their default package up so that they attempt to travel indefinitely between two points (there is an activator send the SM event near both points). Suffice it to say that the Alias Package helps facilitate this. Alias package ends and they try to return to their starting point, nothing wrong here. When attempting to activate the second activator for the first time (but hopefully being put into the Alias for a second time) they are not getting put into the Alias.

*EDIT: Property's on both activators have been filled correctly. I checked to see if the package was too specific to one of the points, it isn't. It's generic enough to work for both directions of travel.
User avatar
Toby Green
 
Posts: 3365
Joined: Sun May 27, 2007 5:27 pm

Post » Tue Nov 20, 2012 6:47 am

Hmm... It should work. Are you sure you didn't forget to attach the activate script to the second activator as well? Is the quest starting the second time? Is the run once box unticked? Is the shares event box in your stacked quest node ticked?
User avatar
Averielle Garcia
 
Posts: 3491
Joined: Fri Aug 24, 2007 3:41 pm

Post » Mon Nov 19, 2012 10:23 pm

Both activators are the same base object and have the same script. Shares event IS ticked, Run Once is unchecked, Allow repeated stages is checked (even though I have no actual defined stages I figured null was technically a stage). The quest does get re-initiated so I think its a navmesh problem. Thanks for the help!
User avatar
Erin S
 
Posts: 3416
Joined: Sat Jul 29, 2006 2:06 pm

Post » Tue Nov 20, 2012 11:21 am

How do I make the line "GameHour.SetValue( GameHour.GetValue() + 5 )" work in the Quest Update script box? Because when I put it in there, it just errors on me...

Also, during my travels around Skyrim, I have found NPC's that, while performing tasks, cannot be disturbed, and have a "this character is busy" message shown; how do I make my character do the same?
User avatar
Danger Mouse
 
Posts: 3393
Joined: Sat Oct 07, 2006 9:55 am

PreviousNext

Return to V - Skyrim