User:Niaht/Notes

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

So far everything here mostly refers to Quest Scripts. I'm in the process of creating some testing packages, and since I just want the scripts to run at start...

Looking for Information[edit | edit source]

I'm looking for FOUR good GMSTs to use for testing purposes. The test is in the form four ESPs that are intended to be installed and modified by OBMM, and then removed once testing is confirmed.

Qualifications are that changing these GMSTs won't do any real "damage" for any reason, and that they can be easily and clearly tested for.

Data Management[edit | edit source]

Mod Cleaning[edit | edit source]

If you want to delete a record from an ESP file, one way to do it is with TESsnip. I'm not sure if the other methods will actually truly delete a record, as they all use the term "Ignore" in their verbiage, and I haven't tried it.

Once you have selected and deleted a record using TESsnip, you should open the ESP up using the CS, and click yes when it prompts you about fixing the header due to an incorrect header count.

Scripting[edit | edit source]

Functions[edit | edit source]

MessageBox: To display multiple message boxes in succession you must create a state machine, and check GetButtonPressed in between each messagebox call until you get a value larger than -1. Otherwise the second messagebox will override the first and kill the script.

Quirkyness can result, such as having a message box up with no mouse cursor. Use console mode to get a mouse cursor and clear the message box.

In the odd case that there are two scripts firing (especially multiple) messageboxes at the same time, they can collide, even when you've gone to the trouble of setting up all the proper scaffolding in each script. So far I know of no solution other than making the scripts aware of each other, so that one does not try to raise a messagebox while the other is in progress waiting for a messagebox response.

Something that might alleviate the potential issue, or just ickyness, of a messagebox or menu script continuing to run every frame might be to incorporate a timer into the "state" that is waiting for a response from GetButtonPressed.

Variables[edit | edit source]

Declaring Variables[edit | edit source]

Script Global Variables[edit | edit source]

Variables can be set outside any block causing them to be Script Global. This means that once set to a value, they will remain set unless otherwise changed, until Oblivion is shut down.

What about when you save your game? What happens then?

Temporary Variables[edit | edit source]

Declaring a variable inside a block could be called 'declaring a temporary variable', since the variable will only exist during the scope of the current invocation. This is similar to how variable scope works in traditional programming languages.

Variable Initialization[edit | edit source]

Variables are initialized using the Set function.

If don't want your variable to be reinitialized on each script invocation, wrap your assignment statements in a conditional.

short init
short myShort

Begin BlockName
If ( init == 0 )
  Set myShort to 1
  Set init to 1
EndIf

Variable Types[edit | edit source]

Reference Variables[edit | edit source]

Reference variable can not be set to just any function that returns a value.

ref refValue
Set refValue to GetButtonPress

This will not work.

Quest[edit | edit source]

Blocks[edit | edit source]

GameMode

Quest Functions[edit | edit source]

StopQuest - Modifies Player? (e.g. will set a variable in the savegame if saved)