Quick Questions, Quick Answers - Thread #56

Post » Mon Jun 08, 2015 8:35 pm

Have a quick question? Need a quick answer?

If you have not had any luck with the http://www.creationkit.com/Main_Page, post away and hopefully someone will have the answer(s) you seek.

Previous threads:

Spoiler
http://www.gamesas.com/topic/1348211-the-quick-ck-questions-thread/ | http://www.gamesas.com/topic/1353350-quick-ck-questions-thread-2/ | http://www.gamesas.com/topic/1365336-quick-questions-quick-answers-the-3rd/ | http://www.gamesas.com/topic/1373468-quick-questions-quick-answers-thread-4/ | http://www.gamesas.com/topic/1395667-quick-questions-quick-answers-thread-5/ | http://www.gamesas.com/topic/1406245-quick-questions-quick-answers-thread-6/ | http://www.gamesas.com/topic/1411305-quick-questions-quick-answers-thread-7/ | http://www.gamesas.com/topic/1414436-quick-questions-quick-answers-thread-8/ | http://www.gamesas.com/topic/1418982-quick-questions-quick-answers-thread-9/ | http://www.gamesas.com/topic/1424574-questions-quick-answers-thread-10/ | http://www.gamesas.com/topic/1427837-quick-questions-quick-answers-thread-11/ | http://www.gamesas.com/topic/1432221-quick-questions-quick-answers-thread-12/ | http://www.gamesas.com/topic/1434686-quick-questions-quick-answers-thread-13/ |http://www.gamesas.com/topic/1437011-quick-questions-quick-answers-thread-14/ | http://www.gamesas.com/topic/1439381-quick-questions-quick-answers-thread-15/ | http://www.gamesas.com/topic/1442236-quick-questions-quick-answers-thread-16/ | http://www.gamesas.com/topic/1444947-quick-questions-quick-answers-thread-17/ | http://www.gamesas.com/topic/1449652-quick-questions-quick-answers-thread-18/ | http://www.gamesas.com/topic/1458015-quick-questions-quick-answers-thread-19/ | http://www.gamesas.com/topic/1462459-quick-questions-quick-answers-thread-20/ | http://www.gamesas.com/topic/1464441-quick-questions-quick-answers-thread-21/ | http://www.gamesas.com/topic/1466681-quick-questions-quick-answers-thread-22/ | http://www.gamesas.com/topic/1468752-quick-questions-quick-answers-thread-23/ | http://www.gamesas.com/topic/1470372-quick-questions-quick-answers-thread-24/ | http://www.gamesas.com/topic/1471891-quick-questions-quick-answers-thread-25/ | http://www.gamesas.com/topic/1473830-quick-questions-quick-answers-thread-26/ | http://www.gamesas.com/topic/1476163-quick-questions-quick-answers-thread-27/ | http://www.gamesas.com/topic/1477693-quick-questions-quick-answers-thread-28 | http://www.gamesas.com/topic/1479205-quick-questions-quick-answers-thread-29/ | http://www.gamesas.com/topic/1480911-quick-questions-quick-answers-thread-30/ | http://www.gamesas.com/topic/1483264-quick-questions-quick-answers-thread-31/ | http://www.gamesas.com/topic/1485279-quick-questions-quick-answers-thread-32/ | http://www.gamesas.com/topic/1486930-quick-questions-quick-answers-thread-33/ | http://www.gamesas.com/topic/1491074-quick-questions-quick-answers-thread-34/ | http://www.gamesas.com/topic/1497701-quick-questions-quick-answers-thread-35/ | http://www.gamesas.com/topic/1499078-quick-questions-quick-answers-thread-36/ | http://www.gamesas.com/topic/1499628-quick-questions-quick-answers-thread-37/ | http://www.gamesas.com/topic/1500321-quick-questions-quick-answers-thread-38/ | http://www.gamesas.com/topic/1500687-quick-questions-quick-answers-thread-39/ | http://www.gamesas.com/topic/1501694-quick-questions-quick-answers-thread-40/ | http://www.gamesas.com/topic/1502847-quick-questions-quick-answers-thread-41/ | http://www.gamesas.com/topic/1504156-quick-questions-quick-answers-thread-42/ | http://www.gamesas.com/topic/1505791-quick-questions-quick-answers-thread-43/ | http://www.gamesas.com/topic/1506502-quick-questions-quick-answers-thread-44/ | http://www.gamesas.com/topic/1507604-quick-questions-quick-answers-thread-45/ | http://www.gamesas.com/topic/1508851-quick-questions-quick-answers-thread-46/ | http://www.gamesas.com/topic/1509755-quick-questions-quick-answers-thread-47/?hl=%2Bquick+%2Bquestions+%2Bquick+%2Banswers | http://www.gamesas.com/topic/1510893-quick-questions-quick-answers-thread-48/ | http://www.gamesas.com/topic/1512121-quick-questions-quick-answers-thread-49/ | http://www.gamesas.com/topic/1513625-quick-questions-quick-answers-thread-50/ | http://www.gamesas.com/topic/1514899-quick-questions-quick-answers-thread-51/ | http://www.gamesas.com/topic/1515914-quick-questions-quick-answers-thread-52/ | http://www.gamesas.com/topic/1516644-quick-questions-quick-answers-thread-53/ | http://www.gamesas.com/topic/1517338-quick-questions-quick-answers-thread-54/ | http://www.gamesas.com/topic/1517979-quick-questions-quick-answers-thread-55/

User avatar
Kelli Wolfe
 
Posts: 3440
Joined: Thu Aug 23, 2007 7:09 am

Post » Mon Jun 08, 2015 11:55 am

Most recent unanswered question:

User avatar
emma sweeney
 
Posts: 3396
Joined: Fri Sep 22, 2006 7:02 pm

Post » Mon Jun 08, 2015 8:02 pm

got a strange issue i'm currently pretty clueless with:

a bunch of npc's get spawned by aliases.

each of these aliases has a script that's, a.o., supposed to increment a counter on the belonging quest's script (simply like QuestSCRIPT.Counter += 1) when it has it's ref, which i start checking OnInit or, if no ref's yet found then, by subsequent single update registrations until filled.

i definitely can tell the according script block runs, since other stuff set in it gets properly set (and quest's still running and all my aliases filled of course)

but: my counter int only reaches 60-80% of the actual ref count (varying from try to try on a pretty random base).

why is this so?

only hypothesis i got is, most of the refs are spawned in custom int cells that hadn't been loaded at the time (=some odd persistence issue), but i figure if the alias holds a ref should mean it has actually spawned the refs regardlessly of this, or not? (and also, if it actually didn't count any refs in such cells, total count would come out far lower even)

..it can't be like my quest script gets some kind of hickup because ~20 instances try to increment the same variable at pretty much the same time, or can it? (which would surprise me, since i think they should simply stack up and get processed one after the other?)

any hints anybody?

User avatar
Daddy Cool!
 
Posts: 3381
Joined: Tue Aug 21, 2007 5:34 pm

Post » Mon Jun 08, 2015 1:28 pm

This sounds like a classic threading problem. This very problem is discussed at the bottom of http://www.creationkit.com/Threading_Notes_%28Papyrus%29#Another_example of the http://www.creationkit.com/Threading_Notes_(Papyrus) page on the CK Wiki:

Because all of your references are spawned at the same time, multiple references might all get the value from the remotes script at the same time, and then set the value later. Example of how this could possibly work out with 4 references:

Ref1 gets value of 0 from QuestSCRIPT.CounterRef1 adds 1 to 0, and then sets QuestSCRIPT.Counter to 1Ref2 gets value of 1 from QuestSCRIPT.CounterRef3 gets value of 1 from QuestSCRIPT.CounterRef2 adds 1 to 1, and then sets QuestSCRIPT.Counter to 2Ref3 adds 1 to 1, and then sets QuestSCRIPT.Counter to 2Ref4 gets value of 2 from QuestSCRIPT.CounterRef4 adds 1 to 2, and then sets QuestSCRIPT.Counter to 3

The solution is to make a function in QuestSCRIPT that does the adding instead. Then each reference can call that function instead of directly manipulating the property.

User avatar
[Bounty][Ben]
 
Posts: 3352
Joined: Mon Jul 30, 2007 2:11 pm

Post » Mon Jun 08, 2015 8:43 am

Re:last thread...

@S70,

So part of that worked, thanks :) I've still got a couple of characters behaving weirdly, but it's better than it was :D

Slightly new problem... In the intro, we have the PC in a cart going down the road; I've got a scene the same in my Mod, complete with two carts and the PC being in the second one. The first cart goes perfectly, but the second one gets half-way there and suddenly starts freaking out like it has hit something or the havoc has gone chaotic... At one point it was driving along sideways, and the horse keeps turning (but ultimately going towards the destination fine...) Any idea what might 1) cause that sudden spasm, and 2) why it would only affect one cart, and not the other? Both carts use identical Forms for the horse and the Cart; the only differences are the PC and the other NPCs in each, which have their own base forms...

User avatar
FoReVeR_Me_N
 
Posts: 3556
Joined: Wed Sep 05, 2007 8:25 pm

Post » Mon Jun 08, 2015 3:41 pm

boy, who'd have thought they'd have exactly my issue covered in the wiki :-))

tough read that page anyway, but rather enlightening

very well, read above article before this part of your post and concluded pretty much that from what i got from it, good to see that confirmed before even asking :-)

thx a lot, this'll save me a lot of time testing stupid new versions of the same problem i'd have scripted otherwise :-)

User avatar
Kevan Olson
 
Posts: 3402
Joined: Tue Oct 16, 2007 1:09 am

Post » Mon Jun 08, 2015 8:54 pm

that was the thing with the navmesh testing, right? came to habitually use this for every navmesh i do myself, tedious as it may seem at first, it's an enormous time saver

User avatar
Nancy RIP
 
Posts: 3519
Joined: Mon Jan 29, 2007 5:42 am

Post » Mon Jun 08, 2015 3:46 pm

I'm not sure how to make this happen. I have a spell setting the actor to EnableAI(False) and I don't want the PC to be able to get more than 1 free hit in so I thought making an OnHit event might be able to re-enable the AI. Here's the script with the least amount of errors in it:

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \  bool abBashAttack, bool abHitBlocked)    Actor Reference = akTarget auto ;Error: no viable alternative at input 'akTarget'    akTarget.EnableAI(true)EndEvent

This compiles but it doesn't enable the actors AI.

Actor kTargetEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \  bool abBashAttack, bool abHitBlocked)    kTarget.EnableAI(true)EndEvent

Forgot to tell the script that akTarget = kTarget.

Another Question: I'd like to have the shout animation for a lesser power, how do I go about doing that? MT_BreathExhaleShort is the animation event. In other words, how do I force the PC into an animation event and pop them out of it after the animation is finished or when I want?

User avatar
noa zarfati
 
Posts: 3410
Joined: Sun Apr 15, 2007 5:54 am

Post » Mon Jun 08, 2015 2:53 pm

What is that script on, an ActiveMagicEffect?

With your first script, Auto is used for properties, which are defined outside functions/events. akTarget also isn't defined. With your second script, kTarget also isn't defined. In your script, it appears to be empty or set to None.

Scriptname _test_testscript extends ActiveMagicEffectActor kTargetEvent OnEffectStart(Actor akTarget, Actor akCaster)    akTarget.EnableAI(false) ;akTarget is a parameter in the OnEffectStart event    kTarget = akTarget ;akTarget is only defined in the event, so we use the kTarget variable (defined outside) to point to the spell targetendEventEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashHit, bool abHitBlocked)    GoToState("DoneState") ;prevent this from firing numerous times    kTarget.EnableAI() ;alternatively "GetTargetActor().EnableAI()" as GetTargetActor() is an ActiveMagicEffect function to get the spell target    endEventState DoneState    Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashHit, bool abHitBlocked)        ;do nothing    endEventendState
User avatar
Rinceoir
 
Posts: 3407
Joined: Thu Jun 29, 2006 1:54 am

Post » Mon Jun 08, 2015 1:48 pm

I think I edited my post 30s before you posted. Is your way safer? Mine was pretty simple, I just forgot to tell the script that akTarget = kTarget but I'm assuming that you didn't just use the state thing for added fun.

User avatar
Portions
 
Posts: 3499
Joined: Thu Jun 14, 2007 1:47 am

Post » Mon Jun 08, 2015 6:06 pm

Yea, there was actually a recent thread on this: http://www.gamesas.com/topic/1519192-onhit-onupdate-events-script-heavy/

Basically the state makes it so that the event will only trigger once, while all later OnHit events will get thrown out

User avatar
Nicole M
 
Posts: 3501
Joined: Thu Jun 15, 2006 6:31 am


Return to V - Skyrim