Jump to content

making caravan player home. FO4


zax141

Recommended Posts

So I've been working on my first mod, this is inspired by a bus player home I used to use in fallout new vegas.

Any ideas would be greatly appreciated.

 

I guess now would be about right to list completed features and stuff I'm working on:

 

Stuff thats finished:

  • Button controlled Lights.
  • Back story terminal.

 

Stuff that I'm currently working on:

  • Restockable fridge
  • Restockable med/chem shelves
  • Restockable component shelves
  • Place to put terminal, its too large to fit on pre-existing desk.
  • more ambient lights and junk outside.
  • trader NPC that comes by every so often, like Trashcan Carla.
  • more scripted buyable stuff.

 

Stuff that I want to do but have no idea how to do it:

  • Make the reactor on the back of the bus glow and hum.
  • edit bus model to either fix or remove broken windows.
  • use of a terminal to buy things instead of the activator buttons I currently use.
  • Random encounters (Traders, odd raider or two every few weks, ect ect)

 

Now here are some screen shots.

 

 

1.png

 

 

2.png

 

 

3.png

 

 

 

4.png

 

Link to comment
Share on other sites

for a terminal - duplicate one of the default terminals to make your off of.

 

You can add a script that contains all the functions for the terminal in the script section of the terminal screen, It helps to keep from doing repeat coding for each button choice.

 

so say you add this script to the terminal (this is just a example and not meant to be used as a base):

Scriptname sampleitemsTerminalScript extends ObjectReference

struct ItemDetails
    Form[] ItemForSale
    Int[] CostInCaps
    Int[] NumberInStock
EndStruct

ItemDetails[] Property ItemsForSale Auto Const
{list of items for sale on the terminal and how many are in stock}
Message property ItemsOutOfStock Auto Const
{Message that is displayed when items are out of stock}
MiscObject Property Caps001 Auto Const
{the currency used, can be autofilled for Caps to be used}

Function BuyItem(int ItemNum)
   if (ItemsForSale[ItemNum].NumberInStock > 0)
      Debug.Notification("We have items to sell")
      ;do something... (sample sale)
      Game.GetPlayer().RemoveItem(Caps001, ItemsForSale[ItemNum].CostInCaps) ;remove caps from player
      Game.GetPlayer().Additem(ItemsForSale[ItemNum].ItemForSale, 1) ;add the item for sale to player
      ItemsForSale[ItemNum].NumberInStock -= 1  ;reduce the number in stock by 1
   else
      Debug.Notification("We Don't have any to sell")
      ;do something...
      ItemsOutOfStock.Show() ;pops the message up on the screen saying its out of stock.
   EndIf
EndFunction

then on the terminal, add a option in Menu Options, and for its papyrus fragment add a line reading:

(akTerminalRef as sampleitemsTerminalScript).BuyItem(1)

When the menu option is selected it will access the script attached to the activating terminal (the one placed in the cell) and execute BuyItem(1). duplicate for each item changing the buyitem(1) to match the # of the item they can buy from that menu choice. akTerminalRef will always be the main terminal that was activated.

 

Now this was just a quick and dirty example of how to do it, if you'd like to see a more advanced one, that a submenu can access variables from the main terminal, look at the bookreturn terminal and its scripts, on the sub terminals (like the DN011OverdueBookVendSubTermItem01) look at the conditions to see how it can access varables on the script for the main terminal in order to decide which menu item to display.

 

On the main terminal (DN011OverdueBookVendTerminal) the two functions to look at here would be CanBuyItem and TryToBuyItem, CanBuyItem does a check only and sets up the variables for the "are you sure" terminal (termitem01 above), and TryToBuyItem is the function that allows the player to buy the item from the terminal which is called on termitem01.

 

P.s. Nice little home, if you placed it on one of the routes the traders take, they'll wander by every so often, getting them to stop at your location, thats a totally different thing all together, quest controlled for their movement between the different trade routes.

Edited by caleb68
Link to comment
Share on other sites

for a terminal - duplicate one of the default terminals to make your off of.

 

You can add a script that contains all the functions for the terminal in the script section of the terminal screen, It helps to keep from doing repeat coding for each button choice.

 

so say you add this script to the terminal (this is just a example and not meant to be used as a base):

 

SNIP.

 

P.s. Nice little home, if you placed it on one of the routes the traders take, they'll wander by every so often, getting them to stop at your location, thats a totally different thing all together, quest controlled for their movement between the different trade routes.

 

 

Thanks that code isn't exactly what I'm looking for but would be really easy to edit and use for what I mean.

By the sale of items, I mean enabling static items.

And I already have a simple script setup to enable a custom NPC, which is set to walk upto the caravan.

Just need to make the npc and setup the inventory.

 

Also, though this is not the first time I've tried my hand at programming.

This is my first time every using papyrus.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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