Quick Questions, Quick Answers Thread #9

Post » Tue Nov 20, 2012 12:22 am

Having some trouble getting the IsStopped condition to work properly in the following script.

The final stage of MyQST1 has a command Stop() and I thought this condition would check to see if that quest has stopped. Unfortunately, even though the final quest stage is completed and the quest should be stopped, the condition is not working and this script is still updating the stage for MyQST1 when it should only update MyQST2

Spoiler

Scriptname ST_setstasgeonacquireAetherium extends ObjectReference  {Sets a quest stage when this item is put in the player's inventory.}Quest Property myQST1 auto{Quest1 upon which to set stage. Default is the Alias's owning quest.}int Property preReqStageQ1 = -1 auto{(Optional)Quest1 stage that must be set for this script to run. Default: NONE}int Property StageToSetQ1 auto{Set this stage in Quest1 when the player picks up this item.}Quest Property myQST2 auto{Quest2 upon which to set stage. Default is the Alias's owning quest.}int Property preReqStageQ2 = -1 auto{(Optional)Quest2 Stage that must be set for this script to run. Default: NONE}int Property StageToSetQ2 auto{Set this stage in Quest2 when the player picks up this item.}	auto State waiting		Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)		if (Game.GetPlayer() == akNewContainer);		debug.notification("player got some aetherium")			if (myQST1.IsStopped() == False)				if ( (preReqStageQ1 == -1) || (myQST1.GetStageDone(preReqStageQ1) == True) );					debug.notification("Non-repeat Quest at least stage 20")					myQST1.SetStage(stageToSetQ1);					debug.notification("Non-repeat Quest at least stage 40")					GoToState("inactive");					debug.notification("aetherium script set to state inactive")				endif			endif			if ( (preReqStageQ2 == -1) || (myQST2.GetStageDone(preReqStageQ2) == True) );				debug.notification("Repeatable Quest at least stage 10")				myQST2.SetStage(stageToSetQ2);				debug.notification("Repeatable Quest set to stage 20")				GoToState("inactive");				debug.notification("aetherium script set to state inactive")			endif		endif	EndEventEndStateState inactiveEndState



Should I just forget about the IsStopped condition and perhaps use something else, like check instead to see if a particular stage in MyQST1 was ever completed before?
User avatar
Roy Harris
 
Posts: 3463
Joined: Tue Sep 11, 2007 8:58 pm

Post » Tue Nov 20, 2012 11:46 am

If its stopped, does that mean completed for you? If so use GetQuestCompleted() instead :)

If not, a Stopped quest is no longer Running. So use GetQuestRunning().
User avatar
Lauren Dale
 
Posts: 3491
Joined: Tue Jul 04, 2006 8:57 am

Post » Mon Nov 19, 2012 11:13 pm

If its stopped, does that mean completed for you? If so use GetQuestCompleted() instead :smile:

Thanks very much, I'll try using that one instead.
User avatar
lolly13
 
Posts: 3349
Joined: Tue Jul 25, 2006 11:36 am

Post » Tue Nov 20, 2012 5:38 am



Thanks very much, I'll try using that one instead.

See edited post to mate :)
User avatar
Victoria Bartel
 
Posts: 3325
Joined: Tue Apr 10, 2007 10:20 am

Post » Tue Nov 20, 2012 8:37 am

See edited post to mate :smile:

I need to use this like a true false condition check - in other words, if MyQST1 is stopped or completed, I want the script to skip the subsequent functions and move on to the part of the script that checks for MyQST2.

In this case, if I were to use GetQuestCompleted(), should it be in the following format?

if (MyQST1.GetQuestCompleted() == 0)

It seems others have reported some issues with the GetQuestCompleted() function on the CK wiki: http://www.creationkit.com/GetQuestCompleted

I've also had some issues using IsRunning, sometimes the CK seems to think quests are still running that should not be. Perhaps I should use instead another GetStageDone or IsStageDone condition?

For example, to make sure the player has never completed stage 80 of MyQST1 - would the following work?


if (MyQST1.IsStageDone(80) == False)

Going to try the following

Spoiler

Scriptname ST_setstasgeonacquireAetherium extends ObjectReference  {Sets a quest stage when this item is put in the player's inventory.}Quest Property myQST1 auto{Quest1 upon which to set stage. Default is the Alias's owning quest.}int Property preReqStageQ1 = -1 auto{(Optional)Quest1 stage that must be set for this script to run. Default: NONE}int Property StageToSetQ1 auto{Set this stage in Quest1 when the player picks up this item.}Quest Property myQST2 auto{Quest2 upon which to set stage. Default is the Alias's owning quest.}int Property preReqStageQ2 = -1 auto{(Optional)Quest2 Stage that must be set for this script to run. Default: NONE}int Property StageToSetQ2 auto{Set this stage in Quest2 when the player picks up this item.}	auto State waiting		Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)		if (Game.GetPlayer() == akNewContainer);		debug.notification("player got some aetherium");			if (myQST1.IsStopped() == False)			if (MyQST1.IsStageDone(80) == False)				if ( (preReqStageQ1 == -1) || (myQST1.GetStageDone(preReqStageQ1) == True) );					debug.notification("Non-repeat Quest at least stage 20")					myQST1.SetStage(stageToSetQ1);					debug.notification("Non-repeat Quest at least stage 40")					GoToState("inactive");					debug.notification("aetherium script set to state inactive")				endif			endif			if ( (preReqStageQ2 == -1) || (myQST2.GetStageDone(preReqStageQ2) == True) );				debug.notification("Repeatable Quest at least stage 10")				myQST2.SetStage(stageToSetQ2);				debug.notification("Repeatable Quest set to stage 20")				GoToState("inactive");				debug.notification("aetherium script set to state inactive")			endif		endif	EndEventEndStateState inactiveEndState
User avatar
Robert Jackson
 
Posts: 3385
Joined: Tue Nov 20, 2007 12:39 am

Post » Tue Nov 20, 2012 8:37 am

You could use IsCompleted(). But don't need to worry about False and True, because true is implicit, and false can be declared with !. So for False, why don't you try:

if !MyQuest.IsCompleted(); if the quest is not completed  ;do stuffelsif MyQuest.IsCompleted();if quest is completed   ;do other stuff here

Try to avoid the True and False statements if you can. I find using ! to declare false just seems to work better. True is the default with these usually in my experience, so you don't need to write == True. As in this case, MyQuest.IsCompleted() == true, is the same as MyQuest.IsCompleted().
User avatar
Rachel Briere
 
Posts: 3438
Joined: Thu Dec 28, 2006 9:09 am

Post » Tue Nov 20, 2012 2:50 am

I am attempting to get my Actor "Chef" to use a cooking station, however, it seems I am having a little bit of trouble with this.

Currently I am using the Package Template TravelAndUseIdle. With the "Place to Travel" and "Marker" pointing to the same thing, CraftingCookingPotSm. With this set up he moves there as he should at 5pm but does not do anything. Based on that I assume I am using the wrong package template.

Could someone point me towards the right template to use? Thanks for any help!
User avatar
Solina971
 
Posts: 3421
Joined: Thu Mar 29, 2007 6:40 am

Post » Tue Nov 20, 2012 2:37 am

Hey folks, 2 questions here:

1. Does anyone have a good script that can be used so that when the PC is close enough to a LIGHT node an effect will be applied to them.

2. How many perks can be active on the PC at once?

:lightbulb:
User avatar
Travis
 
Posts: 3456
Joined: Wed Oct 24, 2007 1:57 am

Post » Tue Nov 20, 2012 5:10 am

I am attempting to get my Actor "Chef" to use a cooking station, however, it seems I am having a little bit of trouble with this.

Currently I am using the Package Template TravelAndUseIdle. With the "Place to Travel" and "Marker" pointing to the same thing, CraftingCookingPotSm. With this set up he moves there as he should at 5pm but does not do anything. Based on that I assume I am using the wrong package template.

Could someone point me towards the right template to use? Thanks for any help!
It might be that the "Place to Travel" is not an achievable destination so he just stands there "trying" to reach it. Try making a marker nearby and pointing to that.
User avatar
Susan
 
Posts: 3536
Joined: Sun Jun 25, 2006 2:46 am

Post » Tue Nov 20, 2012 9:50 am

It might be that the "Place to Travel" is not an achievable destination so he just stands there "trying" to reach it. Try making a marker nearby and pointing to that.

No luck, he moves to a X marker I placed (basically right under the blue person shaped marker of the cooking station) and then stands there.

EDIT: Taking a look at Gianna, the cook in Castle Dour, it seems the SitTarget package template is used pointing towards the cooking station...guess I'll try that out.

EDIT2: And just like that it works. I never would have guessed SitTarget would work but eh I suppose it is furniture. Thank you Antares for your suggestion though. :thumbsup:
User avatar
Dan Scott
 
Posts: 3373
Joined: Sun Nov 11, 2007 3:45 am

Post » Tue Nov 20, 2012 7:03 am

To minimise the risk of embedding stuff into the users save files, I think I'm going to have to have an "uninstall precedure" for my Player Statue mod

My plan is to make a stage 999 with the following script fragment:
Spoiler
(Alias_Statue as HPSstatueScript).ClearArray()Alias_Statue.GetActorRef().Disable()Alias_Statue.GetActorRef().DeleteWhenAble()Alias_Statue.Clear()Alias_Sculpter.Disable()BaseMarker.Disable()QuestScript.isReady = 0Debug.MessageBox("Uninstall process complete")

That is pretty much resetting the mod to the way it was when it was first installed

Would this work if they then did the normal clean save procedure? Am I over thinking it? Would this just make things worse?

- Hypno
User avatar
Mason Nevitt
 
Posts: 3346
Joined: Fri May 11, 2007 8:49 pm

Post » Tue Nov 20, 2012 8:42 am

Can anyone point me to a tutorial to get a working animated portal going? If this isn't a quick answer, I started a thread over http://www.gamesas.com/topic/1424352-skuldafn-portal-problems/ if anyone is willing to help.

Thanks.
User avatar
Vickey Martinez
 
Posts: 3455
Joined: Thu Apr 19, 2007 5:58 am

Post » Tue Nov 20, 2012 11:06 am

If I have a package with a travel destination that can move around or be in different places is that location determined when the package is added or run? Or will the package always go for the editor location?

To be more specific: I have a quest which (at this point) exists solely to add a package to a given NPC. This package prompts them to travel to an object which can be in one of two locations. The object is an Alias which gets filled when the quest starts. When the package completes the quest is forcibly stopped and lies dormant waiting to be run again. I'm having issues with NPC's getting to the object when it is outside of its editor location. I thought I could get around this with the whole alias thing but it doesn't seem so, any advice?
User avatar
Elizabeth Davis
 
Posts: 3406
Joined: Sat Aug 18, 2007 10:30 am

Post » Tue Nov 20, 2012 4:12 am

You could use IsCompleted(). But don't need to worry about False and True, because true is implicit, and false can be declared with !. So for False, why don't you try:

if !MyQuest.IsCompleted(); if the quest is not completed  ;do stuffelsif MyQuest.IsCompleted();if quest is completed   ;do other stuff here

Try to avoid the True and False statements if you can. I find using ! to declare false just seems to work better. True is the default with these usually in my experience, so you don't need to write == True. As in this case, MyQuest.IsCompleted() == true, is the same as MyQuest.IsCompleted().

Thanks very much BBD - tried using IsCompleted and it's still not working properly - this script is very stubborn. I wonder if it has something to do with the auto state waiting functions?

Going to try it without any of those "state" functions - does this look correct?

Spoiler

Scriptname ST_setstasgeonacquireAetherium extends ObjectReference  {Sets a quest stage when this item is put in the player's inventory.}Quest Property myQST1 auto{Quest1 upon which to set stage. Default is the Alias's owning quest.}int Property preReqStageQ1 = -1 auto{(Optional)Quest1 stage that must be set for this script to run. Default: NONE}int Property StageToSetQ1 auto{Set this stage in Quest1 when the player picks up this item.}Quest Property myQST2 auto{Quest2 upon which to set stage. Default is the Alias's owning quest.}int Property preReqStageQ2 = -1 auto{(Optional)Quest2 Stage that must be set for this script to run. Default: NONE}int Property StageToSetQ2 auto{Set this stage in Quest2 when the player picks up this item.}	;auto State waiting		Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)		if (Game.GetPlayer() == akNewContainer);		debug.notification("player got some aetherium");			if (myQST1.IsStopped() == False);			if (MyQST1.IsStageDone(80) == False)			if !MyQST1.IsCompleted(); if the quest is not completed				if ( (preReqStageQ1 == -1) || (myQST1.GetStageDone(preReqStageQ1) == True) );					debug.notification("Non-repeat Quest at least stage 20")					myQST1.SetStage(stageToSetQ1);					debug.notification("Non-repeat Quest at least stage 40");                    GoToState("inactive");					debug.notification("aetherium script set to state inactive")				endif			endif			if ( (preReqStageQ2 == -1) || (myQST2.GetStageDone(preReqStageQ2) == True) );				debug.notification("Repeatable Quest at least stage 10")				myQST2.SetStage(stageToSetQ2);				debug.notification("Repeatable Quest set to stage 20");                GoToState("inactive");				debug.notification("aetherium script set to state inactive")			endif		endif	EndEvent;EndState;State inactive;EndState

User avatar
Fiori Pra
 
Posts: 3446
Joined: Thu Mar 15, 2007 12:30 pm

Post » Tue Nov 20, 2012 2:49 am

Is it actually compiling booty? I ask because I don't count enough EndIf's in your script to match your If's.

Have you tried using Elseif instead? I find it much easier to manage actual if "chunks", than half a dozen different If lines.
User avatar
sharon
 
Posts: 3449
Joined: Wed Nov 22, 2006 4:59 am

Post » Tue Nov 20, 2012 9:51 am

Is it safe to rename scripts by trying to save them with an edited Scriptname string?
User avatar
lillian luna
 
Posts: 3432
Joined: Thu Aug 31, 2006 9:43 pm

Post » Tue Nov 20, 2012 2:35 am

Is it safe to rename scripts by trying to save them with an edited Scriptname string?

Silly question, won't compile. :bonk:
User avatar
Lady Shocka
 
Posts: 3452
Joined: Mon Aug 21, 2006 10:59 pm

Post » Tue Nov 20, 2012 12:39 am



Silly question, won't compile. :bonk:

I've read something about this mate. Do a search on this board for script rename. Also have a look on the wiki :)
User avatar
Avril Louise
 
Posts: 3408
Joined: Thu Jun 15, 2006 10:37 pm

Post » Tue Nov 20, 2012 1:50 am

Sup folks.

I am trying to make this function work with Light nodes but it only works with actual objects references:

If (Game.GetPlayer().GetDistance(ThisObjWorld) &--#60;= 200)

Anyone got any clever scripting ideas?

EDIT: Nevermind got it working.

:lightbulb:
User avatar
Rachael
 
Posts: 3412
Joined: Sat Feb 17, 2007 2:10 pm

Post » Tue Nov 20, 2012 12:17 am

I have a property on a parent-script with two children-scripts. I need the children-scripts to be able to recognise and set this property such that all the scripts that use it are all retrieving the same value at the same time.

*EDIT: I have taken a detour from this issue and implemented a global instead.
User avatar
Destinyscharm
 
Posts: 3404
Joined: Sun Jul 23, 2006 6:06 pm

Post » Tue Nov 20, 2012 10:41 am

Is it actually compiling booty? I ask because I don't count enough EndIf's in your script to match your If's.

Have you tried using Elseif instead? I find it much easier to manage actual if "chunks", than half a dozen different If lines.

Yes, it compiles OK.

There are an equal number of if's and endif's - just kept all the alternate versions of this problematic line in the script so I can keep track of what I've used that didn't work, just used a semi-colon to make them into comments.
User avatar
Donald Richards
 
Posts: 3378
Joined: Sat Jun 30, 2007 3:59 am

Post » Tue Nov 20, 2012 3:59 am

Yes, it compiles OK.

There are an equal number of if's and endif's - just kept all the alternate versions of this problematic line in the script so I can keep track of what I've used that didn't work, just used a semi-colon to make them into comments.

I can't see anything particularly wrong mate. Have you tried breaking it down?

I find that with lots of if statements you're having trouble with, it works best to add in one at a time, test, then add another and repeat. That way you can then find out exactly which condition isn't working, and why.
User avatar
Marion Geneste
 
Posts: 3566
Joined: Fri Mar 30, 2007 9:21 pm

Post » Tue Nov 20, 2012 3:38 am

I can't see anything particularly wrong mate. Have you tried breaking it down?

I find that with lots of if statements you're having trouble with, it works best to add in one at a time, test, then add another and repeat. That way you can then find out exactly which condition isn't working, and why.

Instead of adding in each statement one at a time, couldn't you just add notification calls between them?
User avatar
Guinevere Wood
 
Posts: 3368
Joined: Mon Dec 04, 2006 3:06 pm

Previous

Return to V - Skyrim