Difference between revisions of "Advanced Logistics"

From Savage Game Design Wiki
Jump to navigation Jump to search
(Created page with "== Advanced Logistics == ==== This page will guide you through adding the Advanced Logistics module to your mission. ==== This module allows players to carry objects and stor...")
 
(Add info about "vn_log_enablePickup")
 
(3 intermediate revisions by one other user not shown)
Line 8: Line 8:
 
==== Eden Editor ====
 
==== Eden Editor ====
  
To add the module to your mission all you need to do is either place the module '''Advanced Logistics''' into your mission.
+
To add the module to your mission all you need to do is place the module '''Advanced Logistics''' into your mission, you do not need to sync anything to it.
  
 
For advanced users, you can spawn the module '''vn_module_logistics''' dynamically during the pre-init of your mission. Spawning the module during gameplay may not work as intended and cause unforeseen side effects or bugs.
 
For advanced users, you can spawn the module '''vn_module_logistics''' dynamically during the pre-init of your mission. Spawning the module during gameplay may not work as intended and cause unforeseen side effects or bugs.
Line 16: Line 16:
  
 
The main bulk of the work to get the advanced logistics module working in your mission is through the configuration files for the module.
 
The main bulk of the work to get the advanced logistics module working in your mission is through the configuration files for the module.
 +
 +
An already built config file from Mike Force [https://pastebin.com/raw/T4LzNZuc is available here], it contains most of the default static weapons and vehicles available in the CDLC.
  
 
All of the following can either be added to the base game config (for mods) or to a missions description.ext file (for missions).
 
All of the following can either be added to the base game config (for mods) or to a missions description.ext file (for missions).
Line 53: Line 55:
  
 
* Once you've added all the vehicles and items to your config then the advanced logistics module is setup and ready to go.
 
* Once you've added all the vehicles and items to your config then the advanced logistics module is setup and ready to go.
 +
 +
==== Scripting ====
 +
 +
Objects can be blocked from being picked up by setting '''vn_log_enablePickup''' object variable to false/true:
 +
 +
<code>this setVariable ["vn_log_enablePickup", false];</code>
 +
 +
 +
[[Category: Modules]]

Latest revision as of 15:52, 14 October 2022

Advanced Logistics

This page will guide you through adding the Advanced Logistics module to your mission.

This module allows players to carry objects and store them vehicles to provide an easy way to transport them between two points.


Eden Editor

To add the module to your mission all you need to do is place the module Advanced Logistics into your mission, you do not need to sync anything to it.

For advanced users, you can spawn the module vn_module_logistics dynamically during the pre-init of your mission. Spawning the module during gameplay may not work as intended and cause unforeseen side effects or bugs.


Configuration Files

The main bulk of the work to get the advanced logistics module working in your mission is through the configuration files for the module.

An already built config file from Mike Force is available here, it contains most of the default static weapons and vehicles available in the CDLC.

All of the following can either be added to the base game config (for mods) or to a missions description.ext file (for missions).

  • In your config folder create a new class called vn_logistics
  • Inside this class create two classes called vehicle_data and item_data
    • The vehicle_data class will contain all the information about the weight and size that vehicles are able to carry
    • The item_data class will contain all the information about how large and heavy an object is to carry
  • Inside the vehicle_data class you can add all the vehicles which you would like players to be able to load objects into.

Use this template to get started

   // This is the classname of the vehicle 
   class b_truck_01_mover_f
   {
   	// This is the maximum weight the vehicle can carry (KG)
   	// -1 weight will disable the vehicles logistics system.
   	inventory_max_weight = 90;
   	// This is the maximum size of an object that the vehicle can carry (M^2)
   	inventory_max_size = 15;
   };
  • Inside the item_data class you can add all the objects which you would like players to be able to pickup, move, and load into vehicles.

Use this template to get started

   // This is the classname of the object
   class land_bagfence_long_f
   {
   	// Weight of the item (KG) - Used in calculations when loading/unloading
   	// -1 weight will disable the vehicles logistics system.
   	item_weight = 15;
   	// Size of the item (M^2) - Used in calculations when loading/unloading
   	item_size = 2.5;
   	// Distance item should be when spawned in front of the player
   	// This is hard coded to a minimum of 2 meters
   	spawn_distance = 2;
   	// This is the spawn rotation offset for the item. Usually -90/+90 degrees
   	rotation_offset = 0;
   };
  • Once you've added all the vehicles and items to your config then the advanced logistics module is setup and ready to go.

Scripting

Objects can be blocked from being picked up by setting vn_log_enablePickup object variable to false/true:

this setVariable ["vn_log_enablePickup", false];