Stardew Valley
0 of 0

File information

Last updated

Original upload

Created by

SnowFire kVala

Uploaded by

Ambedrake

Virus scan

Safe to use

Tags for this mod

About this mod

This mod allows for warp configuration files to be created and loaded at the start of the game, it also doubles as a library for use in my other mods. Currently it accepts .warp and .roam files (though manual import is possible via command line), and a number of related console commands.

Requirements
Permissions and credits
Changelogs
Donations
Summary
This mod allows for warp configuration files to be created and loaded at the start of the game, it also doubles as a library for use in my other mods. Currently it accepts .warp and .roam files (though manual import is possible via command line), and a number of related console commands.

Installation
Extract the folder in the zip file to your Mods folder

Usage

Configuration
Run the game once with the mod installed for a default config file to be added to the folder, by default there are no folders added to the detection list to protect against issues. Once it is created, add the folders you want to look for warps in to the "CustomWarpFolders" array as strings and make sure that the folder exists inside of this mods folder. Place any .warp/.roam files you have inside the folders as you please and they will be loaded at run time.

Warp Files

Warp files are just text files that have an extension of .warp for a standard warp, or .roam for a roaming warp. These files contain a JSON representation of a warp to register, with the roaming type being considerably more complicated. Below in the Example file contents you can see the structure between the two are considerably different, and while you can technically get set a roaming warp to behave like a standard warp, the standard warp consumes considerably less processing time so is recommended for any single point to point warps you want to add.

NOTE: v.1.0.0 Warp files ARE NOT compatible with v.1.1.0 due to expansions made to the warp system

Warp File Parameters
Shared Parameters
ID (String):
This is the name of the warp and is useful when attempting to make changes via the command line arguments or debugging.
CooldownInSeconds (Integer):
This is the amount of seconds required to pass between warps, please do not set below 2.
SelfDeleteFile (Boolean):
This will mark the file to self destruct once depleted. This requires OneTimeUse set to true, roaming warps will delete on depletion of Origin or Target locations.
NPCUseAllowed (Boolean):
Future use, this will flag a warp as able to be triggered by an NPC

Standard Only Parameters
OriginVector (String):
A string with 2 comma separated integers, this sets the X and Y of the Origin. (Trigger tile)
OriginMap (String):
The map name for the Origin coordinates.
OriginRotation (Integer 0<=n<=3):
Future Use, the rotation required to trigger the warp.
TargetVector (String):
A string with 2 comma separated integers, this sets the X and Y of the Target.
TargetMap (String):
The map name for the Target coordinates
TargetRotation (Integer 0<=n<=3):
The rotation of the player after warping.

Roaming Only Parameters
OriginLocations (Object):
A set of locations that this warp can originate at.
TargetLocations (Object):
A set of locations that this warp can target.
StartingOriginID (String):
The ID of the origin warp to start with when the game loads.
StartingTargetID (String):
The ID of the target warp to start with when the game loads.
OriginRoamingPattern (Pattern Enum):
The shift pattern to apply to the origin roaming mechanics.
TargetRoamingPattern (Pattern Enum):
The shift pattern to apply to the target roaming mechanics.

Roaming Locations
Key (String):
The key should match the locations ID
ID (String):
This locations ID string, Origin and Target locations can have the same key with out interference.
Location (String):
A string with 2 comma separated integers, this sets the X and Y of the location.
Map (String):
The locations Map name
Rotation (Integer 0<=n<=3):
The rotation of the character for this location, this currently only effects Target locations but is required for both entry types.
OneTimeUse (boolean):
Sets this location as one time use, if true the system will dynamically disable this location after being used once. For self destructing files either all Origin or all Target locations will be required to be marked as one time use.

Roaming Pattern Enums
RANDOM,
LINEAR_REPEAT,
LINEAR_SINGLE,
LINEAR_SKIP_1,
LINEAR_SKIP_2,
ALPHABETICAL,
ALPHABETICAL_SINGLE,
ALPHABETICAL_REVERSE,
ALPHABETICAL_REVERSE_SINGLE,
STATIC

Commands
A number of commands have been entered into the game, the commands themselves as well as their descriptions can be set in the i18n language file. This assists in ensuring that commands and usage data makes sense in a localized way, as well as allowing users to define the trigger commands in order to avoid conflicts with other mods.

Command Types Included:

Get Warp Dictionary as Json:
Converts the current warp dictionary into a JSON string to the console

Load Warp File:
Loads a single warp file

Load Warp Json:
Loads a json string written into the console as a warp (Ad Hoc Warps)

Get Player Location:
Gets the players tile X, Y, and Map. Currently attempts to get rotation but rotation does not fully function yet.

Get Game Locations:
Gets a list of map names that are not indoors. Useful for writing warp files, especially if you need to be able to use a map editor to find certain coordinates.

Export Warp File:
Allows for a warp in the warp dictionary to be exported to a generated warp file.

Reload Warps:
Clears the warp dictionary and reloads all warps from currently existing warp files.

Sync With Host:
(v.1.2.4)
Forces the client to resync the warp dictionary with the host, commonly used if the host has manually edited the warp dictionary in any way or if the client has desynchronized for any reason such as major lag spikes at the exact same time as a warp being triggered.


Conclusion

This mod was made to support another set of projects that I am working on, but as it is simple and useful I figured I would share it with others.

Warp File Content Examples

Example .warp File contents:


{
"ID":"DemoWarpStandard_SVE",
"CooldownInSeconds":5,
"SelfDeleteFile":false,
"NPCUseAllowed":false,
"OneTimeOnly":false,
"OriginVector":"72, 12",
"OriginMap":"Farm",
"OriginRotation":2,
"TargetVector":"60, 15",
"TargetMap":"Farm",
"TargetRotation":2
}


Example .roam File contents:


{
"ID":"DemoWarpRoaming_SVE",
"CooldownInSeconds":5,
"SelfDeleteFile":false,
"NPCUseAllowed":false,
"OriginLocations":{
"RightUpperTrail":{
"ID": "RightUpperTrail",
"Location": "70, 12",
"Map":"Farm",
"Rotation":0,
"OneTimeUse":false
},
"HouseDoor":{
"ID":"HouseDoor",
"Location":"64, 15",
"Map":"Farm",
"Rotation":2,
"OneTimeUse":true
}
},
"StartingOriginID":"RightUpperTrail",
"OriginRoamingPattern":"RANDOM",
"TargetLocations":{
"HouseDoor":{
"ID":"HouseDoor",
"Location":"64, 15",
"Map":"Farm",
"Rotation":2,
"OneTimeUse":false
},
"TownHall":{
"ID":"TownHall",
"Location":"53, 21",
"Map":"Town",
"Rotation":0,
"OneTimeUse":false
},
"Mines":{
"ID":"Mines",
"Location":"79, 4",
"Map":"Mountain",
"Rotation":0,
"OneTimeUse":false
}
},
"StartingTargetID":"Mines",
"TargetRoamingPattern":"ALPHABETICAL_REVERSE"
}

Content Packs

As of (1.5.0) Warp Binder now supports content packs. To create a content pack follow the standard procedures located in the SMAPI documentation and target your manifest to SnowFire.Warp_Binder as the target mod. The add a "content.json" file listing your warp files relative to your content packs folder with your warp packs listed under the "WarpPacks" key, while the name of the individual 'Packs' in this object is not actually used for anything I added it in order to help creators organize their sets of warp points.

Example
{
"WarpPacks":{
"WolfPack":
[
"Wolf/WolfDemo.roam",
"Wolf/WolfDemo.warp"
],
"BassPack":
[
"Bass/FishingHole.warp"
]
}
}


Recognitions

I would like to put in a thank you to the following users, as their work has impacted my ability to do these little projects drastically and really need to be given some credit.

- Platonymous

Bug Catchers

Because they are the unsung heroes of the software development world.

- ty2manie

Discord / Comms


I can be found lurking in these two Discord servers, though in the Stardew Valley server I tend to keep to the Making and Using mods sections for obvious reasons. While I may not be in voice chat during the day (I work 0800-1700 Pacific Time) I do check in via my phone.

Stardew Valley Discord

NightSong Discord

The Vales