PDA

View Full Version : [Support] How to make abilities cost gold?



Gimatria
01-02-2011, 07:55 PM
Me again with another question :)

Working hard on my TD, and got about 24 towers finished right now.

The ability to upgrade towers can be done directly from clicking on the right ability. That way you wont have to buy an upgrade and place it on the correct tower. The idea is that almost every tower can upgrade into several other unique towers untill you have the final tower of that upgrading path. Ice towers alone will have 64 towers. (loads of work, and progress is kinda slow since i got alot of stuff to learn about coding)

To clearify, here's a screenshot:

http://uploadpic.org/storage/originals/thumb_2snj3fnndn8982kjf823nn8ffn.jpg (http://uploadpic.org/view-pic.php?img=128082)


Here's the problem: Upgrading doesn't cost any gold like this. And I can't seem to figure out how to make it work.

Here's the code from the upgrade ability.



<?xml version="1.0" encoding="UTF-8"?>
<ability
name="Ruined_IceStatue_upgrade"

icon="/heroes/tundra/icon.tga"
anim=""

cost="300"
casttime="0"
castactiontime="0"
frontqueue="true"
inheritmovement="true"

actiontype="no_target"
casteffecttype="Transmute"

manacost="0"

targetscheme="ally_buildings"

>
<onimpact>
<morph name="Ruined_IceStatue" />
<playanim name="item_1" target="source_entity" />
</onimpact>
</ability>


Thnx in advance!

Edit: I forgot to set the prefix to 'question'. How can I edit this?

Oloko
01-02-2011, 08:16 PM
To change the prefix you should be able to change in when you edit your post, at the top, next to the title.

As far as I know, there is now way to make ability cost gold. I did a lot of search about this and I was never able to find a solution. I tried several workaround too but I never found a working solution. The only solution to this is to use items that morph your tower. :(

LonJAXsoN
01-03-2011, 12:54 AM
I tried using alchemist bones to give me a negative bounty... but it just gave me max gold. Oh well...

Two things you could try:

Every time you upgrade a tower, it kills your hero and subtracts a fixed amount of gold then you respawn at a marker where you were. That would require all upgrades to cost the same amount, though.

You could try making a potion that upgrades your towers... that would only require you to buy potions.

Deaths, buying items, and buybacks are the only things that subtract gold..

Evil_Andrex
01-03-2011, 01:57 AM
*just noob talking*

What if the skill kills the tower and a new tower replaces it?

Wait... Is hero a synonym for tower in HoN td?

Gimatria
01-03-2011, 08:02 AM
Thnx for the replies. Kinda crap to see that it is only possible with buying an item and placing it on your tower :( If it is really impossible, I guess I will stop the project.

The fixed amount idea is a nice one, but then it will be way to easy to win.

Killing the tower and replacing a new one might be something. Basically the morph already does something like this, but I can see this being slightly different. I'll look into this

I've been thinking about something different, but ran into some other problems:
The solution must be mana-based.

Give a tower 0 starting mana.

Solution 1:

A creep that was killed will give mana in an area. Every Tower in the area will gain x mana. And adjust the manacost for upgrading accordingly.
Problem: Once you get enough mana you will be able to upgrade every tower. Building lots of towers in the beginning will win you the game for sure.

Solution 2:

A creep that was killed will give mana to its killer. But this will cause a snowball effect. The best tower gets all the kills, and you are unable to upgrade the other towers.
Possible solution for this: Make items that give mana.

Edit: I'm just thinking, it must be possible to have a combination between solution 1 and 2. Give the killer mana, and give the area also mana but slightly less. Think ill try this

Problem with the entire mana solution:
It will be impossible to have towers with spells that they will autocast that need mana.

Perhaps you know a mana based solution that could work? (or any other of course!)

Hoping S2 will respond to this, cause making 250 towers available in the shop as an item will be chaos for the player. It shouldn't be this hard to make something this easy.

Shadow54
01-03-2011, 08:31 AM
no idea if this works or not, but the first solution you had may work... you just add mana whenever a creep is killed (add it in a huge raidus so all towers are affected) and when any tower uses mana it subtracts mana in a huge radius... basically every tower shares the same mana...

no idea if this works but i think its worth a try

Gimatria
01-03-2011, 08:53 AM
I didn't even think about substracting mana in a large area when a tower is upgraded :)

Thnx! I'll try to make it when I've got some time.

Oloko
01-03-2011, 11:55 AM
You say that you don't want to have to put the items on the tower, but if you want, you can make the shop aura to work on building too, making it possible to select your tower and buy directly on it.

I know its still lame, but that's how I did it for mine.

Gimatria
01-03-2011, 05:00 PM
You say that you don't want to have to put the items on the tower, but if you want, you can make the shop aura to work on building too, making it possible to select your tower and buy directly on it.

I know its still lame, but that's how I did it for mine.

I tried to make this work, but it wont work for my TD. The first tower (there will be 5 different basic towers) has 4 different towers to upgrade to, and every single one of those upgrades has another 2 possible upgrades, and so on. So it will take a lot of time to get the player to know all possible upgrade for every tower.
I know i can set the requirements so players can see what are the required towers for any upgrade, but I still feel this be too much of an hassle. Ill try to work on the mana idea, and if I have any succes with it, ill post it here.

Thnx for the reply (as usual, been a great help so far with the other topics)

Reminator
01-06-2011, 11:15 AM
What about you make that Towers can buy upgrades from shop and you press ability like upgrade courier.

Like:

<onimpact>
<consume item="Item_WingedFamiliar" userecipe="true">
<morph name="Pet_FlyngCourier"/>
</consume>
<playanim name="item_1" target="source_entity" />
</onimpact>

Oloko
01-06-2011, 11:33 AM
What about you make that Towers can buy upgrades from shop and you press ability like upgrade courier.

Like:

<onimpact>
<consume item="Item_WingedFamiliar" userecipe="true">
<morph name="Pet_FlyngCourier"/>
</consume>
<playanim name="item_1" target="source_entity" />
</onimpact>

That is exactly what I'm telling him to do.

I have my old TD prototype I made more tham 1 year ago, you can download it here (http://www.mediafire.com/?2m3yuenzmnd).

Hot_To_Go
01-06-2011, 08:01 PM
Could you just have one line of upgrading instead of all the branching out choices? So there are ice towers, they only upgrade one way. You have a poison tower, they only upgrade one way.

This might make it a lot simpler to add in some of these upgrade ideas if you do not have to look at a choice of upgrades but simply take the tower to the next level?

Evil_Andrex
01-07-2011, 12:10 AM
If you want abilities to cost mana but want to use mana as costs for upgrading, maybe making abilities that would require mana have a counter instead, that steadily goes up.

Jesper
01-07-2011, 12:16 PM
Have a hero spawn with a manapool that increases every time an creep gets killed. That way you can have the heromanapool used for upgrading and purchasing, and if you want towers to have abilities that cost mana they can have their own manapool.

Gimatria
01-09-2011, 09:06 AM
I know it would be alot easier to just have 1 upgrading path, but that's not what i had in mind. Im a little bit stubborn, so ill keep working on the mana idea. Haven't had much time to work on it though. Probably will try to make it somewhere this week when i got some more time.

Severon
01-13-2011, 12:50 PM
I've thought about the mana idea a little bit as well and I can see it working out pretty well, after some minipulation, unless you are setting requirments on when the tower can upgraded/built then I have ran into some problems :/