Quick Questions, Quick Answers - Thread #19

Post » Fri May 10, 2013 5:01 am

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/

Have a quick question? Need a quick answer? If you have not had any luck with the Creation Kit Wiki, post away and hopefully someone will have the answer(s) you seek.
User avatar
Stephani Silva
 
Posts: 3372
Joined: Wed Jan 17, 2007 10:11 pm

Post » Fri May 10, 2013 12:40 am

Because of http://www.gamesas.com/topic/1457905-cant-get-gamefasttravel-to-work/?view=getnewpost I'm am forced to resort to using MoveTo(). The thing is I would still like to simulate the time spent travelling.

Anybody got an idea of the best way to script the game time forward a few hours. I know there's the GameTime global that can be changed, but I think I remember hearing this may have adverse effects. Any suggestions?

- Hypno
User avatar
Jack Walker
 
Posts: 3457
Joined: Wed Jun 06, 2007 6:25 pm

Post » Fri May 10, 2013 3:12 am

I just use GameHour.Mod(fHowMuch). Haven't seen or heard about these adverse effects. The only thing I noticed is that it doesn't effect the duration of applied spells, but everything else (day/night cycle, RegisterForUpdate(GameTime), Utility.Wait) all seem to be modified properly. I'm pretty sure packages update immediately as well.

User avatar
Avril Louise
 
Posts: 3408
Joined: Thu Jun 15, 2006 10:37 pm

Post » Thu May 09, 2013 4:52 pm

Ok cool. I don't know where I heard it from, it was just floating in the back of my mind. Maybe I'm confusing it with something else. Anyways, I'm only going to be pushing the time forward 5 hours and it shouldn't be happening too often (unless the player dies an awful lot), shouldn't really cause any problems (hopefully) :)

- Hypno
User avatar
Cameron Wood
 
Posts: 3384
Joined: Wed Oct 31, 2007 3:01 pm

Post » Thu May 09, 2013 5:05 pm

you need to create a quest with empty or dummy properties (of whatever type you need)

then create a script property in each magiceffect you want to be able to communicate with oneanother

quest script(on quest or alias)

Spoiler

MagicEffect script

Spoiler

important note: you will want to make sure that you select the script running on the right quest/referencealias for the 'dum' property under the properties of the magiceffect script.

just as an example, script may be buggy as I don't have access to a Papyrus editor atm :blush:

User avatar
Eibe Novy
 
Posts: 3510
Joined: Fri Apr 27, 2007 1:32 am

Post » Fri May 10, 2013 4:24 am

does anyone know what http://www.creationkit.com/GetInCurrentLocFormList does?

User avatar
Sweets Sweets
 
Posts: 3339
Joined: Tue Jun 13, 2006 3:26 am

Post » Thu May 09, 2013 9:57 pm

from what it sounds like i'd guess it checks if a reference of a type in a form list is in a location...?

User avatar
I love YOu
 
Posts: 3505
Joined: Wed Aug 09, 2006 12:05 pm

Post » Thu May 09, 2013 10:20 pm

It sounds like it checks to see if the "whatever" is currently in one of the locations from a formlist of locations.

- Hypno
User avatar
Alexis Acevedo
 
Posts: 3330
Joined: Sat Oct 27, 2007 8:58 pm

Post » Fri May 10, 2013 2:30 am


Is the location of a ref in a formlist of locations.
User avatar
marina
 
Posts: 3401
Joined: Tue Mar 13, 2007 10:02 pm

Post » Fri May 10, 2013 3:50 am

LOL All three of you said the same thing with different wording haha, that's cool.

User avatar
Lori Joe
 
Posts: 3539
Joined: Tue Jun 20, 2006 6:10 am

Post » Thu May 09, 2013 10:31 pm

That is it exactly, Thank you!

I have since figured out putting desired shared Properties in a Quest, for the magicEffect script to fill during some event.

Your solution is for a single instance is it not? The dummy script receives a pointer to the actor in the onEffectStart() call, effectively tying it to one actor/magicEffect ? If I need to apply this to multiple actors, I would need a dummyScript for each one, no?

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

Post » Thu May 09, 2013 5:03 pm

What is the best way for detecting time changes due to player waiting, sleeping and fast travelling?

Sleeping: onSleep()

Waiting: isInMenuMode()

Fast Travel: ?

All of these could potentially go into a script extending referenceAlias right? Event driven methods would be the best to avoid registering for update overhead, but that is onSleep() only as far as I can tell.

EDIT: Never mind, found my answer. SKSE requried. A script extending referenceAlias w/

	RegisterForSleep()	RegisterForMenu("MapMenu")	RegisterForMenu("Sleep/Wait Menu")

These events can be used to fire off some updates to determine how much time has passed using:

	int hw = Game.QueryStat("Hours Waiting") 	int hs = Game.QueryStat("Hours Slept") 
User avatar
Adrian Morales
 
Posts: 3474
Joined: Fri Aug 10, 2007 3:19 am

Post » Thu May 09, 2013 5:23 pm

Another quick question. How do I make a 'Utility' Script?

I have many small code bits, such as :

Scriptname kvwcUtil Hidden; Format float number for fixed decimalsstring Function formatFloat(float f, int decPlaces) 	String s = f as string	int p = StringUtil.Find(s, ".", 0)	return stringUtil.subString(s, 0, (p + decPlaces + 1) )endFunction

But errors (cannot call the member function ... must call it on a variable) show this script needs to be attached to something. I cannot call with just kvUtil.formatFloat(1.234, 2). Can I make a script that does not need to be attached?

EDIT. Never mind.

string Function formatFloat(float f, int decPlaces) global

User avatar
joseluis perez
 
Posts: 3507
Joined: Thu Nov 22, 2007 7:51 am

Post » Thu May 09, 2013 3:37 pm

Does anyone have any general tips for navmeshing effectively?

User avatar
Michelle Smith
 
Posts: 3417
Joined: Wed Nov 15, 2006 2:03 am

Post » Fri May 10, 2013 1:45 am

I was putting some weapon racks in my house and they work perfectly fine all except for a message displayed on the screen when I put a weapon on there. It say "Returning Persistent Reference" Has anyone seen that before or know what that's all about?

User avatar
Vicki Blondie
 
Posts: 3408
Joined: Fri Jun 16, 2006 5:33 am

Post » Fri May 10, 2013 1:50 am

I am trying to write a simple script to vary the spells my npc casts. The intention is that there are 6 spells, 2 are used often, 1 less often, 2 not often, and 1 rarely. To accomplish this, I figured I could write something such that every 15 seconds it'll swap to a new spell, and this is what I came up with, but it's not working.

Spoiler

I've tried simplifying the number of spells to two and the random integer range from 0 to 1 and each spell to each integer respectively, but the character doesn't use either spell (they are the only spells the character has and is set in combat behavior to use nothing but spells, so at the moment she just stands around in combat looking tough but doing nothing). Secondly, can I simplify this to something like if(random == 1 - 4) instead of having four of these lines? I would experiment to see if that works, but I can't get any part of this script to work yet anyways.

Many thanks in advance.

User avatar
Ridhwan Hemsome
 
Posts: 3501
Joined: Sun May 06, 2007 2:13 pm

Post » Fri May 10, 2013 4:48 am

A few things I can tell you, first, instead of using RegisterForUpdate() you should use RegisterForSingleUpdate(), as RegisterForUpdate() is the number one culprit for a nasty Bug called Save Game Bloating.

Also, if the character is not attacking you may want to look at a number of factors on the spells they have;

-what is the magicka cost of these spells? how much magicka does the npc have?

-What is the casting type of the spell? certain npcs can only cast spells designed for the left or right hand,

-check the combat style as well (Under AI Tab), If you give them a class but no combat style, they generally behave that way.

And Last but not least, In The Magic effect of the spell, you may want to increase the Script AI (bottom-center of the Magic Effect Window)

  • Score: Determines how likely the AI is to use this Effect. Higher-valued abilities will be used more often. and
  • Delay Time: The amount of time that must elapse before the AI will use this Effect again.

This last bit really helped me with the behavior and spell use alot. :D

User avatar
Nomee
 
Posts: 3382
Joined: Thu May 24, 2007 5:18 pm

Post » Fri May 10, 2013 2:57 am

Thanks for the advice. The spells all function just fine - just not in the script. I can give them to the NPC in her spells tab, but of course the NPC only uses the most powerful one over and over. I'd rather it be varied and the script I'm going for seems to be the easiest method. All the spells have zero magicka cost as well, and the npc has a high enough skill to use them. I created my own combat style for the NPC and she has no problem casting any spell I hand to her. I'll fiddle with the magic effect window as you detailed.

Also, what is the difference between Registerforupdate() and Registerforsingleupdate()? I'd like there to be an update every 15 seconds, as described by the first half of the script.

User avatar
Christine Pane
 
Posts: 3306
Joined: Mon Apr 23, 2007 2:14 am

Post » Thu May 09, 2013 7:14 pm

Hey folks.

I am trying to add a spell (set as a constant ability) to a NPC (not the player) so that their health is damaged by 5 every second (constant so it never ends). However it doesn't seem to work at all.

Any ideas?

:lightbulb:

User avatar
Ruben Bernal
 
Posts: 3364
Joined: Sun Nov 18, 2007 5:58 pm

Post » Thu May 09, 2013 7:53 pm

Got everything working with the following script:

Spoiler
User avatar
Lauren Graves
 
Posts: 3343
Joined: Fri Aug 04, 2006 6:03 pm

Post » Fri May 10, 2013 2:36 am

Does anyone know if there is a limit to the number of items that can be placed in a formlist??

User avatar
JAY
 
Posts: 3433
Joined: Fri Sep 14, 2007 6:17 am

Post » Thu May 09, 2013 11:06 pm

255 for leveled lists, id assume its the same for formlists.
User avatar
Doniesha World
 
Posts: 3437
Joined: Sun Jan 07, 2007 5:12 pm

Post » Thu May 09, 2013 9:46 pm

If I have a quest on stage 10, and on stage 10 it says "RegisterForUpdateGameTime(24)," does that mean that every 24 hours it will register for an update as long as it's on that stage? Or does it need to be directed at an alias?

I'm just trying to get the game to increase a global variable every 24 hours.

User avatar
Chris Duncan
 
Posts: 3471
Joined: Sun Jun 24, 2007 2:31 am

Post » Fri May 10, 2013 3:33 am

Is it possible to change the weather in the vicinity of an object? If so, how would I go about doing this?

I have already made the weather, I just need to know how to apply it.

User avatar
Abel Vazquez
 
Posts: 3334
Joined: Tue Aug 14, 2007 12:25 am

Post » Fri May 10, 2013 3:56 am

http://www.creationkit.com/OnTriggerEnter_-_ObjectReference
User avatar
Kelsey Anna Farley
 
Posts: 3433
Joined: Fri Jun 30, 2006 10:33 pm

Next

Return to V - Skyrim