Oblivion Mod:Cobl/Modding/Magic Tracking

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

This is a WIP --Haama 12:00, 13 December 2008 (EST)

Background[edit]

COBL's Magic Tracking (added v1.39) provides an easy way for modders to monitor changes of the active effects on the player, essentially creating OnMagicHit/OnMagicFinish type blocks. Note that it can only detect spells/effects that have a duration (or, it can't detect instant, 0-duration spells).

Requirements[edit]

The player will need OBSE (>= v.0014a) and Pluggy (>= v73) to use the Magic Tracker.

Specifics[edit]

The Magic Tracker scans the player's active effects every second. If the active effects have changed since the last scan, the change (new spell, spell has ended, etc.) is marked on the appropriate list. There are, currently, 5 lists that can be broken down into 2 categories:

...

Quick Guide[edit]

Initialize the system[edit]

  1. Write down an EditorID from your mod - anything except Globals will work
  2. Create a quest with the name of your choice
  3. Mark it as "Start Game Enabled"
  4. Create this quest script (replace the ---s with the name of your quest)
    scn ---Script
    long  Warning
    
    begin GameMode
            SetStage --- 0
            if (Warning == 0)
                    set Warning to 1
                    messagebox "You need COBL v1.39 or later in order to use this mod. Please visit http://planetelderscrolls.gamespy.com/View.php?view=OblivionMods.Detail&id=3508 for more information and the download."
                    return
            endif
            if (Warning == -1)
                    ;Start a quest (see next step), add items, enable objects, etc. to get the player started with your mod
                    StopQuest ---
            endif
    end
  5. Attach the quest script to "YourQuest"
  6. Goto the Quest Stages tab
  7. Create a new stage, leave the index as 0
  8. Create a new Log Entry (don't worry - it won't pop up, it's just needed for the Result Script)
  9. Paste this in the Result Script box
  10. set cobMgcTrackerFAR.rUser to AnyRefFromYourMod ;Use the EditorID that you wrote down earlier
    cobMgcTrackingRegisterFAR.Activate cobGenActRef, 1
    if (cobMgcTracker.bInit > 1)
            set Warning to -1
    endif

Using the lists[edit]