Quick Questions -- Quick Answers, The Nineteenth

Post » Fri May 27, 2011 10:51 am

Thanks to everyone that's already been helping me; you're too kind. However I have another problemn. I downloaded Zinx' RefStuff plugin and tried using DestroyClonedForm. However, whenever it is called it breaks my script and it stops running- no CTD, but in a way even worse. Does anyone have an idea what the cause could be?
User avatar
Trent Theriot
 
Posts: 3395
Joined: Sat Oct 13, 2007 3:37 am

Post » Fri May 27, 2011 8:14 am

That command's called experimental for a reason ;)
User avatar
Blessed DIVA
 
Posts: 3408
Joined: Thu Jul 13, 2006 12:09 am

Post » Fri May 27, 2011 5:56 am

Is there any way to detect and manipulate player made potions? For a mod I'm making, I would like the potion that a player creates to be added to a merchant's inventory instead of directly to a player....I just have no idea how to do this lol. I'm already using OBSE too so any functions from that are fine.

Thanks!
User avatar
lucile
 
Posts: 3371
Joined: Thu Mar 22, 2007 4:37 pm

Post » Fri May 27, 2011 4:28 am

All player made potions have a formID starting with FF. You can use getFormIDString and getItems to walk through the player's inventory and do the job.
forEach aIterator <- player.getItems 40	 let rPot := aIterator[ "value" ]	 if eval (( getFormIDString rPot )[0:1] == "FF" )		  let sNumItems := player.getItemCount rPot		  player.removeItem rPot sNumItems		  shopKeeperRef.addItem rPot sNumItems	 endIfloop

User avatar
Ice Fire
 
Posts: 3394
Joined: Fri Nov 16, 2007 3:27 am

Post » Fri May 27, 2011 4:57 am

All player made potions have a formID starting with FF. You can use getFormIDString and getItems to walk through the player's inventory and do the job.
forEach aIterator <- player.getItems 40	 let rPot := aIterator[ "value" ]	 if eval (( getFormIDString rPot )[0:1] == "FF" )		  let sNumItems := player.getItemCount rPot		  player.removeItem rPot sNumItems		  shopKeeperRef.addItem rPot sNumItems	 endIfloop


Thanks shadeMe, I will try to make this work. I could have never come up with that on my own lol.
User avatar
Sophh
 
Posts: 3381
Joined: Tue Aug 08, 2006 11:58 pm

Post » Fri May 27, 2011 3:48 am

quick question, let's say my quest has 3 stages (5, 10, & 15) and on stage 15 the "complete quest" box is checked. When running a script that looks at stage 15 should i use GetStage or GetStageDone?
User avatar
Laura Richards
 
Posts: 3468
Joined: Mon Aug 28, 2006 4:42 am

Post » Fri May 27, 2011 9:47 am

quick question, let's say my quest has 3 stages (5, 10, & 15) and on stage 15 the "complete quest" box is checked. When running a script that looks at stage 15 should i use GetStage or GetStageDone?

Both should work, I don't think it matters which one you use in this situation. You know what the difference is between the two conditions?
User avatar
Kitana Lucas
 
Posts: 3421
Joined: Sat Aug 12, 2006 1:24 pm

Post » Thu May 26, 2011 10:00 pm

Both should work, I don't think it matters which one you use in this situation. You know what the difference is between the two conditions?

well i assume that "GetStageDone == 15" is equivalent to GetStage > 10" but i'm not sure is a stage is counted as current if the quest is completed, so GetStageDone i think is for completed quests..though i'm not sure.
User avatar
Markie Mark
 
Posts: 3420
Joined: Tue Dec 04, 2007 7:24 am

Post » Fri May 27, 2011 7:13 am

well i assume that "GetStageDone == 15" is equivalent to GetStage > 10" but i'm not sure is a stage is counted as current if the quest is completed, so GetStageDone i think is for completed quests..though i'm not sure.

GetStage QuestID == X checks if the last triggered stage (the current stage) of the quest is X. With GetStageDone you check if a specific stage has ever been reached, no matter if it has advanced to a different stage later. So if your quest could advance from 15 to 20 as well, and you had a piece of dialogue with the condition "getstage QuestID == 15" it wouldn't show. But if the condition was "getstagedone QuestID 15 == 1" then it would.

GetStageDone would also allow you to create the condition that stage 15 has NOT been reached, by using "GetStageDone QuestID 15 == 0".



By the way, one thing I noticed once that I haven't had the chance to test yet is that there is one problem with getstage, which is that it doesn't return the current stage, but the highest stage. Meaning that if you'd advance the quest from 10 to 20, and then from 20 to 15, the game would still think that the current stage is 20 so any dialogue with the "getstage QuestID == 15" condition wouldn't show. Has anyone else experienced this?
User avatar
Prue
 
Posts: 3425
Joined: Sun Feb 11, 2007 4:27 am

Post » Fri May 27, 2011 11:35 am

[edit] Beat by povuholo. I'll leave my long-winded explanation anyway. [/edit]

What povuholo said - you're fine either way in this specific instance. The difference between GetStage and GetStageDone is slightly different than you've stated, however, so maybe this will help you or somebody (hence the overbroad description here) in the future:

- Both can be used anywhere. Completed quests, uncompleted quests, dialogue, whatever. The game will remember what stage you last completed even if the quest is completed, so no real difference in the way you said*.

- GetStageDone looks at a single quest stage to see if it's been completed.
- GetStage looks to see if the current stage is equal, greater, or lesser than the one specified in the GetStage check.

Here's the big difference. Let's say you have a quest with stages 10, 20, 30, and 40.

GetStageDone == 20 will only be true if you set the stage to 20 at some point via Setstage. What this means, in terms of complex quests, is that if you were, say, at stage 10 and then setstage to 30, GetStageDone == 20 would NOT be true. If they later go back and fulfill the requirements for stage 20 and get the setstage, then GetStageDone == 20 would be true. OTOH, if they get the setstage to 20, then move on to stages 30 or 40, GetStageDone == 20 is still true, because it got completed at some point.

GetStage == 20 is only true when and only when the current stage is 20. Once you move to stage 10 or stage 30, it stops being true.

GetStage > 20 is only true when the stage is greater than 20, which means if the current stage is 30 or 40. Setstage back to 10, it stops being true. GetStage < 20, >= 20, and <= 20 work the same way. GetStage != 20 would be true anywhere besides if the current stage is 20, but would be true again if you moved from 20 to 30.

Which is to say that you'd be fine using either GetStageDone == 15, GetStage == 15, GetStage > 10, or GetStage >= 15, although I'd personally use GetStage == 15 for a completed quest like that.

* - Big completed/not completed differences are the completed checkbox, which moves the quest to the completed part of the journal, and the StopQuest function, which stops the dialogue and quest script from running, which is important to keep old quest scripts dead, although you can still reference variables and stages from them. Note also the generous use of quests labeled FIN by vanilla for post-quest dialogue for those precise reasons.

That was probably way more than you wanted to know, but HTH.

[more edit]

By the way, one thing I noticed once that I haven't had the chance to test yet is that there is one problem with getstage, which is that it doesn't return the current stage, but the highest stage. Meaning that if you'd advance the quest from 10 to 20, and then from 20 to 15, the game would still think that the current stage is 20 so any dialogue with the "getstage QuestID == 15" condition wouldn't show. Has anyone else experienced this?


Yes, although it's been long enough I can't remember if it was consistent about it, and if I remember correctly, it worked fine enough when moving between stages via setstage in the CS, but setstage via the console wouldn't move back at all ever, although that may be a different issue. I generally work around it via generous use of quest script variables and GetStageDone checks as appropriate.
User avatar
Jacob Phillips
 
Posts: 3430
Joined: Tue Aug 14, 2007 9:46 am

Post » Fri May 27, 2011 6:26 am

thnx guys, more info the better :P
User avatar
Nicholas
 
Posts: 3454
Joined: Wed Jul 04, 2007 12:05 am

Post » Fri May 27, 2011 6:05 am

damnit, i can't figure out how to disable an npc while i'm sleeping. I tried via quest scripts but no luck. I even tried setting the following script on the npc but still to no avail.
scn VmpGoreDanusSCRIPTBegin GameMode		If IsPCSleeping == 1		   If GetStageDone VmpGoreCrimsonQueen 15				VmpGoreDanusRef.MoveTo VmpGoreDanusHoldingRef				VmpGoreDanusRef.Disable  		   Endif		 EndifEnd

any ideas? all i want is for the npc to disappear when the player goes to sleep. but only if the quest is finished (stage 15 is the last stage of the quest)
User avatar
Blackdrak
 
Posts: 3451
Joined: Thu May 17, 2007 11:40 pm

Post » Fri May 27, 2011 9:50 am

When the player's sleeping, the menuMode block runs. Not the gameMode block. That is why your script doesn't trigger at all.
User avatar
Charleigh Anderson
 
Posts: 3398
Joined: Fri Feb 02, 2007 5:17 am

Post » Fri May 27, 2011 12:50 am

Is there a way to make the enchantment charge on a staff unlimited. In the CS, if I set the enchantment to 0 does that make it unlimited or just unable to cast spells?

If it is not possible, do you think I could add a script to the staff which would constantly check the enchantment charge with GetEnchantmentCharge and then SetEnchantmentCharge the charge to maximum if the value returned is not maximum?

Edit: Nevermind, I just realized I can just set the enchantment I'm using to cost no charge :lol:. Still, it would be nice to know if there is some simple way of getting unlimited enchantment...

Edit2: Another question. Is the reach value on weapons in game units? (as in 21.3 units to a foot)
User avatar
Jack Bryan
 
Posts: 3449
Joined: Wed May 16, 2007 2:31 am

Post » Fri May 27, 2011 12:34 am

When the player's sleeping, the menuMode block runs. Not the gameMode block. That is why your script doesn't trigger at all.

Aight well i have the following script on an npc:
scn VmpGoreDanusSCRIPTBegin MenuMode		If IsPCSleeping == 1		   If GetStage VmpGoreCrimsonQueen 15				VmpGoreDanusRef.MoveTo VmpGoreDanusHoldingRef				VmpGoreDanusRef.Disable  		   Endif		 EndifEnd

but it still doesn't work. i go to sleep, and when i wake up he's still there :brokencomputer:
any ideas on how to get rid of this guy?
User avatar
Anna Kyselova
 
Posts: 3431
Joined: Sun Apr 01, 2007 9:42 am

Post » Fri May 27, 2011 10:29 am

If GetStage VmpGoreCrimsonQueen 15

If GetStage VmpGoreCrimsonQueen15 == 1
If GetStage VmpGoreCrimsonQueen15 == 0


You must specify if the GetStage statement is true or false.
User avatar
Marie Maillos
 
Posts: 3403
Joined: Wed Mar 21, 2007 4:39 pm

Post » Fri May 27, 2011 1:20 pm

you mean If GetStage VmpGoreCrimsonQueen == 15 right?
i'll give it a try :)]

EDIT: hey that was it! thnx a ton :) i can't believe it was as simple as that :P
User avatar
Rachell Katherine
 
Posts: 3380
Joined: Wed Oct 11, 2006 5:21 pm

Post » Thu May 26, 2011 11:10 pm

you mean If GetStage VmpGoreCrimsonQueen == 15 right?

Your right, the syntax I used refers to the GetStageDone statement, my bad.
User avatar
Wanda Maximoff
 
Posts: 3493
Joined: Mon Jun 12, 2006 7:05 am

Post » Fri May 27, 2011 5:14 am

After going through all the horse-related functions, I'm pretty sure the answer is no, but just in case...

...is there a way to set playerslastriddenhorse, either to another ref or to nothing? I mean, I know how to GET it. But, I want to SET it. Specifically, to none, to prevent said lastriddenhorse from fast-traveling with the player. Open to any suggestions. OBSE is fine, convoluted workarounds are A-ok.
User avatar
Karl harris
 
Posts: 3423
Joined: Thu May 17, 2007 3:17 pm

Post » Fri May 27, 2011 1:19 am

EDIT: hey that was it! thnx a ton :) i can't believe it was as simple as that :P

Forgetting '==' after getstage was something that caused several :facepalm: moments for me too, especially since it doesn't trigger a warning when you save the script. So you look for something complicated and then miss that. :banghead:
User avatar
Jonathan Egan
 
Posts: 3432
Joined: Fri Jun 22, 2007 3:27 pm

Post » Fri May 27, 2011 9:54 am

Are there any OBSE functions to control the camera position (ie lock in first person)? I found con_show1stperson in the command doc, but it had no description of what it does.
User avatar
Britta Gronkowski
 
Posts: 3475
Joined: Mon Apr 09, 2007 3:14 pm

Post » Fri May 27, 2011 9:11 am

Are there any OBSE functions to control the camera position (ie lock in first person)? I found con_show1stperson in the command doc, but it had no description of what it does.
Just disable the middle mouse button and the change view control. http://cs.elderscrolls.com/constwiki/index.php/Category:Console_Functions.
User avatar
Steven Nicholson
 
Posts: 3468
Joined: Mon Jun 18, 2007 1:24 pm

Post » Fri May 27, 2011 8:25 am

Just disable the middle mouse button and the change view control. http://cs.elderscrolls.com/constwiki/index.php/Category:Console_Functions.


Um, sorry, how do I do that? So I disable middle mouse button, then use "TapControl 14" to change the point of view, then disablecontrol 14, to stop them changing it back? How do I detect whether they are in first or third person to start off with? Thanks :)
User avatar
StunnaLiike FiiFii
 
Posts: 3373
Joined: Tue Oct 31, 2006 2:30 am

Post » Fri May 27, 2011 10:20 am

Um, sorry, how do I do that? So I disable middle mouse button, then use "TapControl 14" to change the point of view, then disablecontrol 14, to stop them changing it back? How do I detect whether they are in first or third person to start off with? Thanks :)
isThirdPerson
User avatar
Jordan Moreno
 
Posts: 3462
Joined: Thu May 10, 2007 4:47 pm

Post » Fri May 27, 2011 12:03 am

Ah, fantastic! :) Thanks for your patience shademe. :hugs:
User avatar
Reanan-Marie Olsen
 
Posts: 3386
Joined: Thu Mar 01, 2007 6:12 am

PreviousNext

Return to IV - Oblivion