VoidExpanse > Modding info

WIP Salvaging

(1/3) > >>

Pasadenasman:
Hi guys,

Fairly new to modding and i'm trying to learn/do some basic stuff. I'm considering giving some extractable ressources to debris floating in space. Before granting them differents ressources and quantity, i'm focusing on giving the asteroid miner (the civilian one) the possibility to "mine" debris. So i modified all the xml file of debris (debris barrel, solar panel etc) in the following way :
<root>
   <header>
      <id>debris_generic_barrel_02</id>
      <title>(Unused)</title>
      <enabled>1</enabled>
   </header>

   <gfx>
      <model>space_objects/debris_generic_barrel_01.obj</model>
      <textures>
         <diffuse>space_objects/debris_generic_barrel_01/dif_256_green.jpg</diffuse>
         <normal>space_objects/debris_generic_barrel_01/nrm_256.jpg</normal>
         <specular>space_objects/debris_generic_barrel_01/spec_256.jpg</specular>
      </textures>
   </gfx>

   <sfx>
      <!-- none-->
   </sfx>

   <data>
      <scale_range>0.5;0.5</scale_range>
      <rotation_range>-1.0;1.0</rotation_range>

      <physics>
         <mass>20</mass>
         <shapes>
            <shape>
               <type>box</type>
               <offset>0.000;0.000</offset>
               <angle>0</angle>
               <size>1.679;2.987</size>
               <mass>8</mass>
            </shape>
         </shapes>
      </physics>
      
      <type>1</type>
      <difficulty>1000</difficulty> <!-- how long will it take to mine asteroid -->

      <contents>
         <resource>
            <id>ore_glepsite</id>
            <quantity>500;800</quantity>
            <extraction>10</extraction>
         </resource>
         <resource>
            <id>ore_cyactite</id>
            <quantity>200;300</quantity>
            <extraction>5</extraction>
         </resource>
         <resource>
            <id>ore_fraclasite</id>
            <quantity>100;200</quantity>
            <extraction>2</extraction>
         </resource>
      </contents>
      
   </data>
</root>

and changed the harvester by the following :
<root>
   <header>
      <id>device_mining_civilian</id>
      <title>Civilian mining device</title>
      <description>The most basic mining device. It works... but not as well as you would like. The good thing about it is that you don't need any qualifications to use it, unlike other mining devices.</description>
      <enabled>1</enabled>
   </header>

   <gfx>
      <icon>items/devices/device_mining_civilian.png</icon>
   </gfx>

   <data>
      <type>9</type>
      
      <shops>
         <shops_level>1</shops_level>
         <faction_filter></faction_filter>
         <faction_only>0</faction_only>
         <faction_reputation>0</faction_reputation>
         <price>0</price>
      </shops>
      
      <flags>
         <flag>civilian</flag>
      </flags>

      <upgrades_max>0</upgrades_max>
      <upgrades>
         <!-- none -->
      </upgrades>

      <requirements>
         <!-- none -->
      </requirements>

      <effects>
         <!-- none -->
      </effects>

      <item_data>

         <durability>25000</durability> <!-- max durability -->

         <cooldown>1</cooldown> <!-- cooldown in seconds after initiation of usage -->

         <!-- DEVICE ACTIVATION
            determines a way the module can be activated
         -->
         <target>3</target> <!-- 0- N/A, 1- self, 2- area (around self), 3- object, 4- coordinates -->
         <target_parameters>
            <range>10</range> <!-- used for all except "self" and "area" mode. -->
            <area>10</area>
            <!-- determines area of effect on specified coordinates. only for "area", "target", "coordinates" -->
            <target_filter>asteroid,debris</target_filter>
            <!-- only for "target" mode. For target can be specified: asteroid, ship, crate, jumpgate, base -->
         </target_parameters>

         <!-- DEVICE ACTION
            determines how module effect should be applied
         -->
         <action_type>2</action_type> <!-- 0- N/A, 1- immediate, 2- per frame, 3- on complete -->
         <!-- the following configuration is only applicable for "per frame" and "on complete" modes -->
         <action_parameters>
            <duration>0</duration> <!-- 0 for infinite -->
            <cancel_on_move>1</cancel_on_move> <!-- module is disabled when ship moves -->
            <cancel_on_take_damage>1</cancel_on_take_damage> <!-- module is disabled when ship takes damage -->
            <cancel_on_deactivate>0</cancel_on_deactivate> <!-- module is disabled when user activates it again (in this case deactivates) -->
         </action_parameters>

         <!-- CUSTOM PARAMETERS
            can be any number parameters, also accessible through scripts
         -->
         <custom_parameters>
            <speed>300</speed>
            <amount>75</amount>
            <energy>40</energy>
         </custom_parameters>

         <!-- script definition for this module, must be valid filename -->
         <script>ModuleMining.js</script>

      </item_data>
   </data>
</root>

When trying to do so in game, i have the following notification on the top left of the screen : http://images.akamai.steamusercontent.com/ugc/610604005651531581/BC3397265173812EEA79F007B85B1A55F8C0DA8F/

So any idea what can i do to fix this ? Thanks in advance !

Lurler:
Hm, my understanding is that you need to mark the debris with the same tag you are using in the device. Specifically "debris".
Though, to be honest I am not even sure that's possible. But probably yes. I do not see the same tag on asteroids though, so maybe this behavior is hardcoded...

Pasadenasman:
Hi,
Thanks for responding and yes. I cant see a tag on asteroids too... and i dunno if simply add a tag will do the trick. Maybe adding "mineable" on debris... maybe... will try this evening and post the result here.

ai_enabled:
The mining is not hardcoded at the game core code, it's implemented with Mining devices at mining device script "data\scripts\devices\ModuleMining.js" it calls GetAsteroidDescriptionByID() so it expect to work only with asteroids.

I think it's possible to introduce special mining device to "mine" debris, but then you need to make another device script for it.

ai_enabled:
I just checked and there are no special tag for debris, they are known by the game core as "spaceobject" tag.
So if you want your device to act on debris, you need to use "spaceobject" filter, not "debris".
You cannot introduce new tags :-(. It's hardcoded.

Navigation

[0] Message Index

[#] Next page

Go to full version