Jump to content

I would like to learn to how to edit a perk magazine


Recommended Posts

Good evening,

 

I'm trying to create a mod for the first time. I wanted to take a crack at editing Wasteland Survival #05. I have a little bit of experience modding games, but I don't have a computer programming background.

 

These are the things I want to do:

 

  1. Additional locations the magazine adds to your map.
  2. Put a note in the player's inventory.
  3. Give the player a discount when purchasing Home Plate.

 

I'm finding it difficult to find tutorials on how to do something like this. All the tutorials I come across are either about how to install and run FO4Edit or the Creation Kit; or, how to do simple edits like change the damage, weight, and value of a weapon.

 

 

My first question is whether I should use the Creation Kit, FO4Edit, or both? Do I need to learn Papyrus to do what I want to do with this magazine?

 

According to this individual, who also tried to edit Wasteland Survival 05:

 

https://www.reddit.com/r/FalloutMods/comments/p91i6y/fo4_help_marking_a_location_on_the_map/

 

They had to use both programs, but conceded it may be possible to do with the Creation Kit only. Do you have to use both programs or can you just use one? If so, which one would be better to use?

 

 

According to this mod author, who edited Wasteland Survival 05 to give the player a discount at Diamond City vendors:

 

https://www.nexusmods.com/fallout4/mods/59164

 

They only used FO4Edit.

 

 

This mod author, who edited the magazine to add multiple locations, did not specify how they did it.

 

https://www.nexusmods.com/fallout4/mods/26367

 

I looked at this mod through both the Creation Kit and FO4Edit and don't quite understand how they did it. The most I can gather is they added the commands to add map markers to the PerksQuest section, but I don't quite understand the coding they used for the other locations.

 

 

So far, I have found the following:

  • PerksQuest -- this is where I found the scripts for Wasteland Survival 05 adding Diamond City to your map and Robco Fun adding a holotape to your inventory. It seems that the second mod author I highlighted edited this when adding the other locations that get added to the player's map.
  • Quest 1070 -- This adds the hidden perk to your character that marks Diamond City on your map. Can or should anything be done with this?
  • ServiceCostBuyHouse -- This has the value of Home Plate. Will however I edit the magazine include some sort of code that will edit this value? If so, I hope it will be easy to find or figure out.
  • game.GetPlayer().Additem ( . . . . .) -- This appears to be the command to add an item to the player's inventory. Is it as simple as adding this command to PerksQuest? And fill out the ". . . ." with the name I give to the note that will be added to the player's inventory?
  • DiamondCityMapMarkerRef.AddToMap() -- This appears to be the command to add the Diamond City marker onto your map. Will all the other locations be just as easy to add? If not, how would I find the rest of these for all the other locations in the game?

 

 

This is all I have come up with so far. If anyone knows of any tutorials that will help me out with this, or can point me in the right direction, I would appreciate it.

 

Have a good day.

Link to comment
Share on other sites

You can put a script on it like this

ObjectReference Property MapMarker1 Auto
ObjectReference Property MapMarker2 Auto

Event OnRead()
MapMarker1.enable()
MapMarker2.enable()
EndEvent

Don't forget to fill out the properties afterwards so you can link it to your map markers

Link to comment
Share on other sites

LOL. I'm the guy in that reddit post you referenced. I'm still learning. I wish I could attach the mod I made for this.

 

I use both CK and FO4Edit but only because I've become very familiar with where things are in FO4Edit. I find it easier to work with for the types of things I mod. It's more intuitive to me. If you just want to use a single program probably go with CK as that's what you'll need to edit / make locations in the world. I mainly only use CK as a method to create & compile scripts I've written as well as quest building. I do have plans to make a custom location but that's still months away. So, 95% of the time I'm on FO4Edit. Reminder, I'm still an idiot.

 

I recommend looking up kinggath and seddon4494 on Youtube. Both have a number of tutorials which go beyond changing the damage of a weapon, armor, etc. I'm sure there are others but these are the two which seem to give me what I'm looking for.

 

I've been programming for 40+ years, I don't know Papyrus but I've found my experience with other languages (Java, C++, C, about a dozen versions of BASIC) is useful. If you're going to make anything other than small scripts then getting a firm handle on Papryrus would probably be helpful. Some of the smaller stuff, like this, you can probably get by with duplicating, reusing, modifying code of Bethesda or other mod authors. You don't necessarily need to 'know' Papyrus to add an item to player inventory.

 

Yes, Home Plate price is located in ServiceCostBuyHouse [GLOB:000D35FA]. You could just simply change the value you want, say 1800 caps. If you wanyed variably discounts added you could probably do this via a script.

 

I've learned an incredible amount by looking at other people's work. Opening up mods in FO4Edit and take a look at how they did stuff. For example, the author in the first mod you listed changing the magazine to give a 10% discount. his mod adds a section to PerkMagWastelandSurvival05, which I believe you've already looked at, which applies the discount to DC merchants. I don't think it counts for Home Plate though.

 

One thing I've learned is scripts need to be passed values from the game to work with them. So, in the case of adding an item, it is halfway as simple as addItem(itemid, count). The ItemId needs to be passed to the script so it knows what the item is. This is just like the adding locations script works as well. The post above mine gives a great example of the form. In the quest which calls this script it would contain information for "mapmarker1" and "mapmarker2". In PerksQuest "Perks Quest" [QUST:0004A09E] , or in a customer quest you write, you'd need to identify each location in the same fashion Diamond City is already identified.

 

EDIT: Go with LarannKiar response. So much better than my rambling mess.

 

I forgot to answer one of your questions, I found the locationRefs by scrolling through the "Location" forms. Most of them have names but some do not. I looked for those with "MapMarkerRefType [LCRT:0002271F]" . The section will contain the locationref, for example Cutler Bend has "CutlerBendMapMarkerRef [REFR:0002BB6A]". I was looking for a specific subset of a couple hundred locations which would normally show up on the map. I don't know if anything special needs to be done with unmarked map locations.

Edited by 42sheep
Link to comment
Share on other sites

Good evening,

 

These are the things I want to do:

 

  1. Additional locations the magazine adds to your map.
  2. Put a note in the player's inventory.
  3. Give the player a discount when purchasing Home Plate.

 

You would need a script to do that. First, find and open the global variable ServiceCostBuyHouse. Uncheck "Constant" and click OK.

 

Then, attach this script to your custom magazine (which has the signiture BOOK). Open your magazine, click Scripts >> Add >> [New Script].

 

Name: YOURSCRIPTNAME

Extends: ObjectReference

Const: checked.

 

The code:

 

 

Scriptname YOURSCRIPTNAME extends ObjectReference Const

Group EditTheseProperties
ObjectReference[] Property MapMarkers Auto Const
{Array of map markers. Add your map markers to this
array in the editor: Script >> Add Property.}

Form Property NoteToAdd Auto Const
{The note you'd like to add to the Player's inventory upon reading
this Book the first time.}

Int Property HomePlateCustomPrice Auto Const
{The new price of Home Plate.}
EndGroup

Group NoEditNeeded
GlobalVariable Property ServiceCostBuyHouse Auto Const
{Default price of Home Plate. It's 2000 Caps.
Don't edit this property just fill it in the script property editor (use Auto-Fill).}
EndGroup


Event OnActivate(ObjectReference akActionRef)		; event: the magazine has been activated (picked up)
	;****************** Add Map Markers ****************** 
	Int Index
	While MapMarkers.Length > Index
		ObjectReference LoopRef = MapMarkers[Index]
		If LoopRef
			If LoopRef.IsDisabled()
				LoopRef.Enable()
			EndIf
			If LoopRef.IsMapMarkerVisible() == False
				LoopRef.AddToMap(abAllowFastTravel = False)		; if you replace "False" with "True", you'll be able to fast travel to the fast travel marker linked to the map marker without "discovering" its location
			EndIf
		EndIf
		Index = Index + 1
	EndWhile
	;****************** Add Note to Player ****************** 
	Game.GetPlayer().AddItem(akItemToAdd = NoteToAdd, aiCount = 1, abSilent = False)			; for more info on akItemToAdd and the others, see: https://www.creationkit.com/fallout4/index.php?title=AddItem_-_ObjectReference
	;****************** Home Plate price ****************** 
	ServiceCostBuyHouse.SetValueInt(HomePlateCustomPrice)                           ; modifies the default price of Home Plate to HomePlateCustomPrice
EndEvent 

 

 

 

Follow the instructions in the script property descriptions.

Edited by LarannKiar
Link to comment
Share on other sites

  • Recently Browsing   0 members

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