Category:Tidbits

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Use this page to link to useful tidbits, that either don't quite fit into any current articles, or that you don't have a chance to write up. The main purpose is to be a temporary hub for articles when the wiki begins to undergo major reorganization. If you find a useful piece of information on some out of the way page then please post the link and a brief description here (such as this DropAllItems script found in the OBSE Wish List). You can also link to interesting external web links here (please include a very brief description). It can also be used for information that needs further investigation, but please also post a link to here in the relevant article, if there is one.

Wayward Wiki Articles[edit | edit source]

Category:Unfinished_Articles

DropAllItems script


External Tidbits[edit | edit source]

Modfood[edit | edit source]

Collection of very useful code snippets.

Gotchas! thread[edit | edit source]

Most of these are included on the TroubleShooting page here on the wiki, but some are not. There are also a few bugs mentioned that bear further investigation.

Point Blank AOE hits... what?[edit | edit source]

Brief discussion of what is hit by an area of effect spell.

Accessing NPC Inventory (Companion mod style)[edit | edit source]

The answer to the question Accessing NPC Inventory is still somewhat incomplete. Specifically, how do you avoid the Negative Inventory Count bug, and how do you prevent on the items from running (or should you)?

NPC to sit down on the nearest piece of furniture[edit | edit source]

The answer to the question Making an NPC Sit is incomplete. This thread documents some alternative answers, but it's unclear it an answer emerges.

Quick Question[edit | edit source]

OP asks for a keyboard shortcut. Where are the keyboard shortcuts on the wiki? Also, WillieSea lists a good set of shortcuts.

Resurrecting the Player[edit | edit source]

Very nice page on how to resurrect the player and avoid all of the potential bugs.

Proper way to find ground height?[edit | edit source]

Answer on the wiki doesn't have code. Seems like TTT has a pretty exact answer used in a mod.

TESNexus has a new section for Modding Articles[edit | edit source]

Need I say more?

A wee CS bug[edit | edit source]

Discussion of using 'set RefVar.Var to #/ref' to set another object's variables. Normally this isn't possible, and the compiler howls mercesilly, but when the calling script has a variable of the same name it's possible. However, the changed variable won't necessarily be the named one. For instance, if the variable is the 9th short variable on the calling script, then the 9th short variable will be changed on the called script.

"Broken" Nif[edit | edit source]

The sewerRoomWallMid01.nif does not have any havok. Consequently, anything can pass through the wall if it can reach it - such as arrows or the Player (and they can in a few instances in Bethesda's sewers). Specific instance can be seen in the Elven Garden Sewers. As soon as you enter the sewer from the Elven Garden, go to the stairs down and look to the right. With a running start, a Player can jump through the wall from one room to the next.

Additional nifs without havok are sewerRoofNarrowShort01.nif and sewerRoofNarrow02.nif.

Further Investigation Needed[edit | edit source]

Tokens lead to crashes?[edit | edit source]

FlyFightFlea's Supreme Magicka seems to cause more crashes than most mods. There has been some discussion that the crashes are due to the use of tokens, specifically when the tokens try to remove themselves from corpses. Here are the relevant posts: [1] [2] [3]. Note in the last post that Supreme Magicka is undergoing a testing period to see if removing the token system does prevent crashes.

  • RemoveMe alternative: The tokens use RemoveMe when the creature becomes a corpse, and crashes tend to happen when the player re-enters a room with many corpses ([4]). It's also known that using RemoveMe shortly after adding the item to a container may cause crashes. Maybe using RemoveMe immediately after the player enters the cell also causes a crash? If so, a counter should be used, starting in the onDeath block as you would the onAdd block.
Preliminary testing has shown that removing a token may reset the variables on other tokens on the actor. While this is inconclusive, it is my belief that this is what caused the CTDs with Supreme Magicka.
Dragoon Wraith TALK 18:28, 9 August 2007 (EDT)
That is really strange, and I would hope that's not true. I've gotten similar results by adding two tokens at about the same time, but now that I think about it, they did remove themselves shortly afterwards as well.
--Haama 19:48, 9 August 2007 (EDT)
I hope to do more tests tonight, but just so you know what I have tried: I was testing various things with tokens. I had a null script AoE spell, then a do-nothing script AoE spell, then a scripted AoE spell, then an AoE spell that added a scriptless token, then a scripted token, and then a token scripted to remove itself. They all worked fine, but I noticed that a token from my WIP mod was behaving weirdly - it is scripted to check if the container's weapon matches a reference variable, and if not, set the variable and a few other things. If the token happens to be the one on the player, it also prints out some information at that time. During the test, I never changed weapons, so my token should have been silent, but every time the tokens were removed, my WIP mod's token would report the (correct) information about my weapon. I have not followed up on this result as of yet, however. I hope to tonight.
Dragoon Wraith TALK 18:21, 10 August 2007 (EDT)
*sigh* I wasn't really looking for CTDs, but I found one. Using RemoveAllItems when on an NPC that has an equipped item causes a CTD. Some notes and particulars: RemoveAllItems doesn't seem to work on Unplayable items, so the item was playable (after I changed it in the CS). RemoveItem worked perfectly fine. Unequipping the item and then using RemoveAllItems worked fine. The item was equipped with 'NPC.EquipItem Token, 1'. I know most tokens aren't playable, but maybe some are (as they're being removed before the player has a chance to see them).
--haama 18:25, August 10, 2007 (EDT)

(back to left)
Hmm... I was simply using RemoveMe on the token, but RemoveMe may work similarly. RemoveMe also ignores Playable status, so if an equipped token uses RemoveMe... that could cause a CTD. Well, that's easy enough to fix (just make sure it's unequipped first), which is awesome. I will check to see if NPCs are equipping the tokens in my tests.

However, the player certainly is not equipping any unplayable token, which does not explain my WIP mod's token's behavior. As I said, more testing needs to get done... which means I need to stop playing Diablo II. Damn that game is addictive. Well, I'm rescuing Cain (NM) at the very least before testing.
Dragoon Wraith TALK 20:43, 10 August 2007 (EDT)


Force Cast and Magicka Use[edit | edit source]

Does forcing an NPC to cast a spell with Cast also drain their magicka?


Target Spell Use by Non-Spellcasters[edit | edit source]

Apparently the spell is cast using a regular attack animation when the caster does not have a casttarget.kf or casttouch.kf. For instance, a skeleton swinging a sword.


Save and Reload Breakdowns[edit | edit source]

If you unequip an item right before saving with con_Save, and reload that save game, then the unequip block of the item won't be fired as normal. Not sure if this happens with normal saves (con_Save from other scripts, player going through the options menu, or pressing the Quick-Save key), as con_Save saves the states of everything at that exact line of script, and not the end of the frame or script.


Stealing Items WITHOUT being in Stealth Mode[edit | edit source]

It seems that when an actor gets knocked down, you can open up their inventory and take whatever you want, even when not in stealth mode, even though they are not dead. Needless to say, this is likely to be noticed and the actors have made comments about stealing items, although they have not attacked (probably because they are already fighting?). However, in my experience so far, it has not been reported as a crime, even though it has done it right in front of, and to, guards involved in the fighting. Needs more testing...


When do remote activators run?[edit | edit source]

Generally, objects that aren't loaded (i.e., not in the player's cell) won't run their scripts. However, it seems that remote activators run for a single frame when the mod is first activated, and whenever a variable on the activator is set. Since the activator isn't activated, the onActivate block won't run, but the GameMode or MenuMode blocks will (depending on which you're in). Likewise, I imagine any other, umm... flagged block will run (ok, where's a general script tutorial so I can get this terminology right?), like, umm... onLoad? I also imagine this holds true for any remote, persistent object as well. See Mod's not Changing? What the ? for more details.

I've done some more tests. I've found that a remote activator will run it's script on the frame following a variable set. This can be used to make the remote activator act like a Loaded one by setting a variable at the end of the block. For instance,
begin onActivate
  set Working to 1
end

begin GameMode
  if Working
    printc "Working"
    set Working to 1
  endif
end
will print "Working" every frame after being activated from another script. To stop the script from running, simply have a condition where a variable won't be set
begin GameMode
  printc "Counter is %g"
  if Working
    if (Counter < 10)
      set Counter to (Counter + 1)
      set Working to 1
    else
      set Counter to 0
      set Working to 0
    endif
  endif
end
Remember that the script will run one more time than you would like. For instance, in the above script you would see printed "Counter is 1", "Counter is 2"... "Counter is 10", "Counter is 0" and then the script will stop processing.
I have a duplication of the activator running once when the mod is first loaded, but I didn't do any specific tests.
--Haama 23:00, 5 September 2007 (EDT)

Pages in category "Tidbits"

This category contains only the following page.