User:DavidJCobb/Miscellany
miscellanous information; outdated
Scripting
Changing a player's Speed Multiplier (SpeedMult)
Changes to the player's Speed Multiplier actor value don't take effect unless you prompt the game engine to take notice. This issue applies to both scripted changes and changes triggered by a "Value Modifier" magic effect. There are two ways to force the game to actually use a changed SpeedMult:
- Modify the player's inventory. Silently adding and then removing an item should do the trick.
- Modify the player's carry weight actor value. Adding and then removing 0.1 works.
Issues with optional function arguments
When you compile a function with optional script arguments, the argument data is updated for the containing script only. If other scripts make cross-script calls to your function, those functions must be recompiled in order for their calls to work properly. Otherwise...
- If you just added the optional arguments, the other scripts will be unaware of them unless recompiled; you will receive Papyrus errors whining about an "incorrect number of arguments passed."
- If you changed the optional arguments' default values, the other scripts will use the old default values until recompiled.
Papyrus errors
Samples of Papyrus logs and errors that I haven't often seen posted on the web, along with meanings when known.
Baked script data is outdated
- Source: AFKMods: The critter thread
warning: Function <name> in stack frame <number> in stack <number> differs from the in-game resource files - using version from save
Occurs when an old version of a script is baked into a savegame.
Baked script data malfunctioning badly enough to be dropped
- Source: AFKMods: The critter thread
[02/09/2014 - 03:33:25PM] error: Failed to read basic script data for critterFish attached to (FF002ABA) [02/09/2014 - 03:33:25PM] error: Unable to load object 0x1305E1E0 from save game [02/09/2014 - 03:33:25PM] Errors occurred while loading the Papyrus save game data
Occurs when old script data (baked into a savegame) has malfunctioned badly enough for the game engine to just throw it out.
Variable loaded from save could not be found on the actual object
Apparently the result of scripts being updated.
[11/17/2013 - 02:59:23AM] warning: Variable ::WVAAliasStorage_var on script DLC1_QF_DLC1EclipseAttack2_01017648 loaded from save not found within the actual object. This variable will be skipped.
Unsorted facts
- If you wish to borrow critter behaviors for a script, be careful. I've been reading through USKP discussions and apparently, Bethesda's critter scripts were very buggy. Seems like the USKP rebuilds most critter behaviors almost from scratch.
- "Translate routines will operate properly in unloaded areas." This, in regards to animating and moving critters like moths.
- Even though translations work in unloaded cells without 3D loaded, "
StopTranslation()
requires the cell attached and loaded 3D. There's no reason for it, but it throws an error without it!"- The use case dealt with here involves deleting an object when its cell is exited (e.g. going from an exterior to an interior), when that object is being translated.
- There is reason to doubt that translate routines actually do operate properly in unloaded areas. It's possible that they don't properly unlock the translated object (allowing for deletion) unless the cell is attached.
- Even though translations work in unloaded cells without 3D loaded, "
- When an ingredient is sold or consumed, "it will have the deleted flag set already, and won't have a parent cell or 3D."
- Critter animations: butterflies and moths use
fTakeOff
, while dragonflies and fireflies can usefTakeOff
orTakeOff
. - "Scripts that are fragments for packages never go away, and seem to begin executing on a None package with no conditions."
- Apparently, one can disable a persistent reference using a method discussed here.
Unsorted edge-cases
- Be careful about handling things OnCellAttach and OnCellDetach in Riften. The city's walkways have you cross back and forth across a cell boundary.
- The use case dealt with here involves deleting critters when you leave their containing cells. The scripter's attempted solution was to add a timed delay (using OnUpdateGameTime) to the deletion. Return to the cell before the timer has elapsed, and the critter is reused -- the deletion is canceled.
- You may run into a peculiar problem when passing through a load door: cells that are unloaded by the game can still exist as "valid" Papyrus Cell objects. They'll be recognized as Cells rather than as Nones, but attempts to call most native methods on them will fail. Effectively, it's the bizarre difference between something that's null and something that's None.
- Surprisingly,
kMyBrokenCell.GetFormID()
will still return a null cell's proper ID, even though the cell object is broken. - Comparing
kMyBrokenCell
toGame.GetForm(kMyBrokenCell.GetFormID())
reportedly returns False when dealing with a null cell. This would make sense: an existing Papyrus Cell object can lose its underlying cell and still exist, but you probably cannot create a new Papyrus Cell object from a lost cell.
- Surprisingly,
Unsorted engine bugs
- Ride a horse into water, get it to swim, dismount, and remount. It'll use land physics while in water.
- Reloading a savegame won't reset a merchant's gold.
- If too many light sources are around in a single area, then surfaces and objects will flicker between lit and unlit as the camera moves. This is due to an engine limitation.
Unsorted best practices
- Don't change uGridsToLoad. It will overburden the scripting engine.
- Quicksaves aren't quite the suitcase nuke they're made out to be. Still, use some basic caution with them.
Unsorted lessons
- A 10MB Papyrus log. This is why you should be careful with update events.