Difference between revisions of "User:JRoush"
imported>JRoush |
imported>JRoush |
||
Line 33: | Line 33: | ||
|- | |- | ||
| <center> Distance Factor </center> | | <center> Distance Factor </center> | ||
| <center> | | <center> distMult </center> | ||
| 1 - (distance between detector and target) / maxDist | | 1 - (distance between detector and target) / maxDist | ||
|- | |- | ||
Line 57: | Line 57: | ||
| [[fSneakSoundLosMult]] if detector has line of sight to target | | [[fSneakSoundLosMult]] if detector has line of sight to target | ||
1.0 otherwise | 1.0 otherwise | ||
|- | |||
| <center> Invisiblity Factor </center> | |||
| <center> invis </center> | |||
| 0.0 if target's "Invisibility" AV > 0 | |||
1.0 - (target's "Chameleon" AV) / 100.0, otherwise (to a minimum of 0.0) | |||
|- | |||
| <center> Blindness Factor </center> | |||
| <center> blind </center> | |||
| 1.0 - (detector's "Blindness" AV) / 100.0 | |||
|- | |- | ||
| <center> Line-of-Sight Light Factor </center> | | <center> Line-of-Sight Light Factor </center> | ||
Line 71: | Line 80: | ||
| <center> swimLight </center> | | <center> swimLight </center> | ||
| [[fSneakSwimmingLightMult]] if target is under water | | [[fSneakSwimmingLightMult]] if target is under water | ||
1.0 otherwise | |||
|- | |||
| <center> Swimming Sound Factor </center> | |||
| <center> swimSound </center> | |||
| 0.0 if target is under water | |||
1.0 otherwise | 1.0 otherwise | ||
|- | |- | ||
Line 80: | Line 94: | ||
|- | |- | ||
| <center> Sound Factor </center> | | <center> Sound Factor </center> | ||
| [[fSneakSoundsMult]] * losSound * | | [[fSneakSoundsMult]] * losSound * distMult * (running * moving + combat) * swimSound | ||
|- | |||
| <center> Light Factor </center> | |||
| [[fSneakLightMult]] * invis * blind * swimLight * losLight * distMult * (LightLevel + [[fDetectionSneakLightMod]]) | |||
Or, [[fSneakSleepBonus]] if detector is sleeping | |||
|- | |- | ||
|} | |} |
Revision as of 18:09, 20 August 2010
Notes on Scripting
General Scripting
Adding or removing (possibly any modifying of) effects in an enchantment (or, presumably, a spell) that is currently affecting an actor results in CTD. Instead, we must cloneform the enchantment and use that instead. Previous testing gives me hope that the game might garbage collect unused formids.
Modifications to non-cloned forms (e.g. changes to name, etc) do not appear to stick upon reloading the game. Dynamically generated spells must be cloned, or else the base forms modified in script every time the game is reloaded.
Cloned forms are not removed when the mod is deactivated. Since there is no way for the average player to remove cloned spells from spell merchants, a "cleanup" script must be provided to do so. - makes the whole use of cloned spells unattractive -
GetOwner appears to work only on references (not items in a container). There is a stolen flag, I believe, but not sure how to set it.
Moveto and PositionCell don't transfer meshes. the 'usual' workarounds assume transfer to the current cell, and don't work for destination cells that aren't loaded.
Using GetIconPath on an object with no icon causes a CTD.
Menu Scripting
Traits of the form <user#> are parameters set by the game enigne. The visible manifestations (text, slider position, etc.) are usually set to derive from these inputs. As of OBSE v0017 modifying most traits from scripts will destroy derivative relationships; it appears that some values (e.g. quantity slider traits) are safe to modify. Modifying the <user#> traits directly one can "fake" user input; in particular spell/potion names and slider bar positions. Derivative relationships are reloaded when the menu is. Note that the HUD (and possibly the inventory) reloads only after exiting to the main menu; changes to the HUD will persist until then.
The Arrow + Enter keys can normally be used to navigate menus. I haven't found (or seriously looked for) a way to determine which tile is the focus of a keyboard event. It looks like the focus is *either* keyboard or mouse based, and transitions from one to the other are inconsistent or bugged. At any rate, OBSE v0017 GetActiveUIComponent* functions work only for tiles focused on by the mouse. Also, arrow+enter menu navigation is NOT based on mapped controls and cannot be disabled using Disablekey. It CAN be disabled by removing all traits of the form <xbutton>, <xleft>, <xright>, etc. from the menu in question, but not by simply setting them to zero in scripts. This is a problem because an errant keystrokes can apparently derail a ClickMenuButton call, which makes setting up long chains of automated click events unfeasible.
The GetCursorPos function is a bit dodgy. Returned positions are not consistent, and seem to depend on integrated movement history. This, combined with the lack of a function to get screen resolution, makes it impractical for use in menus (specifically, I couldn't use it to script in a custom slider bar).
Detection
fSneakMaxDistance ( * fSneakExteriorDistanceMult, for exterior cells) | ||
1 - (distance between detector and target) / maxDist | ||
fSneakBootWeightBase + fSneakBootWeightMult * (target boot weight) if target is moving 0.0 if target is stationary | ||
fSneakTargetInCombatBonus if target is in combat
0.0 otherwise | ||
fSneakRunningMult if target is running
1.0 otherwise | ||
fSneakSoundLosMult if detector has line of sight to target
1.0 otherwise | ||
0.0 if target's "Invisibility" AV > 0
1.0 - (target's "Chameleon" AV) / 100.0, otherwise (to a minimum of 0.0) | ||
1.0 - (detector's "Blindness" AV) / 100.0 | ||
1.0 if detector has line of sight to target
0.0 otherwise | ||
fSneakTargetAttackBonus if target attacked detector
0.0 otherwise | ||
fSneakSwimmingLightMult if target is under water
1.0 otherwise | ||
0.0 if target is under water
1.0 otherwise |
fSneakSoundsMult * losSound * distMult * (running * moving + combat) * swimSound | |
fSneakLightMult * invis * blind * swimLight * losLight * distMult * (LightLevel + fDetectionSneakLightMod)
Or, fSneakSleepBonus if detector is sleeping |