Jump to content

Mod block so they will not be destroyed.


GreyWalker

Recommended Posts

Can I mod a block so it cannot be destroyed, I am trying to make a kind of safe haven surrounded by a fence.

Is it possible to mod the chain fence so that it cannot be destroyed by zombies?

 

In the Blocks.xml

 

 

There is chainLinkCornerBottom which extends chainLink, which in turn extends metalNoUpgradeMaster

 

<block id="1439" name="chainLinkCornerBottom">
<property name="Extends" value="chainLink" />
<property name="Model" value="chainlink_corner_bottom" />
</block>

<block id="1422" name="chainLink">
<property name="Extends" value="metalNoUpgradeMaster" />
<property name="Shape" value="New" />
<property name="Mesh" value="cutout" />
<property name="Model" value="chainlink_bottom" />
<property name="Texture" value="516" />
<property name="RotationAllowed" value="pivotOnFloor" />
<property name="Collide" value="movement,melee,rocket" /> <!-- -rocket -->
</block>

<block id="130" name="metalNoUpgradeMaster">
<property name="Material" value="metal" /> <!-- 250 HP -->
<property name="Texture" value="429" />
<property name="IsDeveloper" value="true" />
<property class="RepairItems"> <property name="forgedIron" value="2" /> </property>
<drop event="Destroy" name="scrapIron" count="5,15" prob="1" />
<drop event="Fall" name="scrapMetalPile" count="1" prob=".6" stick_chance="1" />
<property name="EconomicValue" value="12" />
</block>

 

I was thinking of copying these and prefixing them with Admin then making the appropriate edits.

Would adding the property stop them form being destroyed?

property name="DegradationBreaksAfter" value="false"

or maybe removing the movement in

<property name="Collide" value="movement,melee,rocket" /> <!-- -rocket -->

 

There is also a block limit comment in The block.xml So can more blocks even be added?

 <!-- Block limit: No block can have an ID greater 2047. -->

Link to comment
Share on other sites

You can add more blocks,you just cannot exceed block ID 2047.

 

All you'd need to do is tell the block to downgrade into itself when destroyed. That will essentially make it invincible.

 

Example:

 

<block id="XXXX" name="AdminWoodblock">

<property name="Extends" value="woodBlock" />

<property name="DowngradeBlock" value="AdminWoodblock" />

</block>

Link to comment
Share on other sites

You can add more blocks,you just cannot exceed block ID 2047.

 

All you'd need to do is tell the block to downgrade into itself when destroyed. That will essentially make it invincible.

 

Example:

 

<block id="XXXX" name="AdminWoodblock">

<property name="Extends" value="woodBlock" />

<property name="DowngradeBlock" value="AdminWoodblock" />

</block>

It pays to have a upgrade block as well so you can remove it when needed.

Link to comment
Share on other sites

How are we going to define them then? O.o

 

Just curious.

 

Its not that we wont need block IDs. We will still need them..

 

A16 will overhaul the entire process however.

 

For example currently if you want a block, wedge, ramp, corner, inside corner, outside corner, stairs... each of these requires its own block. Want to have those with different textures? New block required. For every change you need a new block.

 

The new system, from what I understand of it, will be more condensed and unified. There will be ONE block. This single block will have different forms it can take. So that woodframe block you have can be told to be any of those shapes or textures - all without making a new block for each and everyone.

 

This will dramatically free up the number of block IDs as there are a ton of blocks that simply won't be needed anymore. We no longer will need a bajillion shingle blocks - they'll all be the same block - just told to be a specific texture/shape when they're placed.

 

That was my understanding of it anyway. It sounds like it could be a huge game changer for us modders. It also sounds like players wont need to ask for or mod in new blocks. Want X block in the shape of stairs? Well, its already there.

 

Madmole went over this stuff in his last two youtube videos. I could be way off but that was my impression of how things will work out.

Link to comment
Share on other sites

  • 1 month later...

Sorry, late to the party!

 

What Valmar said about a block downgrading into itself makes sense. But does that mean it can no longer be destroyed by zombie AND player?

 

I love this game (too much), but would like to see "end game" upgrades for steel and vault doors that are immune to zombie damage. I want to try my hand at making new blocks (say, 4 in total) that are upgrades and maybe have a custom texture. But first, I need to tinker with the properties.

 

Some might say this would ruin the game, but I have solid reasons that I can share.

 

If someone could point me in the right direction I would greatly appreciate it!

Link to comment
Share on other sites

Sorry, late to the party!

 

What Valmar said about a block downgrading into itself makes sense. But does that mean it can no longer be destroyed by zombie AND player?

 

I love this game (too much), but would like to see "end game" upgrades for steel and vault doors that are immune to zombie damage. I want to try my hand at making new blocks (say, 4 in total) that are upgrades and maybe have a custom texture. But first, I need to tinker with the properties.

 

Some might say this would ruin the game, but I have solid reasons that I can share.

 

If someone could point me in the right direction I would greatly appreciate it!

This method would make it immune to any entity that destroyed it. It would still fall though
Link to comment
Share on other sites

This method would make it immune to any entity that destroyed it. It would still fall though

 

So the player would have to break whatever support is beneath the "immune" block just to get rid of it?

 

And I'm confused by your phrasing. Do you mean the block would become immune to damage only once it fails the downgrade check upon taking full damage?

 

Sorry if I am not too quick on the uptake.

Link to comment
Share on other sites

So the player would have to break whatever support is beneath the "immune" block just to get rid of it?

 

And I'm confused by your phrasing. Do you mean the block would become immune to damage only once it fails the downgrade check upon taking full damage?

 

Sorry if I am not too quick on the uptake.

 

What he means is if you cause the block to fall, it will break. Otherwise it is indestructible.

 

If you want to make an admin block that can be moved but is also indestructible you could add an upgrade even to let players to turn it into a block they can pickup.

 

For example:

 

 

<block id="XXXX" name="AdminWoodblock">

<property name="Extends" value="woodBlock" />

<property name="DowngradeBlock" value="AdminWoodblock" />

 

<property class="UpgradeBlock">

<property name="ToBlock" value="AdminWoodblockPickup" />

<property name="Item" value="wood" />

<property name="ItemCount" value="0" />

<property name="UpgradeHitCount" value="2" />

</property>

</block>

 

 

<block id="XXXX" name="AdminWoodblockPickup">

<property name="Extends" value="woodBlock" />

<property name="DowngradeBlock" value="AdminWoodblock" />

 

<property name="CanPickup" value="true" />

</block>

Link to comment
Share on other sites

  • 4 months later...

Thanks 4 the Code, but is there a way to add a specific Tool that can destroy this block?

Maybe "Adminaxe" or whatever

 

Or is there a way to add a new block, that only can be destroyed by an "AdminAxe"

 

Greetz

 

Rauler

Link to comment
Share on other sites

Thanks 4 the Code, but is there a way to add a specific Tool that can destroy this block?

Maybe "Adminaxe" or whatever

 

Or is there a way to add a new block, that only can be destroyed by an "AdminAxe"

 

Greetz

 

Rauler

 

i made by blocks stainless steel but this should be what you need

 

<block id="440" name="AdminBlock">
<property name="Material" value="MstainlessSteel" />
<property name="Texture" value="267" />
<drop event="Destroy" name="wood" count="0" />
<property name="DowngradeBlock" value="AdminBlock" />
<property class="UpgradeBlock">
<property name="ToBlock" value="woodFrameBlock" />
<property name="Item" value="Admin Tool" />
<property name="ItemCount" value="0" />
<property name="UpgradeHitCount" value="1" />
</property>
</block> 

 

then the tool ( from valmods )

 

<item id="1662" name="Admin Tool">
<property name="Degradation" value="500" param1="false" />
<property name="DegradationBreaksAfter" value="false" />
<property name="Stacknumber" value="1" />
<property name="Meshfile" value="Items/Weapons/Melee/Axe/stone_axePrefab" />
<property name="Material" value="stone" />
<property name="RepairTools" value="rockSmall" />
<property name="HoldType" value="32" />
<property name="Weight" value="5" />
<property name="Candrop" value="false" />
<property name="IsDeveloper" value="true" />
<property class="Action0">
	<property name="Class" value="Melee" />
	<property name="Delay" value="0.35" />
	<property name="Range" value="15" />
	<property name="Sphere" value="0.1" />
	<property name="SupportHarvesting" value="false" />
	<property name="ToolCategory.Butcher" value="0" />
</property>
<property class="Action1">
	<property name="Class" value="Repair" />
	<property name="Delay" value="0.2" />
	<property name="Repair_amount" value="5000" />
	<property name="Upgrade_hit_offset" value="-10" />
</property>
	<property class="Attributes">
		<property name="BlockDamage" value="10000,10000" />
		<property name="DegradationRate" value="0,0" />
	</property>
</item>

 

what this does is upgrade the block to a wood frame that you can then pick up

Link to comment
Share on other sites

Yes... but then nobody could move/break them.

 

The pickup flag easily handles that. His fence could have the durability of bedrock (or a custom material) and also be able to be picked up like a wood frame.

Link to comment
Share on other sites

The pickup flag easily handles that. His fence could have the durability of bedrock (or a custom material) and also be able to be picked up like a wood frame.

 

Last time I tried something like that it made it so you were able to pickup all bedrock like that. Then when I was on the bottom bedrock layer of the world (where I built my base) I accidentally pressed the pickup button on the floor (trying to open a chest) and caused myself to fall through the world. The result was me losing all my gear and making a permanent hole there (had to cheat in bedrock to fill it in). Then again it has been a while since I tried that or even played the game at all for that matter lol.

Link to comment
Share on other sites

Why not create a new trap using the chainlink fence ( i think you would have to change it from a block to an object , not sure, have not done any programming in a long time) ? Give it a ton of hp and make it damage entities ( by a lot) that come in contact with it . That way , you dont have to worry about spiders .

Link to comment
Share on other sites

  • 1 year later...

Admin Block

 

You can add more blocks,you just cannot exceed block ID 2047.

 

All you'd need to do is tell the block to downgrade into itself when destroyed. That will essentially make it invincible.

 

Example:

 

<block id="XXXX" name="AdminWoodblock">

<property name="Extends" value="woodBlock" />

<property name="DowngradeBlock" value="AdminWoodblock" />

</block>

 

Hi Valmar. I found this code you posted somewhere I used it a lot and found it fun to do so. It does not work on A17 and wondered if you could fix it for me? Here is the code for the block that self builds right at the point where it would brack.

 

<block id="2042" name="AdminBlock">

<property name="CustomIcon" value="woodMaster" />

<property name="Material" value="wood" />

<property name="Texture" value="241" />

<property name="FuelValue" value="80" />

<property name="CanPickup" value="true"/>

<drop event="Destroy" name="wood" count="0" prob="1" />

<drop event="Fall" name="woodDebris" count="1" prob="0.75" stick_chance="1" />

<property name="DowngradeBlock" value="AdminBlock" />

</block>

 

A17 no longer use's id codes. I would love to continyou useing this block but have no idear how to bring it up to date for A17.

Can you help please?

Best Regards.

Paul.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...