More actions
Replaced content with " Category:Dying Light Category:Texture" Tag: Replaced |
No edit summary |
||
Line 1: | Line 1: | ||
= Inventory Imports Guide = | |||
== General Rules == | |||
* Some files '''cannot''' be imported directly into `inventoryimports.scr` and must be reintroduced into their original locations (e.g., the stash). | |||
* You can reference what `inventoryimports.scr` contains; the process remains the same. | |||
* '''Do not''' import files into anything other than `inventoryimports.scr` unless required. | |||
== Custom Script Setup == | |||
=== 1. Define a Subroutine === | |||
Your custom script must include a subroutine definition at the beginning, such as: | |||
<pre> | |||
sub my_craftplans() | |||
{ | |||
} | |||
</pre> | |||
It is recommended to name this subroutine the same as your `.scr` file (excluding the extension) for convenience, but this is optional. | |||
=== 2. Using the Subroutine in Another Script === | |||
* The script where your custom subroutine is imported must include a `use` statement within `sub main()`, ensuring the names match. | |||
* The key difference is that the `use` script is written with an extra symbol `();` when calling the subroutine. | |||
=== 3. Importing Your Custom File === | |||
* The import statement '''must''' be placed '''above''' the rest of the script and must include the full file name: | |||
<pre> | |||
import "custom.scr" | |||
</pre> | |||
== Example Imports == | |||
=== Example 1: Importing into Another Script === | |||
<pre> | |||
import "inventorystuff.scr" | |||
import "faction_exports.scr" | |||
import "inventory_weapondefinitions.scr" | |||
import "custom.scr" | |||
sub main() | |||
{ | |||
use my_craftplans(); | |||
} | |||
</pre> | |||
=== Example 2: Importing into `inventoryimports.scr` === | |||
'''⚠️ Use only one import method—do not mix both!''' | |||
<pre> | |||
// This script is generated from Inventory.xlsm. Do not modify it!!! | |||
import "inventorystuff.scr" | |||
import "inventory_outfits_opera.scr" | |||
sub imports() | |||
{ | |||
} | |||
sub outfit_imports() | |||
{ | |||
} | |||
sub collectables_imports() | |||
{ | |||
} | |||
sub prototypes_imports() | |||
{ | |||
} | |||
sub weapons_imports() | |||
{ | |||
} | |||
sub items_imports() | |||
// "items_imports" and "imports" can accept any type of inventory data. | |||
// You can categorize by type or place all imports here. | |||
{ | |||
use my_craftplans(); | |||
} | |||
</pre> | |||
== Custom Scripts for `skills_sources.scr` and `buffs_sources.scr` == | |||
* To add a custom script for '''skills''' or '''buffs''', follow the same import structure. | |||
* '''Steps:''' | |||
# '''Make a copy''' of the XML file. | |||
# '''Clear its content''' and rename it. | |||
# '''Place it in the corresponding source file''' (e.g., `buffs_sources.scr`). | |||
=== Example: Adding Buffs in `buffs_sources.scr` === | |||
<pre> | |||
sub main() | |||
{ | |||
Script("buffs.xml"); | |||
Script("my_buffs.xml"); | |||
Script("buffs_gameplay_modifiers.xml"); | |||
} | |||
</pre> | |||
== ✅ Final Notes == | |||
* '''Keep imports organized''' based on what they contain. | |||
* '''Use only one import method''' for consistency. | |||
* '''Make sure subroutine names match''' in the `use` statement. | |||
Revision as of 17:13, 6 February 2025
Inventory Imports Guide
General Rules
- Some files cannot be imported directly into `inventoryimports.scr` and must be reintroduced into their original locations (e.g., the stash).
- You can reference what `inventoryimports.scr` contains; the process remains the same.
- Do not import files into anything other than `inventoryimports.scr` unless required.
Custom Script Setup
1. Define a Subroutine
Your custom script must include a subroutine definition at the beginning, such as:
sub my_craftplans() { }
It is recommended to name this subroutine the same as your `.scr` file (excluding the extension) for convenience, but this is optional.
2. Using the Subroutine in Another Script
- The script where your custom subroutine is imported must include a `use` statement within `sub main()`, ensuring the names match.
- The key difference is that the `use` script is written with an extra symbol `();` when calling the subroutine.
3. Importing Your Custom File
- The import statement must be placed above the rest of the script and must include the full file name:
import "custom.scr"
Example Imports
Example 1: Importing into Another Script
import "inventorystuff.scr" import "faction_exports.scr" import "inventory_weapondefinitions.scr" import "custom.scr" sub main() { use my_craftplans(); }
Example 2: Importing into `inventoryimports.scr`
⚠️ Use only one import method—do not mix both!
// This script is generated from Inventory.xlsm. Do not modify it!!! import "inventorystuff.scr" import "inventory_outfits_opera.scr" sub imports() { } sub outfit_imports() { } sub collectables_imports() { } sub prototypes_imports() { } sub weapons_imports() { } sub items_imports() // "items_imports" and "imports" can accept any type of inventory data. // You can categorize by type or place all imports here. { use my_craftplans(); }
Custom Scripts for `skills_sources.scr` and `buffs_sources.scr`
- To add a custom script for skills or buffs, follow the same import structure.
- Steps:
# Make a copy of the XML file. # Clear its content and rename it. # Place it in the corresponding source file (e.g., `buffs_sources.scr`).
Example: Adding Buffs in `buffs_sources.scr`
sub main() { Script("buffs.xml"); Script("my_buffs.xml"); Script("buffs_gameplay_modifiers.xml"); }
✅ Final Notes
- Keep imports organized based on what they contain.
- Use only one import method for consistency.
- Make sure subroutine names match in the `use` statement.