Quick Questions, Quick Answers - Thread #24

Post » Sat May 17, 2014 9:56 pm

Use Game.GetPlayer().AddShout(YourShoutPropertyHere) for Shouts.

:cool:

User avatar
Elizabeth Davis
 
Posts: 3406
Joined: Sat Aug 18, 2007 10:30 am

Post » Sun May 18, 2014 12:51 pm

aaawcomeon, NOW you're kidding...!? :-))

User avatar
Quick Draw
 
Posts: 3423
Joined: Sun Sep 30, 2007 4:56 am

Post » Sun May 18, 2014 6:15 am

about location, location aliasses, keywords and conditioning to them:

so i put this loctype on certain locations, and i can't help noticing tes5edit names me pretty bad colors for this.

so i figure i'd shut this up by putting the locations in aliasses and put my keywords on these (right so far or is this totally unnecessary?) -

but i got tons of dialoge conditioned to these loctype keywords, so would they still work with location aliasses, or if not (which i fear), is there a condition item that works for this?

User avatar
Prisca Lacour
 
Posts: 3375
Joined: Thu Mar 15, 2007 9:25 am

Post » Sun May 18, 2014 1:27 am

Getting a weird compiler error tonight that I can't quite figure out. Hoping one of you might know what's up. Warning for the following line, in which EmptyGemsCount is an array and indexCheck is an int.

STQ.EmptyGemsCount[indexCheck] += aiItemCount

Weird because I access this same array in an earlier line and don't get an error. Here is the complete compiler output:

EA_PCSoulGemTracking.psc(36,20): no viable alternative at input '[]'EA_PCSoulGemTracking.psc(0,0): error while attempting to read script EA_PCSoulGemTracking: Object reference not set to an instance of an object.No output generated for EA_PCSoulGemTracking.psc, compilation failed.

And here is the full script:

Spoiler
Scriptname EA_PCSoulGemTracking extends ReferenceAlias{tracks player's empty soul gems}Actor property playerRef autoEA_SoulTrapQuestScript property STQ autoSoulGem[] property AzurasStarVariants auto  ; 0 = azurasStarPetty  1 = azurasStarLesser  2 = azurasStarCommon  3 = azurasStarGreater  4 = azurasStarGrandEvent onInit()	initializeTrackingArray()EndEventEvent onPlayerLoadGame()	STQ.msgTimer = -100.0endEventfunction initializeTrackingArray()	int arrayIndex = 5	STQ.EmptyGemsCount[arrayIndex] = playerRef.GetItemCount(STQ.EmptyGemsBase[arrayIndex])	AddInventoryEventFilter(STQ.EmptyGemsBase[arrayIndex])	while arrayIndex		arrayIndex -= 1		STQ.EmptyGemsCount[arrayIndex] = playerRef.GetItemCount(STQ.EmptyGemsBase[arrayIndex])		AddInventoryEventFilter(STQ.EmptyGemsBase[arrayIndex])		AddInventoryEventFilter(AzurasStarVariants[arrayIndex])	endWhileendFunctionEvent onItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)	soulGem addedGem = akBaseItem as soulGem	int indexCheck = STQ.EmptyGemsBase.Find(addedGem)	if indexCheck > 0 ;dont track filled azuras star variants when added		STQ.EmptyGemsCount[indexCheck] += aiItemCount	endifEndEventEvent onItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)	soulGem removedGem = akBaseItem as soulGem	int indexCheck = STQ.EmptyGemsBase.Find(removedGem)	if indexCheck > 0		STQ.EmptyGemsCount[indexCheck] -= aiItemCount	else ; filled azura's star variant		if (akDestContainer == none && akItemReference == none) ;consumed via enchanting			playerRef.addItem(STQ.EmptyGemsBase[5], 1, true) ;empty azura's star		endif	endifEndEvent
User avatar
Lakyn Ellery
 
Posts: 3447
Joined: Sat Jan 27, 2007 1:02 pm

Post » Sun May 18, 2014 12:46 am

egocarib: when you make a property to a script, you have to pick an object reference that has this script for filling the prop.

reads like that's just what you didn't do there, no?

User avatar
Louise Andrew
 
Posts: 3333
Joined: Mon Nov 27, 2006 8:01 am

Post » Sat May 17, 2014 10:47 pm

I'm trying to make a plugin that uses all the DLC and unofficial patches as requirements in the CK.

Basically, I want my mod's master to be all the DLC and unofficial patches.

User avatar
Angela
 
Posts: 3492
Joined: Mon Mar 05, 2007 8:33 am

Post » Sun May 18, 2014 6:16 am

Hmm. Have tried a few things since reading this but still can't figure out exactly what you mean. Do you mean I have to refer to the actor it's attached to somehow?

Edit: I tried replacing "EA_SoulTrapQuestScript property STQ auto" with "EA_SoulTrapQuestScript STQ" & the line "STQ = GetOwningQuest() as EA_SoulTrapQuestScript" in the OnInit() block but still get the same error.

Edit 2: Have also tried setting up STQ as type Quest instead, and then casting it whenever I want to use it via (STQ as EA_SoulTrapQuestScript). Still getting errors though. Have read the CK entry on Variables and Properties along with the Discussion page several times, and tried a few different variations, but can't seem to get anything to work. Here's the casting version and compiler error:

Spoiler
Scriptname EA_PCSoulGemTracking extends ReferenceAlias{tracks player's empty soul gems}Actor property playerRef autoQuest property STQ autoSoulGem[] property AzurasStarVariants auto  ; 0 = azurasStarPetty  1 = azurasStarLesser  2 = azurasStarCommon  3 = azurasStarGreater  4 = azurasStarGrand	Event onInit()	initializeTrackingArray()EndEventEvent onPlayerLoadGame()	(STQ as EA_SoulTrapQuestScript).msgTimer = -100.0endEventfunction initializeTrackingArray()	int arrayIndex = 5	(STQ as EA_SoulTrapQuestScript).EmptyGemsCount[arrayIndex] = playerRef.GetItemCount((STQ as EA_SoulTrapQuestScript).EmptyGemsBase[arrayIndex])	AddInventoryEventFilter((STQ as EA_SoulTrapQuestScript).EmptyGemsBase[arrayIndex])	while arrayIndex		arrayIndex -= 1		(STQ as EA_SoulTrapQuestScript).EmptyGemsCount[arrayIndex] = playerRef.GetItemCount((STQ as EA_SoulTrapQuestScript).EmptyGemsBase[arrayIndex])		AddInventoryEventFilter((STQ as EA_SoulTrapQuestScript).EmptyGemsBase[arrayIndex])		AddInventoryEventFilter(AzurasStarVariants[arrayIndex])	endWhileEvent onItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)	soulGem addedGem = akBaseItem as soulGem	int indexCheck = (STQ as EA_SoulTrapQuestScript).EmptyGemsBase.Find(addedGem)	if indexCheck > 0 ;dont track filled azuras star variants when added		(STQ as EA_SoulTrapQuestScript).EmptyGemsCount[indexCheck] += aiItemCount	endifEvent onItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)	soulGem removedGem = akBaseItem as soulGem	int indexCheck = (STQ as EA_SoulTrapQuestScript).EmptyGemsBase.Find(removedGem)	if indexCheck > 0		(STQ as EA_SoulTrapQuestScript).EmptyGemsCount[indexCheck] -= aiItemCount	else ; filled azura's star variant		if (akDestContainer == none && akItemReference == none) ;consumed via enchanting			playerRef.addItem((STQ as EA_SoulTrapQuestScript).EmptyGemsBase[5], 1, true) ;empty azura's star		endif	endifEndEvent=================================================================================================================COMPILER ERRORS:EA_PCSoulGemTracking.psc(20,60): required (...)+ loop did not match anything at input '='EA_PCSoulGemTracking.psc(24,61): required (...)+ loop did not match anything at input '='EA_PCSoulGemTracking.psc(35,61): required (...)+ loop did not match anything at input '+='EA_PCSoulGemTracking.psc(44,61): required (...)+ loop did not match anything at input '-='No output generated for EA_PCSoulGemTracking.psc, compilation failed.

Edit 3: I'm Starting to wonder if this is a problem with arrays? I have an ActiveMagicEffect script that also uses EA_SoulTrapQuestScript property STQ, and sets/accesses numerous non-array variables on that quest property, and compiles fine. However, when adding the same line I was having trouble with above on my RefAlias script to the activeMagicEffect script, (the line that attempts to edit an array in the STQ property) I get the same error (no viable alternative input at '[]')

The simple solution would be to switch over to using global variables, but I need very fast access to the array values elsewhere in the main quest script, and pulling the values out of globalVariables would be a big performance hit where I need it most.

My brain feels like its melting by this point, so any help is appreciated.

User avatar
Margarita Diaz
 
Posts: 3511
Joined: Sun Aug 12, 2007 2:01 pm

Post » Sun May 18, 2014 8:26 am

You want to merge skyrim.esm, update.esm, dawnguard.esm, hearthfires.esm, dragonborn.esm and the unofficial patches in one global esm?

User avatar
Queen
 
Posts: 3480
Joined: Fri Dec 29, 2006 1:00 pm

Post » Sun May 18, 2014 10:19 am

Just tick them in the CK when you open your mod. Use their assets and that will force the user to have to have all the plugins and unofficial patches.

User avatar
brandon frier
 
Posts: 3422
Joined: Wed Oct 17, 2007 8:47 pm

Post » Sun May 18, 2014 8:31 am

No not merging them, but I want my plugin to be dependant on all of those. I learned I had to tick the ESM flag in TES5Edit, so the unofficial patches would be considered masters. Now I have to change the load order for these masters so that my plugin uses them correctly. I'm guessing the load order of masters for my plugin is something like:

Skyrim.esm
Update.esm
Dawnguard.esm
Hearthfires.esm
Dragonborn.esm
Unofficial Dawnguard Patch.esm
Unofficial Hearthfire Patch.esm
Unofficial Dragonborn Patch.esm

User avatar
JLG
 
Posts: 3364
Joined: Fri Oct 19, 2007 7:42 pm

Post » Sun May 18, 2014 8:10 am

you need to _fill_ this property, just like any other.

and in the properties tab, when you do so, you'll get a pick reference dialogue, you pick a ref there and select a script that's on it, that's the script your property points to then.

and exactly this ref, i presume, you did never pick, and exactly this would be what your compiler complains about then

User avatar
Jose ordaz
 
Posts: 3552
Joined: Mon Aug 27, 2007 10:14 pm

Post » Sun May 18, 2014 5:44 am

Alright, tried that. In order to fill the property though, I had to compile the script first ( with the property in it ), so what I did was comment out the rest of the script besides the initial properties. I then attached it to the RefAlias and filled in the correct quest property for STQ, and then uncommented all the rest of the code in the script and tried compiling again, but still get the same exact errors.

User avatar
Claire Lynham
 
Posts: 3432
Joined: Mon Feb 12, 2007 9:42 am

Post » Sat May 17, 2014 10:04 pm

Question:

How do you get SKSE functions to register in the creation kit and/or notepad++ compiler?

(I installed SKSE with the installer already, but I have not done anything else with SKSE)

User avatar
An Lor
 
Posts: 3439
Joined: Sun Feb 18, 2007 8:46 pm

Post » Sun May 18, 2014 5:51 am

All you need to do is to make sure that SKSE's .pex and .psc files have been added to \Skyrim\Data\Scripts\ and \Skyrim\Data\Scripts\Source respectively.

User avatar
Luis Longoria
 
Posts: 3323
Joined: Fri Sep 07, 2007 1:21 am

Post » Sun May 18, 2014 12:00 pm

I have two quick questions.

1. The goodbye flag at the end of conversations doesn't seem to work. When testing it the last dialog line is grayed out and I have to hit the TAB key to dismiss it. Is there a work around for this?

2. I need a way of being able to tell my NPC to set their home to here, here being any custom house. I know this involves moving xmarkers around. Can someone explain how this can be done?

Many thanks in advance.

User avatar
Quick draw II
 
Posts: 3301
Joined: Thu Nov 08, 2007 4:11 pm

Post » Sun May 18, 2014 4:05 am

If you need to edit a Vanilla Script, is it 'Safe' to edit the script?

I want to edit the Ore Scripts, so that it can give more or less Ore before being "empty"-- but there's a LOT of them; so, would it be safe to just edit that Script, or is it better to go through all of them, and change the Scripts one by one (And if so, can I do it quickly?)

User avatar
Fanny Rouyé
 
Posts: 3316
Joined: Sun Mar 25, 2007 9:47 am

Post » Sun May 18, 2014 3:33 am

the goodbye flag perfectly works. what it does is make an npc drop out of player dialogue after he's said the line (hence shouldn't be used on infos that are linked on).

it not only has totally nothing to do with greyed out dialogue, but "greyed out" only means that line has already been said before, that's all. it doesn't even mean you can't activate it anymore (you can!), so there'd be no need for tab, so there's not really a need to workaround... ;-)

User avatar
Stephanie Nieves
 
Posts: 3407
Joined: Mon Apr 02, 2007 10:52 pm

Post » Sun May 18, 2014 10:36 am

there's totally no need to change the script for this. ore count is an int property on that script, you can set it on your ref to whatever your like. (or on base object, whatever)

User avatar
Adam
 
Posts: 3446
Joined: Sat Jun 02, 2007 2:56 pm

Post » Sun May 18, 2014 8:33 am

CWThreatTriggers - what exactly do they do?

i'm aware it's gotta be something civil war related, but i never played that questline yet (no kidding :-) and don't feel like digging through the relating scripts so much, so i'm just making blind guesses like "soldiers will attack this" so far -

reason i'm wondering: couldn't help noticing they're over about every town building in skyrim, so i wonder, when i do a town building myself, should i place one of these over it so it gets cw-treated? (and if so, anybody happen to know if it'll do to just copy one of them triggers, link it to the enabling parent and check ref props if any for that?)

User avatar
Aman Bhattal
 
Posts: 3424
Joined: Sun Dec 17, 2006 12:01 am

Post » Sun May 18, 2014 7:42 am

Looks like you're right -- but it raises a new question for me :

In the Properties, we have

ResoureceCount Int <>

ResourceCountTotal Int <>

But on the attached script, they're both set when defining Properties... :

int Property ResourceCount = 1 Auto{how many resources you get per drop}int property ResourceCountTotal = 3 auto{how many resources this has before it is depleted}

So... Would changing the Properties, STILL affect that, or am I right in thinking they'd be reset by the Script?

Since I've not edited Vanilla stuff before, I've not written myself into a situation like this, so I'm not 100% about how it'd work?

User avatar
Kari Depp
 
Posts: 3427
Joined: Wed Aug 23, 2006 3:19 pm

Post » Sun May 18, 2014 4:38 am

Simply changing the values of those int properties in the script will change the number of ores dropped and the total number given before depletion. That is why they were designed that way in the first place. So, you are right. Besides, my motto has always been, "try it out, if it doesn't work, you can change it back."

User avatar
megan gleeson
 
Posts: 3493
Joined: Wed Feb 07, 2007 2:01 pm

Post » Sun May 18, 2014 12:50 pm

@CDM:

just tested this, and the CK-set property value will override the value in the script. This is probably because the property's (hidden) "set" function gets called before the script's OnInit() event (according to the wiki), and re-sets the value to the one you give it in the CK.

Also, just finally figured out my array property problem!!

It turns out that you cannot use the computational assignment operators on array properties for some reason (i.e. +=, -=, etc.). Getting rid of these solved all the problems and I can access other scripts' arrays with no problem now! Feels good to stop banging my head against the screen. :D

EDIT: Gah, this is even on the wiki:

Only the = operator can be used with an http://www.creationkit.com/Arrays_%28Papyrus%29:

; Will not compile, as the compiler doesn't know how to handle it.
myArray[3] += 5
User avatar
CHangohh BOyy
 
Posts: 3462
Joined: Mon Aug 20, 2007 12:12 pm

Post » Sun May 18, 2014 4:34 am

Well, that's just it. It is NOT working perfectly for me! It never drops out of the dialog. The last line stays up and is greyed out. I tab out and everything is back to normal. I shouldn't have to do that! It should work just like it did in Oblivion.

User avatar
Stephanie Kemp
 
Posts: 3329
Joined: Sun Jun 25, 2006 12:39 am

Post » Sun May 18, 2014 1:42 am

Weird. I added the "goodbye" flag to all the lines said by Alvor during the blacksmithing tutorial and it works perfectly. Maybe the problem comes from the dialogue itself? Is it a dialogue you created?

User avatar
Quick Draw III
 
Posts: 3372
Joined: Sat Oct 20, 2007 6:27 am

Post » Sun May 18, 2014 12:05 am

Thanks that's useful to know :)

User avatar
JUan Martinez
 
Posts: 3552
Joined: Tue Oct 16, 2007 7:12 am

PreviousNext

Return to V - Skyrim