Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Test3: Difference between revisions

Welcome to the Chrome Engine Modding Wiki
No edit summary
Replaced content with " Category:Dying Light Category:Texture"
Tag: Replaced
 
(5 intermediate revisions by the same user not shown)
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** 
  - At the beginning of your script, define a subroutine: 
sub my_craftplans() { }
markdown
Copy
Edit
- It is **recommended** to name the subroutine the same as your `.scr` file (without the extension), but this is optional.
2. **Using the Subroutine** 
- In the script where your subroutine is imported, place a `use` statement inside `sub main()`. 
- The `use` script calls the subroutine, and their names must match. 
- The key difference is that the `use` script includes an extra symbol `();` 
3. **Importing Your Custom File** 
- The import statement **must** be placed **above** the rest of the script and include the full file name: 
import "custom.scr"
yaml
Copy
Edit
---
## 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();
}
yaml
Copy
Edit
---
### **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" accept any inventory data. // You can categorize by type or place all imports here.
{
use my_craftplans();
}
markdown
Copy
Edit
---
## 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:**
  1. **Make a copy** of the XML file.
  2. **Clear its content** and rename it.
  3. **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");
}
yaml
Copy
Edit
---
### ✅ **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.
---





Latest revision as of 17:16, 6 February 2025

Cookies help us deliver our services. By using our services, you agree to our use of cookies.