Quick Questions, Quick Answers Thread #6

Post » Sun Nov 18, 2012 5:14 pm


EDIT:

Thought I'd mark the occasion: this is my 6,000th post.

Cipscis

Off-topic. :calls for insta-ban:

I've had a similar experience and what cipscis describes should work :)
User avatar
Bonnie Clyde
 
Posts: 3409
Joined: Thu Jun 22, 2006 10:02 pm

Post » Sun Nov 18, 2012 2:40 pm

I want to open up Skyrim in the Creation Kit, so I open up the Cell View window, and all I can see is "Interiors" and "DefaultWorld" in the World Space list, the latter having the "All loaded" and "Wilderness" cells. Am I forgetting something?
User avatar
JR Cash
 
Posts: 3441
Joined: Tue Oct 02, 2007 12:59 pm

Post » Sun Nov 18, 2012 9:45 am

I want to open up Skyrim in the Creation Kit, so I open up the Cell View window, and all I can see is "Interiors" and "DefaultWorld" in the World Space list, the latter having the "All loaded" and "Wilderness" cells. Am I forgetting something?
File > Data > Skyrim.ESM. Skyrim.ESM has to be checked or it won't load.
User avatar
Hearts
 
Posts: 3306
Joined: Sat Oct 20, 2007 1:26 am

Post » Mon Nov 19, 2012 1:50 am

File > Data > Skyrim.ESM. Skyrim.ESM has to be checked or it won't load.

Thanks!
User avatar
Albert Wesker
 
Posts: 3499
Joined: Fri May 11, 2007 11:17 pm

Post » Mon Nov 19, 2012 12:18 am

If a mod does not add any forms, then you cannot use GetFormFromFile to detect whether it is loaded, correct? There is not some form that every .esp mod adds?
User avatar
Epul Kedah
 
Posts: 3545
Joined: Tue Oct 09, 2007 3:35 am

Post » Sun Nov 18, 2012 6:29 pm

That's correct - it's entirely possible to create a plugin that adds no new forms.

Cipscis
User avatar
Sarah Knight
 
Posts: 3416
Joined: Mon Jun 19, 2006 5:02 am

Post » Sun Nov 18, 2012 3:51 pm

Can XMarkers be legitimate targets for spells? I'm trying this:

Scriptname PCKP_MEffscript_MagelightStorm extends activemagiceffect Spell Property Magelight autoStatic Property XMarker autoevent OnEffectStart(Actor T, Actor C)float h = Math.sqrt(2*(1280*1280))ObjectReference N = T.PlaceAtMe(XMarker, 1, true)N.MoveTo(T, 0, 1280, 0)ObjectReference NE = T.PlaceAtMe(XMarker, 1, true)NE.MoveTo(T, h, h, 0)ObjectReference NW = T.PlaceAtMe(XMarker, 1, true)NW.MoveTo(T, -h, h, 0)ObjectReference S = T.PlaceAtMe(XMarker, 1, true)S.MoveTo(T, 0, -1280, 0)ObjectReference SE = T.PlaceAtMe(XMarker, 1, true)SE.MoveTo(T, h, -h, 0)ObjectReference SW= T.PlaceAtMe(XMarker, 1, true)SW.MoveTo(T, -h, -h, 0)ObjectReference E = T.PlaceAtMe(XMarker, 1, true)E.MoveTo(T, 1280, 0, 0)ObjectReference W = T.PlaceAtMe(XMarker, 1, true)W.MoveTo(T, -1280, 0, 0)Magelight.Cast(T, N)Magelight.Cast(T, NE)Magelight.Cast(T, NW)Magelight.Cast(T, E)Magelight.Cast(T, W)Magelight.Cast(T, SE)Magelight.Cast(T, SW)Magelight.Cast(T, S)N.disable()N.delete()NW.disable()NW.delete()W.disable()W.delete()SW.disable()SW.delete()S.disable()S.delete()SE.disable()SE.delete()E.disable()E.delete()NE.disable()NE.delete()endEvent

and all of them fire in a straight line, instead of out at different angles. Dunno why.
User avatar
Matt Fletcher
 
Posts: 3355
Joined: Mon Sep 24, 2007 3:48 am

Post » Sun Nov 18, 2012 4:45 pm

I am wondering if this script will only allow the player to use this object of mine...or if "Player Activation" accomplishes this for me already.
Scriptname rayPortalGoHome extends ObjectReference {Sends the player to the castle.}ObjectReference Property PortalDoor AutoEvent OnActivate(ObjectReference akActionRef)If akActionRef == Game.GetPlayer()  PortalDoor.Activate(Game.GetPlayer())EndIfEndEvent

I have a portal spell that summons one end of the portal to the player which upon activation brings them to the stationary end located just outside my house. Followers can travel both ways but when moving to the summoned end of the portal the follower always needs to "chase down" the player. And by that I mean if it is in an interior they will that at the beginning of the cell and run to the player, as opposed to showing up at the portal location.

If you'd like any other script that's a part of this I can post those up too. Thanks for any info!
User avatar
Eliza Potter
 
Posts: 3481
Joined: Mon Mar 05, 2007 3:20 am

Post » Sun Nov 18, 2012 9:18 pm

Can XMarkers be legitimate targets for spells? I'm trying this:

Scriptname PCKP_MEffscript_MagelightStorm extends activemagiceffectSpell Property Magelight autoStatic Property XMarker autoevent OnEffectStart(Actor T, Actor C)float h = Math.sqrt(2*(1280*1280))ObjectReference N = T.PlaceAtMe(XMarker, 1, true)N.MoveTo(T, 0, 1280, 0).....NE.delete()endEvent

and all of them fire in a straight line, instead of out at different angles. Dunno why.
moveto is latent? (And reportedly a bit slow?)

So, while a thread is off moving your stuff about I THINK the script can move on and fire off your spells (before some/all of your xmarker targets are in place?)



(That said, I've not tried casting spells at XMarkers, so a failure there could be your problem ... but I don't immediately see why that would not work?)
User avatar
Jose ordaz
 
Posts: 3552
Joined: Mon Aug 27, 2007 10:14 pm

Post » Sun Nov 18, 2012 12:34 pm

Moveto being latent would mean that it is not doing other stuff while it is movingto.
User avatar
Matthew Warren
 
Posts: 3463
Joined: Fri Oct 19, 2007 11:37 pm

Post » Sun Nov 18, 2012 1:35 pm

I am wondering if this script will only allow the player to use this object of mine...or if "Player Activation" accomplishes this for me already.
Scriptname rayPortalGoHome extends ObjectReference{Sends the player to the castle.}ObjectReference Property PortalDoor AutoEvent OnActivate(ObjectReference akActionRef)If akActionRef == Game.GetPlayer()  PortalDoor.Activate(Game.GetPlayer())EndIfEndEvent

I have a portal spell that summons one end of the portal to the player which upon activation brings them to the stationary end located just outside my house. Followers can travel both ways but when moving to the summoned end of the portal the follower always needs to "chase down" the player. And by that I mean if it is in an interior they will that at the beginning of the cell and run to the player, as opposed to showing up at the portal location.

If you'd like any other script that's a part of this I can post those up too. Thanks for any info!

It should work as you want it to.
User avatar
lexy
 
Posts: 3439
Joined: Tue Jul 11, 2006 6:37 pm

Post » Sun Nov 18, 2012 11:13 am

Moveto being latent would mean that it is not doing other stuff while it is movingto.
kinda.

A latent function goes off into its own thread and does not return to the controlling thread/function until it is done. Which let's other threads/functions have a go at running while the former function/thread waits for a return.

I gotta add it appears your script would hold, while it waits for the return of the latents to shift the markers, but I couldn't hand-on-heart say it wouldn't start firing off the spells first.

Do the latents hold/pause the script from which they were called, or do they allow the script to continue while each latent spawns its own thread? I'm not clear about it when I read the wiki on threading (but maybe everyone else is clear? ... so might be best to ignore me ;))

I guess the shortest way to write what I just wrote is: Is a script a thread, or can scripts "own" multiple threads? I do not know ... http://www.creationkit.com/Threading_Notes_%28Papyrus%29



And I'll test firing a spell at an XMarker when I'm in the CK next ... If it does work it's something I coulduse anyway ... :)
User avatar
Jennifer Munroe
 
Posts: 3411
Joined: Sun Aug 26, 2007 12:57 am

Post » Sun Nov 18, 2012 10:24 am

My understanding of threads is basically that only the game engine can create threads, and it creates a new thread every time it calls an event on an object.

For example, take an object that has a script attached to it with an http://www.creationkit.com/OnActivate_-_ObjectReference event, and that event contains a call to a latent function like http://www.creationkit.com/Wait_-_Utility. I think this is the example used on that wiki page, right?

If the player activates the object, the game calls its OnActivate event and this starts a thread. If the player then activates the object again immediately, then the game creates another thread and the next OnActivate event is queued to be pushed onto the stack, but it doesn't actually get pushed yet because the previous thread has locked the object.

Once the first thread reaches the latent function, it goes of to wait for that to complete and unlocks the object. Here, the second thread can start running through the OnActivate event, and it'll lock the object again. If the first thread comes back from its latent function before the second thread has reached its own latent function, then the first thread's latent function will be queued to be popped from the stack.

Once the second thread has gone off to its latent function, the object is unlocked again and the first script can return to its thread, once its latent function has been popped off the stack. The object will then remain locked until either it encounters another external or latent function, or the event completes, at which point the thread ends.

Hopefully that clarifies things a bit, assuming my understanding of it all is accurate :)

Cipscis
User avatar
Kelvin
 
Posts: 3405
Joined: Sat Nov 17, 2007 10:22 am

Post » Sun Nov 18, 2012 8:49 pm

...
Hopefully that clarifies things a bit, assuming my understanding of it all is accurate :smile:

Cipscis
kinda ;)

Can the same Function continue to process subsequent events/lines-of-code after it has sent a latent-function away into it's own thread?

Or, at least, that's the bit that confuses me! So:

Event OnActivate()adhoc-line-of-code-1adhoc-line-of-code-2adhoc-line-of-code-3myObject.moveto(myplace)  ;<-------------- latentadhoc-line-of-code-4EndEvent

Can adhoc-line-of-code-4 be processed BEFORE
myObject.moveto(myplace)  ;<-------------- latent
has returned?


(that's the issue Ducey might have ... I think ... IF it is possible?)
User avatar
Robert Jr
 
Posts: 3447
Joined: Fri Nov 23, 2007 7:49 pm

Post » Sun Nov 18, 2012 6:34 pm

I've had code that seemed to be doing that. I never nailed the problem down though, and eventually coded around it. I think I'm more inclined toward Cipcis' view of the mechanism.

What could be happening in Ducey's case is if moveto hands off to the game engine thread, and the engine puts the move onto a queue and returns. Then the moveto function returns very fast, the the actual movement doesn't happen for a few milliseconds, which is long enough for the spell targets to be locked in. The spell cast would probably get added to the same queue as the movement, but by that time the target vector has been set.

A Utilility.wait(0.1) before the first cast might work wonders. Or I could be completely wrong of course ...
User avatar
CORY
 
Posts: 3335
Joined: Sat Oct 13, 2007 9:54 pm

Post » Sun Nov 18, 2012 7:09 pm

Hi! Thanks for setting up this thread and taking the time to answer all of these questions.

My own question is, why would a prisoner NPC of mine appear on the wrong side of the jail bars in-game? He's placed behind them in-editor, and the door is locked.
User avatar
Lauren Dale
 
Posts: 3491
Joined: Tue Jul 04, 2006 8:57 am

Post » Sun Nov 18, 2012 4:37 pm

Give him a defaultstayateditorlocation AI package. Should fix it. Otherwise they'll do that unfortunately.
User avatar
Stefanny Cardona
 
Posts: 3352
Joined: Tue Dec 19, 2006 8:08 pm

Post » Mon Nov 19, 2012 1:21 am

Give him a defaultstayateditorlocation AI package. Should fix it. Otherwise they'll do that unfortunately.

That worked! Thanks, Ducey!
User avatar
Brandon Bernardi
 
Posts: 3481
Joined: Tue Sep 25, 2007 9:06 am

Post » Sun Nov 18, 2012 10:17 pm

Incidentally, I tried using a Utility.wait, and it didn't work. I'm starting to think magelight may not be castable in anything but a "default" direction.
User avatar
Anna S
 
Posts: 3408
Joined: Thu Apr 19, 2007 2:13 am

Post » Sun Nov 18, 2012 9:27 pm

Incidentally, I tried using a Utility.wait, and it didn't work. I'm starting to think magelight may not be castable in anything but a "default" direction.

Out of curiosity, have you tried it with editor placed markers? Like set up a test cell, place the markers and fire the magelights at them from a script.

Then we'd know for sure, at least.
User avatar
Jason Wolf
 
Posts: 3390
Joined: Sun Jun 17, 2007 7:30 am

Post » Sun Nov 18, 2012 11:22 pm

Not sure if there's something else about this somewhere, but it's something I've had trouble with before..

I want to create a mod just for myself to use, using other mods that I've downloaded.

The trouble is that some of those mods require multiple master mods, which always causes an error of some kind. Because of this, I can't use all of the mods I want to use.

Can anyone help with this? I can provide more information if needed.
User avatar
Tinkerbells
 
Posts: 3432
Joined: Sat Jun 24, 2006 10:22 pm

Post » Sun Nov 18, 2012 11:12 pm

Is there a way to reload all papyrus scripts via console command in-game? So that I don't have to restart the game every time I want to test my script.
User avatar
Ruben Bernal
 
Posts: 3364
Joined: Sun Nov 18, 2007 5:58 pm

Post » Sun Nov 18, 2012 9:46 pm

Is there a way to reload all papyrus scripts via console command in-game? So that I don't have to restart the game every time I want to test my script.
If it's just one script, type "reloadscript yourscriptname" in the console. The Papyrus logs will say whether or not it reloaded successfully. Sometimes the game just crashes though (like when I try to use hot-loading plugins) so usually it's quicker to restart anyway.
User avatar
Ria dell
 
Posts: 3430
Joined: Sun Jun 25, 2006 4:03 pm

Post » Sun Nov 18, 2012 8:27 pm

I've built an animated NIF by basically slamming together blocks from other NIFs. The mesh appears in-game correctly, and it plays its animation one time. I don't know if the animation is named, and I don't know how to name it. That's probably an important part of my actual question.

What function can I use to play the animation in-game?
User avatar
Flesh Tunnel
 
Posts: 3409
Joined: Mon Sep 18, 2006 7:43 pm

Post » Sun Nov 18, 2012 7:29 pm

I've built an animated NIF by basically slamming together blocks from other NIFs. The mesh appears in-game correctly, and it plays its animation one time. I don't know if the animation is named, and I don't know how to name it. That's probably an important part of my actual question.

What function can I use to play the animation in-game?
http://www.creationkit.com/PlayAnimationAndWait_-_ObjectReference

Hunt around (links at bottom) for some others.


More stuff: http://www.creationkit.com/List_of_Animation_Variables and http://www.creationkit.com/Idle_Animations
User avatar
Baylea Isaacs
 
Posts: 3436
Joined: Mon Dec 25, 2006 11:58 am

PreviousNext

Return to V - Skyrim