Jump to content

Help about Creating Vehicle Increase storage mod


Recommended Posts

I'm Trying to add Item-modifier for vehicle like increasing storage

So the problem is I have a little bit code to try

 

<item name="ModCargoVehicleSchematic">
    <property name="Extends" value="schematicNoQualityMaster"/>
    <property name="CreativeMode" value="Player"/>
    <property name="CustomIcon" value="modRoboticDroneCargoMod"/>
    <property name="Unlocks" value="ModCargoVehicle"/>
    <effect_group tiered="false">
        <triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="ModCargoVehicle" operation="set" value="1"/>
        <triggered_effect trigger="onSelfPrimaryActionEnd" action="GiveExp" exp="50"/>
    </effect_group>
</item>

 

For item file

 

<recipe name="ModCargoVehicle" count="1" craft_area="workbench" always_unlocked="true" tags="workbenchCrafting">
    <ingredient name="resourceForgedSteel" count="5"/>
    <ingredient name="resourceScrapPolymers" count="10"/>
    <ingredient name="resourceElectricParts" count="4"/>
    <ingredient name="resourceMechanicalParts" count="4"/>
</recipe>

 

for test recipe

 

and last

 

<item_modifier name="ModCargoVehicle" installable_tags="vseat" modifier_tags="seat" blocked_tags="noMods" type="attachment">
        <property name="Extends" value="modGeneralMaster"/>
        <property name="UnlockedBy" value="ModCargoVehicleSchematic"/>
        <property name="CustomIcon" value="modRoboticDroneCargoMod"/>
        <effect_group tiered="false">
              <passive_effect name="VehicleStorage" operation="base_add" value="2"/>
        </effect_group>
    </item_modifier>

 

for item modifier the problem is down there at the bottom there's explain about xml with  VehicleStorageWidth VehicleStorageHeight   That I have tried on both 2 and it doesn't work

so I got no idea what to do next

I would glad if someone could help me with this

I don't want to add them by normally change loot.xml like loot size

I wanna let player craft mod to increase their storage instead of give them for free

Link to comment
Share on other sites

On 1/25/2023 at 4:23 AM, B2M8NUS said:

I'm Trying to add Item-modifier for vehicle like increasing storage

So the problem is I have a little bit code to try

 

<item name="ModCargoVehicleSchematic">
    <property name="Extends" value="schematicNoQualityMaster"/>
    <property name="CreativeMode" value="Player"/>
    <property name="CustomIcon" value="modRoboticDroneCargoMod"/>
    <property name="Unlocks" value="ModCargoVehicle"/>
    <effect_group tiered="false">
        <triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="ModCargoVehicle" operation="set" value="1"/>
        <triggered_effect trigger="onSelfPrimaryActionEnd" action="GiveExp" exp="50"/>
    </effect_group>
</item>

 

For item file

 

<recipe name="ModCargoVehicle" count="1" craft_area="workbench" always_unlocked="true" tags="workbenchCrafting">
    <ingredient name="resourceForgedSteel" count="5"/>
    <ingredient name="resourceScrapPolymers" count="10"/>
    <ingredient name="resourceElectricParts" count="4"/>
    <ingredient name="resourceMechanicalParts" count="4"/>
</recipe>

 

for test recipe

 

and last

 

<item_modifier name="ModCargoVehicle" installable_tags="vseat" modifier_tags="seat" blocked_tags="noMods" type="attachment">
        <property name="Extends" value="modGeneralMaster"/>
        <property name="UnlockedBy" value="ModCargoVehicleSchematic"/>
        <property name="CustomIcon" value="modRoboticDroneCargoMod"/>
        <effect_group tiered="false">
              <passive_effect name="VehicleStorage" operation="base_add" value="2"/>
        </effect_group>
    </item_modifier>

 

for item modifier the problem is down there at the bottom there's explain about xml with  VehicleStorageWidth VehicleStorageHeight   That I have tried on both 2 and it doesn't work

so I got no idea what to do next

I would glad if someone could help me with this

I don't want to add them by normally change loot.xml like loot size

I wanna let player craft mod to increase their storage instead of give them for free

An interesting concept.
There are a number of things we can change using xml because the code provides that flexibility to toggle changes.
There are also a number of things that are hardcoded, that may not always be possible to change with xml because they do not have flexibility or are only hooked up in a certain specific usage format.

You would like to:
a) Add a vehicle storage capacity mod that increases storage capacity in a similar way the Drone Cargo Mod functions.
b) Increase the number of slots or columns/rows by a set amount. In that case +2 slots or doubling depending on how the base_add functions.
c) And naturally, upon removal it would restore the vehicle back to its original base value.

Consider the drone which shows as the template to model your own idea.

Its entity has roboticDrone as the LootListAlive. A comment next to it suggests <!-- used to determine container X/Y size -->. This is a pretty unique comment from as far as I can see. It gives the impression of a special feature for special use scenarios.

The modifier tags of modifier_tags="droneStorage" are also very unique to their purpose. From what I've experienced, these tags are hardcoded features that are not flexible and need to be hooked into. It means they perform a highly specific task and modifier_tags="seat" will hook up to vehicles.xml whereas modifier_tags="droneStorage" hooks up to LootListAlive and in turn roboticDrone for the loot.xml.

The modRoboticDroneCargoMod doesn't show us any passive effect but something is certainly hardcoded in the background. It is not apparent for this class of mod.
It increases capacity from 8,2 to 8,3.

If this is hardcoded, then there is always the possibility of using the roboticDrone as the LootListAlive for the vehicles you would like to benefit from it. You could always amend the size of that loot container. However, it would be a one size fits all change the drone and anything else that takes the drone's loot container. And it would require testing to see if it's hardcoded to add 1 extra row or a 0.5 increase to base size. For the 4x4 9,9 this would be challenging due to limitations.

For something like the bicyle, it would be enough just to switch to the drone's loot list as it would increase base capacity and allow more if it was hooked up to receive the drone Storage Mod. For other vehicles there would be a lot of juggling.

 

Another pair of eyes to see if there is anything showing how the extra row is applied, and if there is a generic cvar/tag hooked up to allow it beyond the drone, would be helpful.

 

This is an very interesting concept for a Mod and may well require a Harmony patch from coders who can understand the workings of this mod class in better detail. The Guppy's Mod Discord is the place where that level of discussion often takes place.

Link to comment
Share on other sites

I'm glad to see this answer it answer me as much

I'm about of learning to code it myself instead of copy paste or change patch like I am doing right now.

It's kinda bad for me I'm about to create it my own so It would improve me for and future. I'm making own server that create for close friend and let them play I do patch many of thing myself try to figure it out how thing really work mod entity loot and else system

For the question I would say my choice is  "A"  I'm trying to mod it myself and looking for many thing relate to it

I tried to look on my mod in my server that made a double drum or something have wrote code relate to item_modifier so my idea start from that if I could increase vehicle storage such like Motorbike or Gyrocopter it would give a choice to some player about use them in different way for more flexible

They always ask to create 4x4 vehicle and leave other else behind to go together

 

 

Thank you again for reply me

Ps. I'm sorry about my English I know this kinda bad and hard to understand and I'm trying my best to explained.

:)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...