Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Script Requests


Tonycubed2
 Share

Recommended Posts

I think both would probably involve applying magic effects to the player.

 

There is an invisibility Effect Archetype that might do what you want, which I believe can be applied automatically when the player enters sneak. See Boethia's Ebony Mail or Vain's Boethia's Cloak. Or perhaps you could use the SetAlpha function of the Actor script instead of a spell. You might also want to look through a relevant thread on the Nexus forums showing how to set up a script on an alias for the player that can detect when sneak is entered.

 

Applying a spell on entering combat would probably be done through the OnCombatStateChanged event of the Actor script. I don't know of any event that gets fired when a weapon is drawn or sheathed, though there are functions to tell if a weapon/spell is or isn't drawn.

Link to comment
Share on other sites

How would one make it so that the player receives a spell upon obtaining a specific perk?

You don't really need a script for that. Just make a new entry for the Perk with an ability to add the spell to the player.

 

Ability: An Ability Perk Entry adds the selected Ability or Spell to the player when they acquire the perk. Spells and Abilities added in this way will be removed when the Perk is removed.

Link to comment
Share on other sites

You don't really need a script for that. Just make a new entry for the Perk with an ability to add the spell to the player.

 

This is helpful information, but not what I need. I need to add a spell to the player that you actually cast, like flames or ice spike, not just an effect that is applied when you select the perk.

Link to comment
Share on other sites

Hello,

I am currently working on a rather basic quest. The quest involves collecting 10 samples of two different ingredients. I have been trying, with no success, to figure out how to write a script which keeps track of the number of the ingredient in your inventory and updates the number displayed (X/10) in the objective list of the journal. And then upon having the necessary amount the quest would advance stage.

Similar scripts exist for vanilla quests, such as the thieves guild unusual jewel quests. However, I have been unable to successfully adapt them to my needs.

Any help would be great

Link to comment
Share on other sites

Hi I am new to scripting and having a friend to help me with a few of my scripts so far, but i am not sure how to actully cause a button to enable, lets say a npc that is already there, than when the button is pressed again the npc vanishes and so forth, it is for a player house i am working on and so if a room gets to full of npcs the floor can vanish and or flame traps to be enabled and burn the npcs alive

 

Well made the script i was waiting took a while looking at different scripts but this is what i came up with

 

Event OnActivate(ObjectReference akActivator) ; Function to change bard to enabled or disabled
    If (Bard1.IsDisabled()) ; if parent marker is disabled
        Bard1.Enable() ; enable bard
    Else
        Bard1.Disable() ; disable bard
    EndIf
EndEvent



Actor Property Bard1  Auto

 

 

Than for my fire traps i made this one

 

criptname DuckEnableScript2 extends Form  


Event OnActivate(ObjectReference akActivator) ; Function to change Traps to enabled or disabled
    If (Trap1.IsDisabled()) ; if Trap1 is disabled
        Trap1.Enable() ; enable Trap1
    Else
        Trap1.Disable() ; disable Trap1
    EndIf
    
    If (Trap2.IsDisabled()) ; if Trap2 is disabled
        Trap2.Enable() ; enable Trap2
    Else
        Trap2.Disable() ; disable Trap2
    EndIf

    If (Trap3.IsDisabled()) ; if Trap3 is disabled
        Trap3.Enable() ; enable Trap3
    Else
        Trap3.Disable() ; disable Trap3
    EndIf
    
    If (Trap4.IsDisabled()) ; if Trap4 is disabled
        Trap4.Enable() ; enable Trap4
    Else
        Trap4.Disable() ; disable Trap4
    EndIf
    
    If (Trap5.IsDisabled()) ; if Trap5 is disabled
        Trap5.Enable() ; enable Trap5
    Else
        Trap5.Disable() ; disable Trap5
    EndIf

    If (Trap6.IsDisabled()) ; if Trap6 is disabled
        Trap6.Enable() ; enable Trap6
    Else
        Trap6.Disable() ; disable Trap6
    EndIf
    
    If (Trap7.IsDisabled()) ; if Trap7 is disabled
        Trap7.Enable() ; enable Trap7
    Else
        Trap7.Disable() ; disable Trap7
    EndIf
    
    If (Trap8.IsDisabled()) ; if Trap8 is disabled
        Trap8.Enable() ; enable Trap8
    Else
        Trap8.Disable() ; disable Trap8
    EndIf

    If (Trap9.IsDisabled()) ; if Trap9 is disabled
        Trap9.Enable() ; enable Trap9
    Else
        Trap9.Disable() ; disable Trap9
    EndIf
EndEvent


ObjectReference Property Trap1  Auto  

ObjectReference Property Trap2  Auto

ObjectReference Property Trap3  Auto

ObjectReference Property Trap4  Auto  

ObjectReference Property Trap5  Auto

ObjectReference Property Trap6  Auto

ObjectReference Property Trap7  Auto  

ObjectReference Property Trap8  Auto

ObjectReference Property Trap9  Auto

 

 

They Both work fell free to use them when you want to

Edited by Duck
Link to comment
Share on other sites

 

The game already handles custom boss music, I think, via script attached either to the quest script (in the case of alduin battles) or in the case of scripts attached to aliases (like Miraak, Harkon and, I think, Karstaag).

 

DLC2MQ06, for example, stores this kind of data in the Miraak alias.

 

I'm trying to write a similar script for less "intensive" boss battles which works in a similar way: it assignes a custom music type for that enemy, and resets to the default music handling once the battle is over. can someone help?

Link to comment
Share on other sites

  • 1 month later...

I saw you were taking requests for scripts for skyrim and I could use a little help with something for a player home mod. Im trying to make a general script that will be used to display those heavy elder scrolls and irremovable black books from your inventory and nicely put them on the shelf. Let me spell out the order I want this general script to work. It may need to be multiple scripts.

 

1. Player clicks on trigger box

 

Check to see if the black book or elder scroll is already on the shelf

 

If already on the shelf: 

 

2: ask player if they would like to remove the black book or elder scroll from the shelf

 

if yes: disable the dummy book or scroll on the shelf, add the real book or scroll to the players inventory.

 

if no: end script

 

If there is no book or scroll on the shelf:

 

2. Player is asked if they wish to put the item (a black book or elder scroll) onto the shelf

 

 IF yes: the (black book or elder scroll) is removed from the players inventory, A dummy black book or elder scroll is enabled on the shelf

 

IF no: end script

 

once you can help me write a rough draft, i can interchangably rename the linked item and dummy item for the other items (since there are 3 elder scrolls and 7 black books) so there should be in the end 10 scripts almost exactly the same but with a different item and dummy item reference. I am asking for help because I am unfamiliar with papyrus ans skyrims scripting engine. Thank you for the help.

Link to comment
Share on other sites

Lord of Nyrin,

 

You can use a boolean (bool) to track if the scroll's placement

and use an elder scroll static in the display

 

script extends object reference

bool property placed auto

{placement tracker}

actor property playerRef auto

{best way to refer to player}

book property myScroll auto

{the obtainable elder scroll}

objectReference property scrollRef auto

{the static scroll in the case}

 

bool placed = false ; false by default

 

Event onActivate(ObjectReference akActionRef)

if placed == false

placed = true ; switches the bool

playerRef.removeitem(myScroll)

scrollRef.enable()

elseif placed == true

placed = false

player.additem(myScroll)

scrollRef.disable()

endif

endEvent

 

You may want to also block activation of the triggerbox, states may be the best option for that. Take a look at the scripts attached to the Dragon Priest busts in Labyrinthian, they are a good example of how to accomplish this.

 

EDIT: above is a very specific way to do it, another option would be to place an xmarker in each case, and have the script remove the book from the player, and then use the placeatme function to place the book at the xmarker. As far as messages go, there is a pretty good guide to message boxes on the Creation Kit Wiki http://www.creationkit.com/Options_Menu

Edited by edhelsereg
Link to comment
Share on other sites

Hey bleakraven.

 

I found a script by IsharraMeradin who granted permission to me

personally and also on the Nexus website to use as

public domain.

 

He allowed me to do the tutorial.

It happens to be waiting for moderator approval to be posted.

 

He did exactly what you are doing.

 

Nexus is painstakingly too long to get it from his page.

But I can email it or you can wait for a moderator to post it.

Edited by Ashenfire
Link to comment
Share on other sites

Lord of Nyrin.

 

 

I made a potion shelf display that copied the bookshelves way of detecting if an item is on the player and removing it.

 

I had to make my own keywords and change the script to accept them.

 

You might be able to replace script variables to point to your items like the boots or scrolls.  You just find the

reference to the book activator and dummybook and create a 'bootactivator' and a 'blackdummyboot'.

 

You just rename the MaxPotionsAllowed to MaxBlkBootsAllowed, find all references pointing to it and changing it.

 

Well there is more, but this should be a start.  This is what I did to make potions display in cases, well beyond the

amount a bookshelf can handle.

Link to comment
Share on other sites

In my mod, the Leveler's Tower, is a display room. It does exactly what you are looking for.

Your free to use anything from my mods that is not credited to somebody else.

http://www.nexusmods.com/skyrim/mods/14152/?

i will take a look into your mod and see what you did. i wanted to use the removeitem and additem command to get around quest-locked items and i wanted to use a bool that looks for a "dummy" item on the shelf so i would not need a container to put the actual item in, instead it would just turn off/on the dummy item and additem/removeitem the actual item depending on the circumstance. dummy book on shelf -> add actual book to players inv -> remove dummy book from shelf

Link to comment
Share on other sites

If your trying to avoid the 'quest' related bug, look at the way I do the displays.

I remove the item to a 'holding' chest so the objects retain their quest flags. I then take the items back from the holding chest when removed from display.

In this way, the quest status of objects is retained.

 

You also do NOT need to use the bool to see if the item is on the shelf. You can check the 'enable/disable' status of the displayed static object to determine if the object is on display or not. I did this also.

  • Upvote 1
Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

could someone please check my script? It is meant to be an alternative way of buying House Upgrades (only alchemy and child room so far) through a Ledger in the house. I am a complete noob at papyrus, so this is mostly crated through the system: find similar to what I want / copy / paste / edit. Therefore, I have no idea if it is even close to a functional script. Thank you!

Scriptname ASTbhLedger extends ObjectReference  

;Properties / Variables

Message Property ASTbhLedgerM Auto   
MiscObject Property Gold  Auto  
ObjectReference Property ASTalchRoomStart  Auto  
ObjectReference Property ASTalchRoomNew  Auto  
ObjectReference Property ASTchildRoomNew  Auto   

;Main Code

Event OnActivate(ObjectReference akActionRef)
	Menu()
EndEvent

Function Menu(Bool abMenu = True, Int aiButton = 0)
	While abMenu
		If aiButton != -1 ; Wait for input (this can prevent problems if recycling the aiButton argument in submenus)
			aiButton = ASTbhLedgerM.Show() ; Buy Upgrade
			abMenu = False ; End the function
			If aiButton == 0 ; Cancel
				
			ElseIf aiButton == 1 ; Alchemy/Enchanting Room (500)
				If (ASTalchRoomNew.IsEnabled())
					debug.notification("Upgrade already bought")
				ElseIf (Game.GetPlayer().GetItemCount(Gold001) >= 500)
					Game.GetPlayer().RemoveItem(Gold001,500,False)
					ASTalchRoomNew.enable()
					ASTalchRoomStart.disable()
					debug.notification("Alchemy and Enchanting Room bought")
				Else
					debug.notification("500 gold required")
				EndIf
			ElseIf aiButton == 2 ; Children Room (250)
				If (ASTchildRoomNew.IsEnabled())
					debug.notification("Upgrade already bought")
				ElseIf (Game.GetPlayer().GetItemCount(Gold001) >= 250)
					Game.GetPlayer().RemoveItem(Gold001,250,False)
					ASTchildRoomNew.enable()
					debug.notification("Children Room bought")
				Else
					debug.notification("250 gold required")
				EndIf
			EndIf
		EndIf
	EndWhile
EndFunction
Link to comment
Share on other sites

Hey gents. I need help with my mod. A npc I created was suppose to stay in the bound captive animation or at least that what I want but when ever that npc gets hit, or a fight breaks out nearby he moves and breaks the animation. I also seen the enemy npc switch places with him. If anyone can help I'd appreciate it a lot.

Link to comment
Share on other sites

I am trying to make a simple toggle for magic effects. I am trying to make the effect dispel when I press a button. I can get the script to compile. However, ingame, the magic effect is immediately dispelled instead of when a button is pressed for a second time.

 

Here is what I have so far.

 

Scriptname CoreyOnActorAction extends activemagiceffect

MagicEffect Property Effect auto

 

 

Event OnInit()

      If Game.GetPlayer().HasMagicEffect(Effect)

            Dispel()

            Debug.MessageBox("Effect Off")

      Else

            Debug.Notification("Effect On")

EndIf

EndEvent

 

Any help would be greatly appreciated.

 

Edit***

 

Figured it out: It was very difficult. It seemed so easy at first. The way I was doing it at first would activate the effect and then immediately disable. Not really a toggle that I was looking for. To make the toggle work, I needed a script. The only script that I could use would be scripts to add and remove a spell. I couldn’t find a script on the Wiki that would add an effect.

 

 

So I needed 2 magic effects and 2 spells. The second effect/spell would add the first with a script.

 

1. Create desired magic effect and set it be CONSTANT under CASTING TYPE.

2. Create a spell, add first created magic effect to effects list and set it to ABILITY under TYPE.

3. Create another magic effect. Set EFFECT ARCHETYPE to SCRIPT

4. Create another spell. Add the second created effect to the effects list.

 

*****************************************************************************

Add this script to the second created magic effect:

*****************************************************************************

 

Scriptname YourScriptName extends activemagiceffect 

 

Spell Property YourSpell auto

 

Event OnEffectStart(Actor Target, Actor Caster)

            If(Target.HasSpell(YourSpell))

                        IF Target.RemoveSpell(YourSpell)

                                    ;Debug.Notification("Effect Off")

                                    ;{Testing purposes to see if it is working.}

                        EndIf

            Else

                        Target.AddSpell(YourSpell)

                                    ;Debug.Notification("Effect On")

                                    ;{Testing purposes to see if it is working.}

            EndIf

EndEvent

Edited by ksurles13
Link to comment
Share on other sites

So I'm having some trouble with this script. Essentially I want a boss to be essential (not killable) until you get it to very low health and he yields, and is then set to not essential after his yield dialogue so the player can then kill him. 

 

It seems like it should be something like:

 

Scriptname MyScript extends Actor

MyActor property Actor Auto

 

Myactor.SetEssential(false)

Link to comment
Share on other sites

  • 1 month later...

I would like a script that when a player enters a room the container checks if contains x amount of every item it contained originally. if there IS x or more of the currently check item it does nothing but if there IS LESS than x then it adds (x - amount of the currently checked item) to the container. It needs to check ALL the items in the container.

Thanks  A Lot :salute:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...