Jump to content

Improved items...


Recommended Posts

Posted (edited)

I am working on some electrical improvements for my server and things are going fairly well, but I have a few questions. Currently I am working on a better electric fence. It costs twice as much to make, has 50% more HP, less degredation from being used, and I want it to do more shock damage. I see where the buff of being shocked is applied, but how can I make this effect last longer? Could I apply the same buff twice? I can add my own shock effect if I need to and simply clone the original and add time, but I would prefer to mod as few files as possible.

 

Also, my electrical fuse box (acts like a relay) does not have wires going out of it and it works fine and has the correct icon both in-game when crafting and in the creative menu. My electric fence post does not. What am I doing wrong? I'll share the code I have.


<block name="DHTA_Elec_Fence">
    <property name="CreativeMode" value="Player"/>
    <property name="DescriptionKey" value="DHTA_Elec_Fence_Desc"/>
    <property name="Class" value="ElectricWire"/>
    <property name="UnlockedBy" value="perkAdvancedEngineering,electricfencepostSchematic"/>
    <property name="Material" value="Mmetal_weak"/>
    <property name="StabilitySupport" value="false"/>
    <property name="Shape" value="ModelEntity"/>
    <property name="Mesh" value="models"/>
    <property name="MaxDamage" value="300"/>
    <property name="DamageReceived" value="0.25"/>
    <property name="Model" value="Entities/Electrical/electric_fencePrefab"/> <property name="HandleFace" value="Bottom"/>
    <property class="RepairItems"> <property name="resourceElectricParts" value="1"/> <property name="resourceScrapIron" value="1"/> </property>
    <property name="DisplayType" value="blockElectricalMulti"/>
    <property name="MultiBlockDim" value="1,2,1"/>
    <property name="ImposterDontBlock" value="true"/>
    <property name="Collide" value="movement,melee,bullet,arrow,rocket"/>
    <property name="RequiredPower" value="5"/>
    <property name="Buff" value="buffShocked"/>
    <property name="BuffChance" value="1"/>
    <property name="Group" value="Tools/Traps,Science"/>
    <property class="RepairItems">
        <property name="resourceForgedIron" value="8"/>
        <property name="resourceElectricParts" value="2"/>
    </property>
    <drop event="Harvest" name="terrStone" count="0" tool_category="Disassemble"/>
    <drop event="Harvest" name="resourceElectricParts" count="0,1" tag="salvageHarvest"/>
    <drop event="Harvest" name="resourceScrapIron" count="5,40" tag="allHarvest"/>
    <drop event="Destroy" count="0"/>
    <drop event="Fall" name="scrapMetalPile" count="1" prob="0.75" stick_chance="1"/>
    <property name="EconomicValue" value="62"/>
    <property name="FilterTags" value="fdecor,felectrical,ftraps"/>
    <property name="SortOrder1" value="70a0"/>
</block>

That is the block, below is the localization for it. Sorry, I am American and only speak English. I do not travel.


DHTA_Elec_Fence,blocks,Electricity,,,Electric Fence Post,,,,,,,,,
DHTA_Elec_FenceDesc,blocks,Electricity,,,Wire up two or more of these and shock your enemies.,,,,,,,,,

Finally, the recipe.


<recipe name="DHTA_Elec_Fence" count="1" craft_area="workbench" tags="perkAdvancedEngineering,learnable">
    <ingredient name="resourceForgedIron" count="10"/>
    <ingredient name="resourceElectricParts" count="4"/>
    <effect_group>
        <passive_effect name="CraftingIngredientCount" level="0,1,2,3,4" operation="perc_add" value=".5,.5,.5,.3,.15" tags="resourceForgedIron,resourceElectricParts"/>
    </effect_group>
</recipe>

So what am I missing for the electric fence-post icon in creative and workbench?

Edited by The_Great_Sephiroth (see edit history)
Link to comment
Share on other sites

Posted (edited)

By default, the icon shown is name matched to the block name.  So if there is no icon property for a block name Ralph, the game looks for an icon named Ralph.  The vanilla electricalfensepost is that way.  But your copy has a new name, and no default matching icon, so you would need to either reference the default icon in a customicon property or make a new icon and refer to that in your mods icon folder.

Edited by xyth (see edit history)
Link to comment
Share on other sites

Thanks, will attempt this. Also, I see I accidentally posted in the wrong forum. Sorry about that.

 

I had something else come up. Can I remove or override the wire info for a model? I want to make a solar bank clone which has no wires run out of it. Not sure how to go about doing that.

Link to comment
Share on other sites

Posted (edited)
1 hour ago, The_Great_Sephiroth said:

 I see where the buff of being shocked is applied, but how can I make this effect last longer? Could I apply the same buff twice? I can add my own shock effect if I need to and simply clone the original and add time, but I would prefer to mod as few files as possible.

 

 

Edit: If you want it to do more damage, I think all you have to change is the   <passive_effect name="HealthChangeOT" operation="base_add" value="-6"/> to something more negative :D  but you will probably want to make your own buff to do it so you don't change the default electric fence too

Edited by alffr0mm3lmac
Read the question wrong the first time lmao (see edit history)
Link to comment
Share on other sites

Alright, I was hoping I did not need to edit the other file, but it's no biggy. Was hoping I could just add two shocks and let them stack. Thanks. Now I have completed everything except that and figuring out how to remove wiring data from a model so I don't have wires everywhere.

Link to comment
Share on other sites

OK, I have stopped work on the solar bank for now because the wiring info is stored in the 3D model, and I cannot figure out how to get around that. Instead, I made an upgraded blade trap. It takes double the resources to build, but you get 50% more damage and HP. However, the server or my client is ignoring the localization info for it and is not showing the description or name, and instead uses the internal name of "DHTA_Blade_Trap". I have checked but I do not see anything wrong here.


Blocks.xml:

 

<block name="DHTA_Blade_Trap">
    <property name="CreativeMode" value="Player"/>
    <property name="CustomIcon" value="bladeTrap"/>
    <property name="DescriptionKey" value="DHTA_Blade_Trap_Desc"/>
    <property name="Class" value="BladeTrap"/>
    <property name="UnlockedBy" value="perkAdvancedEngineering,bladeTrapSchematic"/>
    <property name="Material" value="Mmetal_hard"/>
    <property name="Damage" value="30"/>
    <property name="DamageReceived" value="4"/>
    <property name="BreakingPercentage" value="0.75"/>
    <property name="BrokenPercentage" value="0.1"/>
    <property name="ImpactSound" value="bladetrap_impact"/>
    <property name="StartSound" value="bladetrap_startup"/>
    <property name="StopSound" value="bladetrap_stop"/>
    <property name="RunningSound" value="bladetrap_fire_lp"/>
    <property name="RunningSoundBreaking" value="bladetrap_dm1_lp"/>
    <property name="RunningSoundBroken" value="bladetrap_dm2_lp"/>
    <property name="MaxDamage" value="3000"/>
    <property name="StabilitySupport" value="false"/>
    <property name="Shape" value="ModelEntity"/>
    <property name="Collide" value="movement,melee,bullet,arrow,rocket"/>
    <property name="Model" value="Entities/Electrical/trap_spinning_bladePrefab"/>
    <property name="HandleFace" value="Bottom"/>
    <property name="MultiBlockDim" value="3,1,3"/>
    <property name="DisplayType" value="blockElectricalHardenedMulti"/>
    <property name="ImposterExchange" value="imposterPlate" param1="111"/>
    <property name="IsTerrainDecoration" value="true"/>
    <property name="Collide" value="movement,melee,bullet,arrow,rocket"/>
    <property name="RequiredPower" value="20"/>
    <property name="Group" value="Tools/Traps,Science"/>
    <property name="ActivationDistance" value="6"/>
    <property class="RepairItems">
        <property name="resourceForgedSteel" value="20"/>
    </property>
    <drop event="Harvest" name="terrStone" count="0" tool_category="Disassemble"/>
    <drop event="Harvest" name="resourceScrapIron" count="20,100" tag="allHarvest"/>
    <drop event="Destroy" count="0"/>
    <drop event="Fall" name="scrapMetalPile" count="1" prob="0.75" stick_chance="1"/>
    <property name="Stacknumber" value="10"/>
    <property name="TakeDelay" value="10"/>
    <property name="EconomicValue" value="444"/>
    <property name="FilterTags" value="fdecor,felectrical,ftraps"/>
    <property name="SortOrder1" value="70a0"/>
</block>

 

Localization.txt

 

DHTA_Blade_Trap,blocks,Electricity,,,Improved Blade Trap,,,,,,,,,
DHTA_Blade_Trap_Desc,blocks,Electricity,,,Just add zombies and stir!,,,,,,,,,

I don't even see any typos.

Link to comment
Share on other sites

Posted (edited)

You only have 14 entries between the commas in your localization. Vanilla has 20. If you're doing a modlet, you dont need all of those commas and what not. At the start of the localization file just put Key,english... Then you'll just need DHTA_Blade_Trap,Improved Blade Trap... no need for the 20 additional entries.

Edited by Telric (see edit history)
Link to comment
Share on other sites

Posted (edited)

The way I have always done this is to add my code to the official files. Is there another way? I always add my stuff at the very end of the file.

 

*EDIT*

 

I looked it up. Going to try it now. I prefer that method to mucking with my game files anyway. Reminds me of days long past where you just copied a mod folder into the core Quake/Quake II/Half-Life/Unreal folder and things worked.

Edited by The_Great_Sephiroth (see edit history)
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...