Jump to content

Need some scripting help (Courier's Stash Selector / Integration mods)


Swanky

Recommended Posts

Posted

€Edit: I posted this again in the 101 scripting help thread (pinned) since it seems more appropriate for answering the question. Depending on forum rules I would like to ask to delete this topic.

 

Hey,

 

some time ago I found out about these two nice little immersion mods that both work with the Courier's stash preorder items. Now thinking it might be a nice little idea to not run into the Mojave with just my pants on AND giving every bandit this side of Vegas the same chance of items, I installed BOTH. Which kinda worked - only the items are not distributed to the character afterwards, because both are using the same base script. Now I've tried and merge those two somehow... but I am not a scripter, coder... so... yes it didn't work, obviously.

Then I looked at it some more and found the original selection script. It might be a nice idea to integrate the distribution of the items at the end of the selection (all of them, however, not just the selected items), but I do not know how this might be done. This is where I would like to have someone else look onto it and say: "this is how you have to do it" or in the best case scenario, say: "piece of cake, here you go."

This might be potentially interesting for other people, too.

 

 

Yukichigai's Selector Script

 

scn NVDLC00SelectorQuestSCRIPT

short DoStatus ;// Tracks where we are in the dialogue

short CaravanStatus
short ClassicStatus
short MercenaryStatus
short TribalStatus

short numDLC

short Button

Begin GameMode

    if DoStatus == 0

        ;//== Disable every DLC pack by default just so we don't get interrupted

        set VDLCPackQuest.bCaravanItemsGiven to 1
        set VDLCPackQuest.bClassicItemsGiven to 1
        set VDLCPackQuest.bMercenaryItemsGiven to 1
        set VDLCPackQuest.bTribalItemsGiven to 1

        set VDLCPackQuest.bCaravanUninstalled to -1 ;// Used to indicate to other mods that the load list has been modified, i.e. they shouldn't just re-enable everything

        SetQuestDelay NVDLC00SelectorQuest 1 ;// Add a delay

        set DoStatus to 1

    elseif DoStatus == 1 && VDLCPackQuest.bClassicUninstalled != -1 ;//== Unofficial way of tagging the Pre-order DLCs as disabled/do not activate now

        ;//== See what DLC Packs are installed
        ;//=== Actually, the IsDLCInstalled function doesn't work.  Skip this for now
        ;if (IsDLCInstalled "Caravan Pack")
        ;    set numDLC to 1
        ;else
        ;    set CaravanStatus to -1
        ;endif

        ;if (IsDLCInstalled "Classic Pack")
        ;    set numDLC to (numDLC + 1)
        ;else
        ;    set ClassicStatus to -1
        ;endif

        ;if (IsDLCInstalled "Mercenary Pack")
        ;    set numDLC to (numDLC + 1)
        ;else
        ;    set MercenaryStatus to -1
        ;endif

        ;if (IsDLCInstalled "Tribal Pack")
        ;    set numDLC to (numDLC + 1)
        ;else
        ;    set TribalStatus to -1
        ;endif

        ;//== Hackify it
        set numDLC to 4

        if numDLC > 1 ;// Show the selection message
            Set DoStatus to 2
            SetQuestDelay NVDLC00SelectorQuest 0.1 ;//Undo the delay for the menu
            ShowMessage NVDLC00SelectorMessage CaravanStatus ClassicStatus MercenaryStatus TribalStatus
        else ;// Not enough DLC installed to select anything, so lets quit
            StopQuest NVDLC00SelectorQuest
        endif

    elseif DoStatus == 2 ;// Loop for the menu
        set Button to GetButtonPressed

        if Button == 1 ;// Toggle Caravan
            set CaravanStatus to (CaravanStatus == 0)
        elseif Button == 2 ;// Toggle Classic
            set ClassicStatus to (ClassicStatus == 0)
        elseif Button == 3 ;// Toggle Mercenary
            set MercenaryStatus to (MercenaryStatus == 0)
        elseif Button == 4 ;// Toggle Tribal
            set TribalStatus to (TribalStatus == 0)
        elseif Button == 5 ;// Enable all

            if CaravanStatus > -1
                set CaravanStatus to 1
            endif

            if ClassicStatus > -1
                set ClassicStatus to 1
            endif

            if MercenaryStatus > -1
                set MercenaryStatus to 1
            endif

            if TribalStatus > - 1
                set TribalStatus to 1
            endif
        elseif Button == 6 ;// Disable all
            if CaravanStatus > -1
                set CaravanStatus to 0
            endif

            if ClassicStatus > -1
                set ClassicStatus to 0
            endif

            if MercenaryStatus > -1
                set MercenaryStatus to 0
            endif

            if TribalStatus > - 1
                set TribalStatus to 0
            endif
        else ;// Catch-all, exit the menu
            set DoStatus to 3
        endif

        if DoStatus != 3 ;// If the loop is still enabled, show the message again
            ShowMessage NVDLC00SelectorMessage CaravanStatus ClassicStatus MercenaryStatus TribalStatus
        endif

    elseif DoStatus == 3 ;// Menu done

        ;//== Enable the appropriate items based on our choices
        set VDLCPackQuest.bCaravanItemsGiven to (CaravanStatus == 0)
        set VDLCPackQuest.bClassicItemsGiven to (ClassicStatus == 0)
        set VDLCPackQuest.bMercenaryItemsGiven to (MercenaryStatus == 0)
        set VDLCPackQuest.bTribalItemsGiven to (TribalStatus == 0)

        set VDLCPackQuest.bCaravanUninstalled to -1 ;// Used to indicate to other mods that the load list has been modified, i.e. they shouldn't just re-enable everything

        ShowMessage NVDLC00SelectorDoneMSG

        ;//== Stop the quest
        StopQuest NVDLC00SelectorQuest
    endif

End

 

 

TheSilenced Integration Scripts

 

ScriptName VPreorderCaravanSCRIPT

short DoOnce
int iRighttoArmBearsLoaded
int iRighttoArmBearsLoadedAlt
int iCount
int iIndex
int iRef
ref rRef
BEGIN GameMode
    if (DoOnce != 0)
        set DoOnce to 0
        set iRighttoArmBearsLoaded to 0
    endif
    if IsModLoaded "GRA - The Right to Bear Arms.esp"
        set iRighttoArmBearsLoaded to 1
    endif
    if IsModLoaded "GRA - The Right to Bear Arms -Vendors Untouched.esp"
        set iRighttoArmBearsLoadedAlt to 1
    endif
    if (DoOnce == 0)
    ; Add items to formlists
        ; Shotgun
        AddFormToFormList Everything WeapPreordCaravanShotgun;
        AddFormToFormList NVAllWeapons WeapPreordCaravanShotgun;
        AddFormToFormList WeaponListRangedALL WeapPreordCaravanShotgun;
        AddFormToFormList ShotgunSurgeonWeaponsList WeapPreordCaravanShotgun;
        AddFormToFormList RepairNVCaravanShotgun WeapPreordCaravanShotgun;
        ; Armor
        AddFormToFormList Everything PreordArmorLeather;
        AddFormToFormList RepairLeatherArmor PreordArmorLeather;
    ; Add items into the world
        ; Armor
        if (iRighttoArmBearsLoaded == 0)
            AddItemToLeveledList CondLeatherArmor PreordArmorLeather 1 1 35;
            AddItemToLeveledList CondLeatherArmor PreordArmorLeather 1 1 25;
        elseif (iRighttoArmBearsLoaded == 1 || iRighttoArmBearsLoadedAlt == 1)
            if iRighttoArmBearsLoaded == 1
                set iIndex to GetModIndex "GRA - The Right to Bear Arms.esp"
            endif
            if iRighttoArmBearsLoadedAlt == 1
                set iIndex to GetModIndex "GRA - The Right to Bear Arms -Vendors Untouched.esp"
            endif

            set iCount to 0
            Label 1
            set iCount to iCount + 1
            if iCount <= 1
                if iCount == 1
                    set iRef to 20167    ;aagCondLeatherArmor
                endif
                ; Piece together FormID
                set rRef to BuildRef iIndex iRef

                if iCount == 1
                    AddItemToLeveledList rRef PreordArmorLeather 1 1 25
                    AddItemToLeveledList rRef PreordArmorLeather 1 1 35
                endif

                Goto 1
            endif
        endif
        ; Shotgun
        AddItemToLeveledList CondNVCaravanShotgunLoot WeapPreordCaravanShotgun 8 1 45;
        AddItemToLeveledList CondNVCaravanShotgunLoot WeapPreordCaravanShotgun 13 1 50;
    ; Confirm items have been "Given"...
        set VDLCPackQuest.bCaravanItemsGiven to 1;
        set DoOnce to 1;
        printc "Caravan Pack Intigrated"
    endif
    if (VDLCPackQuest.bCaravanItemsGiven == 1 && DoOnce == 1)
    ; ...and stop script from running again.
        Stopquest VPreorderCaravan
    endif
END

 

 

ScriptName VPreorderClassicSCRIPT

short DoOnce

BEGIN GameMode
    if (DoOnce != 0)
        set DoOnce to 0
    endif
    if (DoOnce == 0)
    ; Add to Formlists
        ; Armor
        AddFormToFormList Everything PreordArmorVault13Armored;
        AddFormToFormList RepairVaultSuit PreordArmorVault13Armored;
        ; Canteen
        AddFormToFormList Everything PreordVaultCanteen;
        ; Pistol
        AddFormToFormList Everything WeapPreord10mmPistol;
        AddFormToFormList Repair10mmPistol WeapPreord10mmPistol;
        AddFormToFormList NVAllWeapons WeapPreord10mmPistol;
        AddFormToFormList WeaponListRangedALL WeapPreord10mmPistol;
        AddFormToFormList NVImprovedHoldoutWeapons WeapPreord10mmPistol;
        AddFormToFormList TheProfessionalWeaponsList WeapPreord10mmPistol;
    ; Add items into the world
        ; Pistol
        AddItemToLeveledList Cond10mmPistolLoot WeapPreord10mmPistol 10 1 50;
        AddItemToLeveledList Cond10mmPistolNPC WeapPreord10mmPistol 1 1 70;
        AddItemToLeveledList Cond10mmPistolRaider WeapPreord10mmPistol 1 1 40;
        ; Canteen
        SarahVendorChestREF.AddItem PreordVaultCanteen 1 1;
        ; Armor
        SarahVendorChestREF.AddItem PreordArmorVault13Armored 1 1;
    ; Confirm items have been "Given"...
        set VDLCPackQuest.bClassicItemsGiven to 1
        set DoOnce to 1;
        printc "Classic Pack Intigrated"
    endif
    if (VDLCPackQuest.bClassicItemsGiven == 1 && DoOnce == 1)
    ; ...and stop script from running again.
        Stopquest VPreorderClassic
    endif
END

 

 


ScriptName VPreorderMercenarySCRIPT

short DoOnce
int iCount
int iIndex
int iRef
ref rRef


BEGIN GameMode
    if (DoOnce != 0)
        set DoOnce to 0
    endif
    if (DoOnce == 0)
    ; Add to Formlists
        ; Armor
        AddFormToFormList Everything  PreordArmorMetal;
        AddFormToFormList RepairMetalArmor PreordArmorMetal;
        AddFormToFormList NVTravelLightBadArmorList PreordArmorMetal;
        ; Grenade Rifle
        AddFormToFormList Everything WeapPreordGrenadeRifle;
        AddFormToFormList NVAllWeapons WeapPreordGrenadeRifle;
        AddFormToFormList WeaponListRangedALL WeapPreordGrenadeRifle;
        AddFormToFormList ExplodesGasTrapsOnHit WeapPreordGrenadeRifle;
        AddFormToFormList PerkDemolitionExpertWeapons WeapPreordGrenadeRifle;
        AddFormToFormList RepairNVGrenadeRifle WeapPreordGrenadeRifle;
    ; Add items into the world
        ; Armor
        AddItemToLeveledList CondMetalArmor PreordArmorMetal 1 1 35
        AddItemToLeveledList CondMetalArmor PreordArmorMetal 1 1 45
        ; Grenade Rifle
        AddItemToLeveledList CondNVGrenadeRifleLoot WeapPreordGrenadeRifle 5 1 40
        AddItemToLeveledList CondNVGrenadeRifleLoot WeapPreordGrenadeRifle 10 1 50
        ; DLC Support
            if IsModLoaded "DeadMoney.esm"
                set iIndex to GetModIndex "DeadMoney.esm"
                set iCount to 0
                Label 1
                set iCount to iCount + 1
                if iCount <= 1
                    if iCount == 1
                        set iRef to 61973    ;NVDLC01ArmorVsBeamTorso
                    endif
                    ; Piece together FormID
                    set rRef to BuildRef iIndex iRef

                    if iCount == 1
                        AddFormToFormList rRef PreordArmorMetal
                    endif

                    Goto 1
                endif
            endif
            
            if IsModLoaded "HonestHearts.esm"
                set iIndex to GetModIndex "HonestHearts.esm"
                set iCount to 0
                Label 2
                set iCount to iCount + 1
                if iCount <= 1
                    if iCount == 1
                        set iRef to 63094    ;NVDLC02PerkGruntWeapons
                    endif
                    ; Piece together FormID
                    set rRef to BuildRef iIndex iRef

                    if iCount == 1
                        AddFormToFormList rRef WeapPreordGrenadeRifle
                    endif

                    Goto 2
                endif
            endif
        
    ; Confirm items have been "Given"...
        set VDLCPackQuest.bMercenaryItemsGiven to 1;
        set DoOnce to 1;
        printc "Mercenary Pack Intigrated"
    endif
    if (VDLCPackQuest.bMercenaryItemsGiven == 1 && DoOnce == 1)
    ; ...and stop script from running again.
        stopquest VPreorderMercenary
    endif
END

 

 

ScriptName VPreorderTribalSCRIPT

short DoOnce
int iCount
int iIndex
int iRef
ref rRef


BEGIN GameMode
    if (DoOnce != 0)
        set DoOnce to 0
    endif
    if (DoOnce == 0)
    ; Add to Formlists
        AddFormToFormList Everything WeapPreordMachete;
        AddFormToFormList NVAllWeapons WeapPreordMachete;
        AddFormToFormList WeaponListMeleeALL WeapPreordMachete;
        AddFormToFormList VPoisonWeapons WeapPreordMachete;
        AddFormToFormList RepairNVMachete WeapPreordMachete;
    ; Add items into the world
        AddItemToLeveledList CondNVMacheteLoot WeapPreordMachete 3 1 55
        ; DLC Support
            if IsModLoaded "HonestHearts.esm"
                set iIndex to GetModIndex "HonestHearts.esm"
                set iCount to 0
                Label 1
                set iCount to iCount + 1
                if iCount <= 1
                    if iCount == 1
                        set iRef to 71469    ;NVDLC02DaturaPoisonWeapons
                    endif
                    ; Piece together FormID
                    set rRef to BuildRef iIndex iRef

                    if iCount == 1
                        AddFormToFormList rRef WeapPreordMachete
                    endif

                    Goto 1
                endif
            endif
            
            if IsModLoaded "GunRunnersArsenal.esm"
                set iIndex to GetModIndex "GunRunnersArsenal.esm"
                set iCount to 0
                Label 2
                set iCount to iCount + 1
                if iCount <= 3
                    if iCount == 1
                        set iRef to 2647    ;NVDLC05ChallengeArmedForBearWeapons
                    elseif iCount == 2
                        set iRef to 2624    ;NVDLC05ChallengeWhiteLineNightmareWeapons
                    elseif iCount == 3
                        set iRef to 2639    ;NVDLC05ChallengeYouDontBelongWeapons
                    endif
                    ; Piece together FormID
                    set rRef to BuildRef iIndex iRef

                    if iCount == 1
                        AddFormToFormList rRef WeapPreordMachete
                    elseif iCount == 2
                        AddFormToFormList rRef WeapPreordMachete
                    elseif iCount == 3
                        AddFormToFormList rRef WeapPreordMachete
                    endif

                    Goto 2
                endif
            endif
        
        ; Confirm items have been "Given"...
        set VDLCPackQuest.bTribalItemsGiven to 1;
        set DoOnce to 1;
        printc "Tribal Pack Intigrated"
    endif
    if (VDLCPackQuest.bTribalItemsGiven == 1 && DoOnce == 1)
    ; ...and stop script from running again.
        stopquest VPreorderTribal
    endif
END

 

 

Thanks for your continued time and help! o/

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...