Loading...

Hold on, just a second while we get things ready for you!

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
No edit summary
Line 1: Line 1:
<pre> sub my_craftplans()
# 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() { }
pgsql
Copy
Edit
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"
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(); }
pgsql
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" can accept any type of 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. 
---





Revision as of 17:10, 6 February 2025

  1. Inventory Imports Guide
    1. 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.

    1. Custom Script Setup
      1. 1. Define a Subroutine

Your custom script must include a subroutine definition at the beginning, such as: sub my_craftplans() { }

pgsql Copy Edit It is recommended to name this subroutine the same as your `.scr` file (excluding the extension) for convenience, but this is optional.

      1. 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.

      1. 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"

yaml Copy Edit

---

    1. Example Imports
      1. **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(); }

pgsql Copy Edit

      1. **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(); }

markdown Copy Edit

---

    1. 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`).  
      1. **Example: Adding Buffs in `buffs_sources.scr`**

sub main() { Script("buffs.xml"); Script("my_buffs.xml"); Script("buffs_gameplay_modifiers.xml"); }

yaml Copy Edit

---

      1. ✅ **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.

---

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