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...

Need help with two scripts


Xxbtztrl
 Share

Recommended Posts

Hello and thank you for reading,

   I am new to scripting and I can't for the love of me figure out how to make a script to accomplish a simple feature. Pretty much all I am trying to do is attach a script to an activator - ImpButton01 and make it so that when the player interacts with it, a message box will pop-up and it asks if the player would want to either refill bottles or cancel. I am trying to make a compatibility patch with a mod iNeed. If the player chooses to refill bottles, the script checks how many empty bottles the player has and replaces them with filled bottles with the exact same amount.

Scriptname HMSinkiNeed extends ObjectReference  



Message Property HMSinkQuestion  Auto  
{Ask to drink or not}

Message Property HMSinkRefill  Auto  
{Refills all waterskins}

Message Property HMSinkCancel  Auto  
{Decide to not do anything}

MiscObject Property _SNWaterskin_0  Auto
AlchObject Property _SNWaterskin_3  Auto

int Button

EVENT onActivate(objectReference akActionRef)

    If akActionRef == Game.GetPlayer()
        Button = HMSinkQuestion.show() ; Dialogue prompt
        if Button == 0 ; Button for refilling containers
            HMSinkRefill.show()
            int GetItemCount(item)
            if GetItemCount > 0
                Game.GetPlayer().RemoveItem(_SNWaterskin_0, GetItemCount, true)
                Game.GetPlayer().AddItem(_SNWaterskin_3, GetItemCount, true)
            elseif GetItemCount == 0
                Debug.Notification("I don't have any empty waterskins")
            endif
        elseif Button == 1 ; Button canceling prompt
            HMSinkCancel.show()
        endif
    ENDIF
endEVENT



Second script, is it possible to make light fade adjustable by messagebox from interacting an activator?

Am I doing it right or at least close? lol, the compiler keeps failing to save and I have no clue how to properly write this script, any help will be appreciated. :biggrin:

Edited by Xxbtztrl
Link to comment
Share on other sites

@ladyonthemoon
C:\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\HMSinkiNeed.psc(23,19): required (...)+ loop did not match anything at input '('
No output generated for HMSinkiNeed, compilation failed.

@schatten
Yeah I think I didn't include Game.GetPlayer(), how would I add it to my script correctly?

Link to comment
Share on other sites

;)

You should do it like this

instead of

            int GetItemCount(item)

do

            int getitemcount

            getitemcount = game.getplayer().GetItemCount(item)

 

Also what is item? You didn't declare in the script what an item is. Or I am blind lol :D Replace "item" with the item you want to count.

  • Upvote 1
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...