How do I remove a tag from a mod?

Post your mods and custom content here

How do I remove a tag from a mod?

Postby Madara Uchiha » Sun Sep 22, 2013 8:11 am

The title says it all.

Say I want to cancel the tree chopping sound in a mod (not replace, remove). How do I go about doing it? Do I replace it with an empty tag?
Madara Uchiha
 
Posts: 120
Joined: Sat Nov 17, 2012 1:57 pm

Re: How do I remove a tag from a mod?

Postby BlueSteelAUS » Sun Sep 22, 2013 8:44 am

just delete the sound tag.. from that item/action

make sure you have a backup copy though before you do anything..
User avatar
BlueSteelAUS
 
Posts: 785
Joined: Sun Dec 11, 2011 10:37 pm
Location: Nanango, Qld, Australia

Re: How do I remove a tag from a mod?

Postby Madara Uchiha » Sun Sep 22, 2013 9:09 am

The point is to make a modloader mod :D I know I can remove it from the original file.
Madara Uchiha
 
Posts: 120
Joined: Sat Nov 17, 2012 1:57 pm

Re: How do I remove a tag from a mod?

Postby Varsh » Sun Sep 22, 2013 9:28 am

Firstly you'll want to create a Mod which is pretty simple. Go to:

%userprofile%\.towns\mods\[MyModName]\data

In the data directory create the file "actions.xml". At the top of the file have this:
Code: Select all
<?xml version"1.0" encoding="UTF-8"?>

In the game's actions.xml file there is an ID called "qchop" which is the action that chops down trees, what you want in your mod is to disable this action and replace it with your own by doing the following:
Code: Select all
<delete id="qchop" />

Then to re-add the action without the sounds just copy the exact action like how it was with the original file but without the sound like this:
Code: Select all
   <action>
      <id>qchop</id>
      <name esES="Talar">Chop</name>

      <generatedItem>rmwood</generatedItem>
      <priorityID>terrainchange</priorityID>
      <queue>
         <move useSource="true">tree,tree2,snowtree,jungletree,palmtree,deadtree</move>
         <move useSource="true">tree,tree2,snowtree,jungletree,palmtree,deadtree</move>
         <destroyCellItem />
         <createItem>rmwood</createItem>
      </queue>
   </action>

All I did essentially was to remove the <wait fx="fxchop" fxTurns="5">27</wait> tag. That should do it for you but remember to enable it in the options!
Mods - Realism Mod (will be added soon)
Tutorials - Creating maps
Varsh
 
Posts: 23
Joined: Sun Sep 22, 2013 12:11 am

Re: How do I remove a tag from a mod?

Postby Madara Uchiha » Sun Sep 22, 2013 9:30 am

The actual mod I'm trying to do is to remove the rooster sound effect from the Day event, the Event doesn't have a <queue> that can be replaced entirely, will it still work?
Madara Uchiha
 
Posts: 120
Joined: Sat Nov 17, 2012 1:57 pm

Re: How do I remove a tag from a mod?

Postby Varsh » Sun Sep 22, 2013 9:41 am

It's done the exact same way as chopping but instead of in the actions.xml file you'll want to create an events.xml file in the same directory. after the first XML line do this:
Code: Select all
<delete id="day" />

The original "day" for the event is:
Code: Select all
   <event>
      <id>day</id>
      <name esES="Día">Day</name>

      <icon>event_day</icon>
      <order>1</order>
      <spawnAtRandom>false</spawnAtRandom>
      <fxRunning>fxrooster</fxRunning>

      <turns>2000</turns>
      <afterEvents>preevening</afterEvents>
   </event>

All you need to do is remove the line <fxRunning>fxrooster</fxRunning> and add the entire code straight after the delete line so you should have the following in events.xml:
Code: Select all
<?xml version"1.0" encoding="UTF-8"?>
<delete id="day" />
<event>
   <id>day</id>
   <name esES="Día">Day</name>

   <icon>event_day</icon>
   <order>1</order>
   <spawnAtRandom>false</spawnAtRandom>

   <turns>2000</turns>
   <afterEvents>preevening</afterEvents>
</event>
Mods - Realism Mod (will be added soon)
Tutorials - Creating maps
Varsh
 
Posts: 23
Joined: Sun Sep 22, 2013 12:11 am

Re: How do I remove a tag from a mod?

Postby Madara Uchiha » Sun Sep 22, 2013 10:27 am

Aha! `<delete id=` that was what I was missing! Thank you! Currently I've created an empty none.ogg and redirected to there :D Your approach is better. Thank you!
Madara Uchiha
 
Posts: 120
Joined: Sat Nov 17, 2012 1:57 pm

Re: How do I remove a tag from a mod?

Postby BlueSteelAUS » Sun Sep 22, 2013 1:12 pm


How do I remove a tag from a mod?



thats what you asked.. and i answered

not

How do you make a mod that deletes a tag from xxxxxx

which is what you corrected in your reply to mine. I'm glad you got the answer you needed , the trick is in asking the right question.
(and no i'm not trying to be smart.. if you'd have asked the right question I'd have answered you with the correct answer to what you meant to be asking)
User avatar
BlueSteelAUS
 
Posts: 785
Joined: Sun Dec 11, 2011 10:37 pm
Location: Nanango, Qld, Australia

Re: How do I remove a tag from a mod?

Postby Madara Uchiha » Sun Sep 22, 2013 5:03 pm

Yes, you're right. I myself fell to the kind of things I preach others about. I need to review my asking skills once more :) http://stackoverflow.com/users/871050/madara-uchiha
Madara Uchiha
 
Posts: 120
Joined: Sat Nov 17, 2012 1:57 pm


Return to Modding

Who is online

Users browsing this forum: No registered users and 5 guests

cron