Create a free account to remove all ad content.

Author Topic: [Other] TM PC Modding API  (Read 27742 times)

0 Members and 1 Guest are viewing this topic.

TheDestinedCrab

  • Legendary Member
  • *
  • Posts: 1401
  • Did you see that? Me neither.
    • View Profile
Re: TM PC Modding API
« Reply #60 on: November 03, 2016, 01:27:52 PM »
Thankyou, I didn't realise that.
Thanks Gold Knight for the amazing sig!

FatbFFA

  • Supreme Member
  • *
  • Posts: 2103
    • View Profile
    • ::)
  • Xbox: ETTP & Mr Zincy
Re: TM PC Modding API
« Reply #61 on: December 07, 2016, 11:13:10 AM »
Ok so when supplying multiple textures for one mod correct me if i'm wrong this is how we do it.

Supply the texture atlas of all the textures.


Then in the XML data simply list them in order from left to right.

Code: [Select]
<?xml version="1.0"?>
<ArrayOfItemXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ItemXML>
    <ItemID>Square</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>Circle</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>SquareOnItsSide</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>HalfSquare</ItemID>
  </ItemXML>
</ArrayOfItemXML>

Next say we had multiple rows of textures when were listing them in the XML data we go from top left to right then at the end of the row back to the left and so on?


Looking like this.


Then when we write it into the XML data we do it in the same order as in the picture above.

Code: [Select]
<?xml version="1.0"?>
<ArrayOfItemXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ItemXML>
    <ItemID>Square</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>Circle</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>SquareOnItsSide</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>HalfSquare</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>CharlesTri</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>CharlesDiamond</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>CharlesCircle2</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>CharlesSquare2</ItemID>
  </ItemXML>
</ArrayOfItemXML>




Last something i've done is put Charles in front of any item id, the reason for this is if someone is running 2 mods that just so happen to have an item named Circle I could see bad things happening. So to remove that issue I put my name before anything in my mods. Now some may say what if someones name is Charles and they do this. Well Ill just use TMCharles, Ieyfo or something.



Dryym

  • Supreme Member
  • *
  • Posts: 4336
  • What's yours is mine. ~TM's Resident Master Thief~
    • View Profile
  • Xbox: dryym
Re: TM PC Modding API
« Reply #62 on: December 07, 2016, 11:43:45 AM »
Serious question. Why would you put "HalfSquare" Instead of "RightIsoscelesTriangle" Or just "Triangle"? Kinda off topic, But it seemed odd to me.

Also, "SquareOnItsSide" Is better defined as "Rhombus".

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym

FatbFFA

  • Supreme Member
  • *
  • Posts: 2103
    • View Profile
    • ::)
  • Xbox: ETTP & Mr Zincy
Re: TM PC Modding API
« Reply #63 on: December 07, 2016, 11:54:54 AM »
Serious question. Why would you put "HalfSquare" Instead of "RightIsoscelesTriangle" Or just "Triangle"? Kinda off topic, But it seemed odd to me.

Also, "SquareOnItsSide" Is better defined as "Rhombus".

Cause I was feeling creative. and funny. Also to make people like you ask questions. :p



TheDestinedCrab

  • Legendary Member
  • *
  • Posts: 1401
  • Did you see that? Me neither.
    • View Profile
Re: TM PC Modding API
« Reply #64 on: December 07, 2016, 04:23:02 PM »
Hi,

I hate to bother you (whoever does this), but would you mind checking over these four xml files for me to let me know if what I'm doing is correct. Thanks in advance!

Spoiler for Hidden Content:
ItemData.xml :
Code: [Select]
<?xml version="1.0"?>
<ArrayOfModItemDataXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ModItemDataXML>
    <ItemID>NegativeLightBlock</ItemID>
    <Name>Negative Light Block</Name>
    <Desc>This will erase light around the block.</Desc>
    <IsValid>true</IsValid>
    <IsEnabled>true</IsEnabled>
    <LockedDD>true</LockedDD>
    <LockedCR>false</LockedCR>
    <LockedSU>false</LockedSU>
    <MinCSPrice>500</MinCSPrice>
    <StackSize>100</StackSize>
    <Durability>1200</Durability>
    <StrikeDamage>1</StrikeDamage>
    <StrikeReach>2</StrikeReach>
    <HealPower>0</HealPower>
    <BurnTime>0</BurnTime>
    <SmeltTime>0</SmeltTime>
    <ParticleLight>-50</ParticleLight>
<CanDropIfLocked>true</CanDropIfLocked>
    <Plural>S</Plural>
  </ModItemDataXML>
</ArrayOfModItemDataXML>
ItemTypeData.xml :
Code: [Select]
<?xml version="1.0"?>
<ArrayOfModItemTypeDataXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ModItemTypeDataXML>
    <ItemID>NegativeLightBlock</ItemID>
    <Use>Block</Use>
    <Type>Block</Type>
    <SubType>None</SubType>
    <Class>Steel</Class>
    <Inv>Building</Inv>
    <Combat>None</Combat>
    <Model>Weapon</Model>
    <Swing>Weapon</Swing>
    <Equip>RightHand</Equip>
  </ModItemTypeDataXML>
</ArrayOfModItemTypeDataXML>

ItemCombatData.xml :
Code: [Select]
<?xml version="1.0"?>
<ArrayOfModItemCombatDataXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ModItemCombatDataXML>
    <CombatID>NegativeLightBlock</CombatID>
    <Health>0</Health>
    <Attack>1</Attack>
    <Strength>0</Strength>
    <Defence>0</Defence>
    <Ranged>0</Ranged>
    <Looting>0</Looting>
  </ModItemCombatDataXML>
</ArrayOfModItemCombatDataXML>

ItemModelData.xml :
Code: [Select]
<?xml version="1.0"?>
<ArrayOfModItemModelDataXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ModItemModelDataXML>
    <ItemModelType>Block</ItemModelType>
    <Scale>2.2</Scale>
    <HandOffset>
      <X>0</X>
      <Y>0.03331069</Y>
      <Z>-0.04895301</Z>
    </HandOffset>
    <HandYPR>
      <X>0</X>
      <Y>-1.35</Y>
      <Z>0</Z>
    </HandYPR>
    <HUDScale>1</HUDScale>
    <HUDOffset>
      <X>0</X>
      <Y>-0.06391386</Y>
      <Z>-0.0002981975</Z>
    </HUDOffset>
  </ModItemModelDataXML>
</ArrayOfModItemModelDataXML>

SkillData.xml :
Code: [Select]
<?xml version="1.0"?>
<ArrayOfModSkillDataXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ModSkillDataXML>
    <ItemID>SteelSword</ItemID>
    <MineReq>0</MineReq>
    <UseReq>10</UseReq>
    <UseSkill>Building</UseSkill>
    <CraftReq>10</CraftReq>
    <CraftSkill>Building</CraftSkill>
  </ModSkillDataXML>
</ArrayOfModSkillDataXML>

I know I haven't added a texture in yet but the aim of this is for it to be a negative light block. This means that it will get rid of all light around it. I made an ideas topic found here ages ago but I'm planning on making a mod for it now :P

Cheers,
Crab.
Thanks Gold Knight for the amazing sig!

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: TM PC Modding API
« Reply #65 on: December 07, 2016, 04:51:17 PM »
Ok so when supplying multiple textures for one mod... correct me if i'm wrong this is how we do it.

Supply the texture atlas of all the textures.


Then in the XML data simply list them in order from left to right.

Code: [Select]
<?xml version="1.0"?>
<ArrayOfItemXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ItemXML>
    <ItemID>Square</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>Circle</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>SquareOnItsSide</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>HalfSquare</ItemID>
  </ItemXML>
</ArrayOfItemXML>

Next say we had multiple rows of textures when were listing them in the XML data we go from top left to right then at the end of the row back to the left and so on?


Looking like this.


Then when we write it into the XML data we do it in the same order as in the picture above.

Code: [Select]
<?xml version="1.0"?>
<ArrayOfItemXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ItemXML>
    <ItemID>Square</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>Circle</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>SquareOnItsSide</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>HalfSquare</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>CharlesTri</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>CharlesDiamond</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>CharlesCircle2</ItemID>
  </ItemXML>
  <ItemXML>
    <ItemID>CharlesSquare2</ItemID>
  </ItemXML>
</ArrayOfItemXML>
Correct. The textures can be in a single row, a single column or a grid of rows and columns. Just list the items in the xml file from left to right, top to bottom.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: TM PC Modding API
« Reply #66 on: December 07, 2016, 05:01:57 PM »
Hi,

I hate to bother you (whoever does this), but would you mind checking over these four xml files for me to let me know if what I'm doing is correct. Thanks in advance!

Spoiler for Hidden Content:
ItemData.xml :
Code: [Select]
<?xml version="1.0"?>
<ArrayOfModItemDataXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ModItemDataXML>
    <ItemID>NegativeLightBlock</ItemID>
    <Name>Negative Light Block</Name>
    <Desc>This will erase light around the block.</Desc>
    <IsValid>true</IsValid>
    <IsEnabled>true</IsEnabled>
    <LockedDD>true</LockedDD>
    <LockedCR>false</LockedCR>
    <LockedSU>false</LockedSU>
    <MinCSPrice>500</MinCSPrice>
    <StackSize>100</StackSize>
    <Durability>1200</Durability>
    <StrikeDamage>1</StrikeDamage>
    <StrikeReach>2</StrikeReach>
    <HealPower>0</HealPower>
    <BurnTime>0</BurnTime>
    <SmeltTime>0</SmeltTime>
    <ParticleLight>-50</ParticleLight>
<CanDropIfLocked>true</CanDropIfLocked>
    <Plural>S</Plural>
  </ModItemDataXML>
</ArrayOfModItemDataXML>
ItemTypeData.xml :
Code: [Select]
<?xml version="1.0"?>
<ArrayOfModItemTypeDataXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ModItemTypeDataXML>
    <ItemID>NegativeLightBlock</ItemID>
    <Use>Block</Use>
    <Type>Block</Type>
    <SubType>None</SubType>
    <Class>Steel</Class>
    <Inv>Building</Inv>
    <Combat>None</Combat>
    <Model>Weapon</Model>
    <Swing>Weapon</Swing>
    <Equip>RightHand</Equip>
  </ModItemTypeDataXML>
</ArrayOfModItemTypeDataXML>

ItemCombatData.xml :
Code: [Select]
<?xml version="1.0"?>
<ArrayOfModItemCombatDataXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ModItemCombatDataXML>
    <CombatID>NegativeLightBlock</CombatID>
    <Health>0</Health>
    <Attack>1</Attack>
    <Strength>0</Strength>
    <Defence>0</Defence>
    <Ranged>0</Ranged>
    <Looting>0</Looting>
  </ModItemCombatDataXML>
</ArrayOfModItemCombatDataXML>

ItemModelData.xml :
Code: [Select]
<?xml version="1.0"?>
<ArrayOfModItemModelDataXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ModItemModelDataXML>
    <ItemModelType>Block</ItemModelType>
    <Scale>2.2</Scale>
    <HandOffset>
      <X>0</X>
      <Y>0.03331069</Y>
      <Z>-0.04895301</Z>
    </HandOffset>
    <HandYPR>
      <X>0</X>
      <Y>-1.35</Y>
      <Z>0</Z>
    </HandYPR>
    <HUDScale>1</HUDScale>
    <HUDOffset>
      <X>0</X>
      <Y>-0.06391386</Y>
      <Z>-0.0002981975</Z>
    </HUDOffset>
  </ModItemModelDataXML>
</ArrayOfModItemModelDataXML>

SkillData.xml :
Code: [Select]
<?xml version="1.0"?>
<ArrayOfModSkillDataXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ModSkillDataXML>
    <ItemID>SteelSword</ItemID>
    <MineReq>0</MineReq>
    <UseReq>10</UseReq>
    <UseSkill>Building</UseSkill>
    <CraftReq>10</CraftReq>
    <CraftSkill>Building</CraftSkill>
  </ModSkillDataXML>
</ArrayOfModSkillDataXML>

I know I haven't added a texture in yet but the aim of this is for it to be a negative light block. This means that it will get rid of all light around it. I made an ideas topic found here ages ago but I'm planning on making a mod for it now :P

Cheers,
Crab.

You won't be able to create a negative light block from xml, the games lighting engine doesn't support it.

Notes:
1. You don't need to supply the ItemCombatData.xml and ItemModelData.xml files unless you're actually modding that data, which you typically wouldn't do when modding a block.
2. Blocks generally don't have Durability, StrikeDamage or StrikeReach.
3. In ItemTypeData.xml, Class is typically None for blocks. Model and Swing are typically Block, and Equip is typically LeftHand for blocks.
4. ItemID in SkillData.xml should be NegativeLightBlock.

FatbFFA

  • Supreme Member
  • *
  • Posts: 2103
    • View Profile
    • ::)
  • Xbox: ETTP & Mr Zincy
Re: TM PC Modding API
« Reply #67 on: December 07, 2016, 07:45:53 PM »
Another question, if I supply both 16,32 pixel textures when someone goes from a 32 pixel TP or 64 to a 16 will it swap to the 16x16 texture and the same for going from 16 to 32 or 64?
 



Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: TM PC Modding API
« Reply #68 on: December 07, 2016, 08:07:49 PM »
Another question, if I supply both 16,32 pixel textures when someone goes from a 32 pixel TP or 64 to a 16 will it swap to the 16x16 texture and the same for going from 16 to 32 or 64?
Yes, otherwise it would be kind of pointless right?

.ok

  • Supreme Member
  • *
  • Posts: 2212
    • View Profile
Re: TM PC Modding API
« Reply #69 on: December 08, 2016, 12:51:04 AM »
If I wanted to make a mod for decals,would it be under texture pack?or would it fall Under the rules for adding blocks?