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.
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.
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)
MagicEffect script
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
does anyone know what http://www.creationkit.com/GetInCurrentLocFormList does?
from what it sounds like i'd guess it checks if a reference of a type in a form list is in a location...?
LOL All three of you said the same thing with different wording haha, that's cool.
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?
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")
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
Does anyone have any general tips for navmeshing effectively?
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?
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.
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.
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)
This last bit really helped me with the behavior and spell use alot.
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.
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?
Got everything working with the following script:
Does anyone know if there is a limit to the number of items that can be placed in a formlist??
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.
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.