Difference between revisions of "OBSE Wishes Fulfilled"

11,525 bytes added ,  23:57, 6 August 2010
add stuff fulfilled in 0018/0019
imported>Scruggs
(add arrays (v0017))
imported>Scruggs
(add stuff fulfilled in 0018/0019)
 
(6 intermediate revisions by 2 users not shown)
Line 131: Line 131:
*'''Get/SetHideRings''' - Returns or sets the hide rings attribute of the calling reference.
*'''Get/SetHideRings''' - Returns or sets the hide rings attribute of the calling reference.


==OBSE v0017 (forthcoming)==
==OBSE v0017 ==
*Array variables
*Array variables
*Activate2 - Exactly like Activate but with an unlimited nesting limit (currently only 4-5 scripts started with Ref.Activate player, 1 will run at once while there is no limit on result scripts)
*Any function expecting a string argument will accept a string variable in its place.
*'''ModNthEffectItemScriptName''' - Modifies the nth effect's name. (It is possible to set the name with [[SetNthEffectItemScriptName]], but not to mod it). ''Modify the string returned by GetNthEffectItemScriptName and pass the modified string to SetNthEffectItemScriptName''
*'''AppendToNthEffectItemScriptName''' - Works like AppendToName but for scripted effects. ''as above''
*[[Combat Style]] functions - functions to get and set the parameters of a Combat Style
==OBSE 0018==
Some of the requested functionality is already present in the current stable release.
*'''setPackageTarget''' - like addScriptPackage, except it takes a reference as a parameter which then serves as the target of the package.
*'''SetDebugMode''' - This function currently accepts the mod index to enable debugging on, and a boolean value as to whether debugging should be enabled or disabled.  Changing the boolean value to an integer would provide greater functionality, such that 0 = turn off debugging, 1 = debug to console only, 2 = debug to log file only (see below), and 3 = debug to console and log file.  In short, it would provide the ability to write mod-generated debug text to a log file.  Perhaps the log file could be called "OBSE<ModIndex><Date><Time>.log", and would be created in the OBSE subdirectory of the Oblivion\Data\ folder, but these are just suggestions, this format can and should be altered to meet with OBSE standards and conventions.  Also, each entry in the log file should have a timestamp written before each line.
: Can be implemented as an user function. Use [[:Category:ConScribe|ConScribe]] for text logs.
*'''messageNoDelay''' - causes the to be displayed immediately, even if another message is currently being displayed.
: Use [[printToConsole]] instead.
*'''GetPlayerCameraAngle''' - Like GetAngle Z except detects the angle the player is looking instead of the angle the horse is heading when the player is on horseback.
: ''player.getHeadingAngle horseRef'' could be useful here.
*'''GetDisease''' - Return if the calling actor gets diseased.
: Can be ascertained by using [[:Category:Magic Functions - Active Effect (OBSE)|Active Effect functions]].
*'''Activate2''' - Exactly like Activate but with an unlimited nesting limit (currently only 4-5 scripts started with '''Ref.Activate player, 1''' will run at once while there is no limit on result scripts)
* '''CastByPlayer'''/'''Cast2''' - combine a [[Cast]] call with [[SetPlayerProjectile]] call on the projectile fired by the Cast, to avoid having to loop through references to find the projectile cast.
: Use '''getProjectile'''.
*'''GetModVersion/fModVersion''' - fModVersion is a variable that is available uniquely to any mod, and can be set from any script in that mod (thinking along the lines of fQuestDelayTime for quest scripts).  Then, any mod (including the original) can call GetModVersion, passing the esp ID or the mod's filename, to return the version of that plugin (though it's artificial; the modder explicitly sets the version by defining the fModVersion variable).  This would greatly aid in creating mods that are meant to be compatible with multiple versions of another mod.  If fModVersion is too difficult to implement, SetModVersion could be a function that has the same effect as setting fModVersion manually.
: Use '''getFormFromMod''' to pick an object that stores version info.
*'''GetUnusedLabel''' - Return an unused label number. If we run out of label numbers, return -1. Looping is absolutely great, but when using ''label'' & ''goto'' in stage functions, I found it would be a problem that I had to specify the label number. I couldn't assure that label numbers I used were unused. So I think it'd be helpful to this kind of situation.
: Use While .. Loop control structures instead.
*'''GetMouseX/GetMouseY''' - Returns current mouse position.
: Use '''getCursorPos'''.
*'''MagicItemHasEffectAndActorValue(/Code/Count/CodeCount)''' - Returns whether the magic item has the specific effect and actor value (i.e., the magic item has "Fortify Intelligence", rather than the magic effect "Fortify Attribute"). Also accepts 256/No Actor Value.
: Can be ascertained by using [[:Category:Magic Functions - Magic Item (OBSE)|Magic Item functions]].
*'''CopyName for Magic Effects''' - Copies the name of the magic effect unto an item. Might also be able to get around this by making a function that returns the reference of the magic effect, and feeding that reference to the standard CopyName.
: Use '''getMagicEffectName'''.
*'''Console functions'''
: Use '''runScriptLine'''.
*'''PlayMusic''' - [[StreamMusic]] is horribly buggy. A cleaner version which overrides combat music would be ideal.
:'''StopMusic''' - stops a mp3 file played with the above or with [[StreamMusic]].
:'''GetMusicPlaying''' - returns the filename of the currently playing track?
:: Use the '''Enhanced Music and Control/SoundCommands''' OBSE plugin.
*'''PlayEffectSound Effect SoundType''' - Plays the sound effect of a spell effect. SoundType is an integer that determines if it plays the cast, bolt, hit, or area sound.
: Use [[playSound]] with '''getMagicEffectHitSound'''.
*'''getCaster''' - in a scripted spell, returns a reference to the object or actor which cast the spell.
: Use [[getNthActiveEffectCaster]].
*'''getCurrentAnim''' - Returns the currently playing animation.
: Use '''animPathIncludes'''.
*'''changeAnimFilepath''' - Changes the filepaths used for the player anims by script effect, so he/she e.g. floats like a lich always when a "Lichdom"-effect effects him/her.
: Use '''toggleSpecialAnims'''.
*'''setCameraDistance''' - In third person view, adjusts the camera's distance from the player.
: Use [[setNumericGameSetting]] to modify the appropriate GMST.
*'''fadeIn/fadeOut''' ''duration'' - Fades the screen to or from black over the given duration.
: Use the '''Oblivion Graphics Extender''' OBSE plugin.
*'''closeMenu''' - Closes all open menus.
: Use '''closeAllMenus'''.
*'''TriggerShader''':  Adds a shader to the PC camera, the shader could be defined in an INI or via another function (see talk: Custom Shaders).
: Use the '''Oblivion Graphics Extender''' OBSE plugin.
*'''PlayAnimationSourceFile''': Plays animations directly from a source file on the specified actor.
: Set up idles and use [[pickIdle]].
*'''GetFirstRefInContainer''' - Like GetFirstRef, but returns a reference to first item in a container.
: Use [[getInventoryObject]].
*'''getNearest ''integer'' ''type'''''  - Returns a reference to the nearest object to the calling reference.  ''Type'' specifies which type of reference - Actor, Activator, etc.  So, for example, ''player.getNearest 6 NPC'' will return the sixth closest NPC to the player.
: Use '''getFirstRef/getNextRef''' with [[getDistance]].
*'''getTelekinesisRef''' - Returns reference of the object player is currently targeting with telekinesis.
*'''GetTeleportMarker''' - Return teleport marker associated with the door that called the function
: Use '''getTeleportCell''' instead.
*'''IsStill''' - Returns true if the actor is not moving any of its body parts - providing that it has body parts - by itself at all (e.g. standing still, flying still, jumping still, swimming still, falling still, being crashed or limbs moved by only other actors - not the actor himself, etc).
: Use '''isAnimGroupPlaying'''.
*'''GetIsSummon''' - Returns true if the calling actor is a summoned creature (a normal summon associated with one of the "Summon" spell effects). This would allow scripters to avoid issues where the reference is destroyed when the spell effect ends or creature is killed.
: Use the [[isSummon]] user function.
*'''GetActorMagicEffectMagnitude [Effect]''' - Returns the total magnitude of a particular magic effect from all spells/abilities/etc affecting an actor.
: Use [[getTotalActiveEffectMagnitude]].
*'''GetTextFromDialog''' - retrieve dialog text, manually entered text, or the answer options that the user can choose /this would make only sense if we had string manipulation routines, too, such get Trim(), Substr(), Compare(), Catenate()/. Would be great for some puzzles...
: Use '''getMenuStringValue'''.
*'''Get/Set/ModWaterHeight''' - change the height of water in an Interior cell
: Use '''setCellWaterHeight'''.
*'''IsPCUnderArrest''' - return a boolean indicating whether the player is chased by any guard.
: Use '''getFollowers'''.
*'''GetGameDifficulty''' - Returns current game difficulty.
*'''GetPoison''' - Returns the poison applied to the calling weapon reference.
: Use '''getEquippedWeaponPoison'''.
*'''SetCurrentCharge''' - Sets the charge of the calling reference (getcurrentcharge already exists)
*'''SetCurrentHealth''' - Sets the health of the calling reference - for objects,not actors (getcurrenthealth already exists)
*'''EquipItem2''' - equips an item and causes the OnEquip block to run if applicable.
*'''EquipMe''' - Makes the actor holding the calling reference equip it and runs the item's OnEquip block.
*'''RunScript'''- Forces a run of the specified script, even if the begin/end block is not Gamemode. Makes quest stage reactions faster and allows variables to be defined in a stage result script.
: Use '''Call''' to execute a function script
*'''MessageBoxEx Force Upper/Lower case''' - Add two new commands - %u and %l - to force the first character of a variable to be either upper or lower case. For example, using %u %pp at the start of a sentence would print as His, Her ot Its, instead of his, her or its.
: Use a string variable and '''ToUpper''' or '''ToLower'''; this is a more general solution that needn't be used only with MessageBoxEx.
==OBSE 0019 (forthcoming)==
*'''[ref].On[blocktype] [ObjectID]''' Would be used as a block type in quest scripts which would run as if the block type is used in the reference or object's script
: Use '''SetEventHandler''' to register a function script as a callback to be invoked when an event associated with a block type occurs.
*'''DuplicateAllItems2''' - Same as DuplicateAllItems, but doesn't create a new ID/cloneformed item for each scripted item that's duplicated
: Use '''CopyIR''' to copy the item(s) to the target container
*'''getEquipmentSlot''' - Many clothes occupy '''foot''' + '''lower body'''.  according to the wiki, there is no return value for this configuration.
: New slot IDs added
*'''OnActorHits (''Id Optional'')''' - This block will be run once when the scripted actor hits the specified Object or actor.
: Use '''SetEventHandler "OnHit" SomeScript''' where SomeScript is a function script; the attacker and/or target can optionally be specified.
*'''getLastAttacked''' - Returns a reference to the actor last attacked by the calling actor.
: '''SetEventHandler''' again.
*'''(reference).GetLastKilled''' - Returns the reference of the last actor killed by the player/an actor.
: '''SetEventHandler yet again.
*'''GetDimension [x|-x|y|-y|z|-z] ''' - returns the distance from the object 'origin' to its outer limit in the requested axis and direction - very useful when moving/placing/aligning/spacing references by script. (a typical NPC with the origin at the feet would return 125 to Z (origin to top) and 0 to -Z (origin to bottom)
: Use '''GetBoundingBox'''
Anonymous user