Mass Unlock mod

Post your mods and custom content here

Mass Unlock mod

Postby coteyr » Thu Sep 26, 2013 10:22 pm

So I am trying to create a mod that will add a menu item to the bottom bar that will let me unlock many things at once. The idea is to help when you need to expand a farm or move a building or something.

So in my mod folder/data/menu.xml

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

<menu>
<item id="mass_unlock" name="Unlock" esES="Arar" code="CUSTOMACTION" parameter="unlock" icon="ui_cancel" />
</menu>



This is just placeholder stuff I will fix the translations and make a better icon later, but here's the problem. It doesn't do anything. It doesn't unlock anything. It lets me highlight an area, but doesn't actually unlock anything. I believe that the issue is that "unlock" isn't the right parameter, and that I need some other keyword. Any tips?

There is also the possibility that "unlock" isn't a real "action" and I need to use another code or that it's hard coded and my idea is dead in the water.
coteyr
 
Posts: 103
Joined: Thu Sep 26, 2013 10:16 pm

Re: Mass Unlock mod

Postby caprontos » Thu Sep 26, 2013 10:27 pm

you could try UNLOCK but I doubt it will work.. :D
Image
Cha Cha Cha!
User avatar
caprontos
 
Posts: 3930
Joined: Wed Apr 04, 2012 3:18 am

Re: Mass Unlock mod

Postby coteyr » Thu Sep 26, 2013 10:35 pm

Nope, didn't do a thing. There must be an action/code/something for is somewhere,cause it exists in right click, but I don't know what it is.
coteyr
 
Posts: 103
Joined: Thu Sep 26, 2013 10:16 pm

Re: Mass Unlock mod

Postby JackPS9 » Thu Sep 26, 2013 10:38 pm

just cause its in the right click just means in part of the hardcode, the problem is that the game may not have a unlock that can be used in the files seeing how its put on all items automaticaly including modded items.
JackPS9
 
Posts: 1088
Joined: Mon Sep 03, 2012 4:15 pm

Re: Mass Unlock mod

Postby coteyr » Thu Sep 26, 2013 10:43 pm

Yeah that's kinda what I meant. From what I can gather, if I knew the secret kung-fu for unlocking it should work. But I would have to know what things to call.

The unlock items mod did:

Code: Select all
<action>
    <id>unlock_purplethrone</id>
    <name esES="N/A">Unlock</name>
    <priorityID>itemconstruction</priorityID>
    <queue>
      <move useSource="true">purplethrone</move>
         <DestroyCellItem />
         <createItem>purplethrone</createItem>
    </queue>
  </action>


Which looks like it created a new item in the same location as the old item, consuming the item in the process. That could work for me, but I wonder if there is just some thing to call to that could do that, or if there is a way to just useSource on whatever is in that square. Maybe the command is "move".

Thinks that can be unlocked have a <unlock/> element in the items.xml file. So I am hoping there is a way to tie into that sort of writing some pearl or something to parse and make a big file of actions for "fake unlocking"
coteyr
 
Posts: 103
Joined: Thu Sep 26, 2013 10:16 pm

Re: Mass Unlock mod

Postby coteyr » Thu Sep 26, 2013 10:44 pm

I don't suppose theres and API document around here somewhere?
coteyr
 
Posts: 103
Joined: Thu Sep 26, 2013 10:16 pm

Re: Mass Unlock mod

Postby JackPS9 » Thu Sep 26, 2013 10:48 pm

coteyr wrote:I don't suppose theres and API document around here somewhere?

the first thing with any document was events and its the only thing with any sort of document.
JackPS9
 
Posts: 1088
Joined: Mon Sep 03, 2012 4:15 pm

Re: Mass Unlock mod

Postby coteyr » Thu Sep 26, 2013 10:58 pm

Code: Select all
<item id="cancel" name="Cancel order" esES="Cancelar orden" code="CANCELORDER" icon="ui_cancel" />


This works so unlock will too I just need to find/guess/be told what the correct code is. I just don't know any way to poke around and find out what the valid code values are.
coteyr
 
Posts: 103
Joined: Thu Sep 26, 2013 10:16 pm

Re: Mass Unlock mod

Postby JackPS9 » Thu Sep 26, 2013 11:00 pm

coteyr wrote:
Code: Select all
<item id="cancel" name="Cancel order" esES="Cancelar orden" code="CANCELORDER" icon="ui_cancel" />


This works so unlock will too I just need to find/guess/be told what the correct code is. I just don't know any way to poke around and find out what the valid code values are.

the devs intended for the cancel order though, does not mean they allow for unlocking.......
JackPS9
 
Posts: 1088
Joined: Mon Sep 03, 2012 4:15 pm

Re: Mass Unlock mod

Postby coteyr » Thu Sep 26, 2013 11:02 pm

Ok, the magic code is UNLOCK, but you need to pass it some integer params. Looks like location.

More tinkering.
coteyr
 
Posts: 103
Joined: Thu Sep 26, 2013 10:16 pm

Next

Return to Modding

Who is online

Users browsing this forum: No registered users and 5 guests

cron