Coding help

Post your mods and custom content here

Coding help

Postby methebest222 » Thu Sep 12, 2013 12:58 am

I am modding a in crossbows, but my towns crashed when I tried to use it. :cry:
Here I have the error message:
Code: Select all
[Sep 11, 2013 6:48:58 PM][ActionManager] Error reading [/Users/Dan/.towns/mods/Crossbow/data/actions.xml] [Empty ID]

And my codes in the three modfied files
Code: Select all
 <?xml version="1.0" encoding="UTF-8"?>
<items>
<crossbow>
      <level>10</level>
      <name esES="Ballesta">Crossbow</name>
      <type>weapon.wood</type>

      <ranged>true</ranged>
      <rangedAmmo>woodenarrow</rangedAmmo>

      <location>WEAPON</location>
      <attack>1d44+186</attack>
      <defense>1d10+23</defense>
      <damage>1d110+355</damage>
      <LOS>1d3+3</LOS>
      <verb esES="ensarta">sticks</verb>
      <verbInfinitive esES="ensartar">stick</verbInfinitive>

      <stackable>true</stackable>
      <stackableSize>1</stackableSize>
      <tags>bow</tags>
      <value>150</value>
   </crossbow>
</items>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<action>

      <id>qcrossbow</id>

      <priorityID>itemconstruction</priorityID>

      <queue>
         <lock>carpentrybench</lock>
         <pick>rmwood</pick>
         <move>carpentrybench</move>
         <wait>20</wait>
         <destroyItem />
         <unlock />
         <lock>wooddetailer</lock>
         <pick>rmwood</pick>
         <move>wooddetailer</move>
         <wait>32</wait>
         <destroyItem />
         <lock>anvil</lock>
         <pick>rmiron</pick>
         <move>anvil</move>
         <wait>16</wait>
             <lock>smelter</lock>
         <move>smelter</move>   
<wait>16</wait>   
   <destroyItem />      
   <unlock />
         <createItem>crossbow</createItem>
      </queue>
   </action>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?> <menu>

<militaries name="Militaries" esES="Militares" icon="ui_rmilitary"><weapons name="Weapons" esES="Armas" icon="ui_rweapons">
<iron name="Iron" esES="Hierro" icon="ui_rweapon_iron">
               <item id="qcrossbow" code="QUEUE" parameter="qcrossbow" />
         </iron>
</weapons>
</militaries>
</menu>


Oh and BTW, I need graphics for the crossbow, if anyone is willing to help me with this.
methebest222
 
Posts: 49
Joined: Thu Mar 28, 2013 4:52 pm

Re: Coding help

Postby caprontos » Thu Sep 12, 2013 2:24 am

For your action.xml your missing the second set of action tags. around it , change it to:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<action>
   <action>

      <id>qcrossbow</id>

      <priorityID>itemconstruction</priorityID>

      <queue>
      <lock>carpentrybench</lock>
      <pick>rmwood</pick>      
      <move>carpentrybench</move>      
      <wait>20</wait>      
      <destroyItem />
      <unlock />
      <lock>wooddetailer</lock>
      <pick>rmwood</pick>
      <move>wooddetailer</move>
      <wait>32</wait>
      <destroyItem />
      <lock>anvil</lock>
      <pick>rmiron</pick>
      <move>anvil</move>
      <wait>16</wait>
      <lock>smelter</lock>
      <move>smelter</move>   

      <wait>16</wait>   
      <destroyItem />     
      <unlock />
      <createItem>crossbow</createItem>
      </queue>
   </action>
</action>


As for a graphic.. I'll add the old militaries.png that has one drawn by Ben that you can use.. I need to find it first though..

Edit:
Here:
http://www.mediafire.com/view/uux8lbsq8 ... litary.png

It should work fine as is.. But if your good with it can change it how you please of course.

In that graphic I think it is at X = 9 and Y = 10..
Image
Cha Cha Cha!
User avatar
caprontos
 
Posts: 3930
Joined: Wed Apr 04, 2012 3:18 am

Re: Coding help

Postby methebest222 » Thu Sep 12, 2013 2:28 am

Awesome! Thanks!

I also found a completly grey crossbow sprite. I'll colour it.
methebest222
 
Posts: 49
Joined: Thu Mar 28, 2013 4:52 pm

Re: Coding help

Postby caprontos » Thu Sep 12, 2013 2:34 am

methebest222 wrote:Awesome! Thanks!

I also found a completly grey crossbow sprite. I'll colour it.


Ok yeah, that is because old towns used a color tag to color.. and they changed it to everything having it's own sprite.. I'll leave the edited in picture anyways in the off chance someone else wanted it :S haha.

Not sure why they scraped the crossbow though..

And your welcome.
Image
Cha Cha Cha!
User avatar
caprontos
 
Posts: 3930
Joined: Wed Apr 04, 2012 3:18 am

Re: Coding help

Postby methebest222 » Thu Sep 12, 2013 3:19 am

Could someone maybe do a recolour of the crossbows in this picture? I dont know how to make it look good. https://www.dropbox.com/s/1lfg71tvaescx15/military.png

I want it wooden brown, maybe with iron frame bits.
methebest222
 
Posts: 49
Joined: Thu Mar 28, 2013 4:52 pm

Re: Coding help

Postby YetiChow » Sat Sep 14, 2013 5:55 am

methebest222 wrote:Could someone maybe do a recolour of the crossbows in this picture? I dont know how to make it look good. https://www.dropbox.com/s/1lfg71tvaescx15/military.png

I want it wooden brown, maybe with iron frame bits.


For one, there was no need to post that pic - everyone already has it in their game folder, so I'm sure you could have just said "the unfinished crossbow in the militaries picture"... still, saving me the effort of digging it out is appreciated :lol:

For seconds: I just happened to have some experiece with this particular sprite, having used it for a mod already. It's a pain to recolour since it's so blended with its black-and-white-ness, but I've had plenty of practice :lol:

So, here are some slighty more realistic crossbows complete with wooden stocks; metal cranks and ratchets; "worky bits"; and wollen strings - or at least some grey and brown bits which resemble the above list of crossbow parts :lol: They look pretty good at 400% scale, but at normal scale there's not much detail... although they are recognisable :P

https://www.dropbox.com/s/rk6m1axjyta770d/Crossbows.png

One little tip for the future though: your request sounds a little bit "I want this, I want that", it would probably have been a good idea to include at least a "please". If you ask "would someone please do X with X coloured bits", you'll probably get a quick response; "could somone do X, I want X and X with that" might get responses such as "we could, but we won't", "why should we?" or "would you like fries with that too?" - all of those are unlikely, but each one picks up on an 'assumption' you make with your original request: that there's someone waiting and wanting to do it. Now, there actually ARE people who like doing these kinds of request, but nobody likes to feel as though everyone expects them to just do work for anyone who anyone who asks. I'm nitpicking here, I just have a serious thing about "entitlement" at the moment... in short, I'm not saying that you've done anything "wrong", just trying to spread some hints around about how to keep everyone happy :)

Anyway, good luck with your mod and let me know if there are any issues with the sprites.
What's that you're eating? A nice, juicy apple? You weren't supposed to eat that you fool, you were supposed to make it into a pie! - last words recorded words of Francis D'Avre before he went looking for snowcherries, but found a hungry Yeti instead.
User avatar
YetiChow
 
Posts: 3149
Joined: Wed Apr 25, 2012 9:26 am
Location: Cramped between a Yeti's small intestine and its stomach... trying not to dissolve!

Re: Coding help

Postby methebest222 » Sat Sep 14, 2013 12:52 pm

Thanks for the reminder!
methebest222
 
Posts: 49
Joined: Thu Mar 28, 2013 4:52 pm

Re: Coding help

Postby LittleMikey » Sat Sep 21, 2013 2:12 pm

Trying to recolour items is quite easy to do yourself. Simply download GIMP and follow this tutorial: http://www.wikihow.com/Recolor-Anything-on-Gimp

If you use Photoshop I don't know how exactly you do it, but the process is basically the same.
User avatar
LittleMikey
 
Posts: 986
Joined: Sat Nov 10, 2012 10:32 am
Location: Perth, Australia


Return to Modding

Who is online

Users browsing this forum: No registered users and 3 guests

cron