Author Topic: Custom shops  (Read 3066 times)

mango123

  • Posts: 7
  • Maggot Crusher.
    • View Profile
Custom shops
« on: August 24, 2013, 11:42:31 PM »
I have been wondering how you would make custom shops like how it is in the defense map. If you can help me then thanks :D

MadMan

  • Posts: 96
  • Faggot Crusher.
    • View Profile
Re: Custom shops
« Reply #1 on: August 25, 2013, 11:56:41 AM »
Hi, if you are talking about buying fire shooters, then i can help. Basically, what happens in the map, is when you buy a fire shooter, it sends a global event trigger, so say it sent out something like FIRE, the global event trigger would be looking for FIRE, and if it's true, you can connect it to something, when it becomes true, but to do this whole process seems complicated at first, but it's really easy. In the assets folder after you got the resources, there's a tweakl, and in this tweak, are xml files saying shared.xml, knight.xml, wizard.xml, warlock.xml, ranger.xml. In these xml files, you can edit the shops of each class, so in knight, i could copy and paste a level 5 sword damage, and make a level 6 sword damage, allowing me to change the price, the damage, and the prerequisites of it. So in this case, you would go into shared.xml  and heres my example:

      <dictionary id="drk2" cost="1000" cat="lig1" shared="true"
         name="Light Lvl1" desc="Light up the darkness, and unlock a new area..." />

So, the dictionary id, has to be it's own thing you cant have 2 of the same id, or you will get a crash. I named it drk2. The cost is 1000 obviously. Now, the cat, is the kinda id thing. Basically, when you have off1, off2, this can be lig1, lig2. If you put lig1 in the shop, it will come up with this. The dictionary id, is the id which will be sent to a global event trigger, so if you have a global event trigger looking for drk2, and you buy this in your shop, it will activate. The shared = true, means that it can only be bought by 1 person, so like the fire  shooters. The name, common sense, the desc also common sense.

Heres an example of my shared.xml: http://pastebin.com/baWgqz9D

Also, if you have a shop on one floor, and want it to work on another floor, you get a global event trigger, which activates a global variable, and then on the other floor, you have a check global varibable, and you activate it like this, although me myself, i have been having problems with getting it to work on different floors.


mango123

  • Posts: 7
  • Maggot Crusher.
    • View Profile
Re: Custom shops
« Reply #2 on: August 25, 2013, 09:09:35 PM »
Wow thanks this helps alot :D