wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > General Development
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 10-04-2009, 02:02 AM   #1
SuperLoser
User
 
Join Date: Aug 2007
Posts: 17

SuperLoser has little to show at this moment (4)

Default Options for upgrading a unit?

Hi, I am figuring out what options I have for setting up upgraded units, but I have not found any really suitable solutions.

[Concept]
For a footman wars styled map, I have created a building that periodically spawns Black Dragon Whelps. Black Dragon Whelps can be upgraded to Black Drakes, which can also be upgraded to Black Dragons. The units will have different food costs and gold costs, so upgrading will require that the player has enough gold and food to cover each transformation.

[Attempts]
Here are the attempts I have made for the above concept:

1. Custom Destroyer Form
In this case I set up two custom Destroyer Form abilities, one that allows the Whelp to upgrade to the Drake and one that allows the Drake to upgrade to the Dragon.

This is the first attempt I made and what gave me the idea to begin with. Unfortunately it seems that custom versions of Destroyer Form will only cover the resource costs for one unit; if I have enough gold and food to upgrade one Whelp to a Drake, and I select the upgrading option across a group of Whelps, all the Whelps will be upgraded.


2. Selling Units and triggers
The second attempt I tried was by creating dummy units that would have the difference in resource costs. I created triggers such that if the dummy unit were hired, the hired unit would be removed and the unit which the unit was hired from would be replaced by its respective unit.

Example:
Normally a Whelp requires 3 food and Drake requires 5 food. I made a dummy Drake unit that costs 200 gold and requires 2 food, and made the unit hired from the Whelp. Whenever the dummy Drake unit is hired, it and the Whelp would be removed and an actual Drake would be created in the Whelp's place. The Whelp disappearing from the current selection could be fixed with a call to select the new unit into the current selection (as if the Whelp actually transformed into the Drake).

However this attempt has the nasty side effect of ruining control groups. And now that I think about it, this could also cause shenanigans involving buffs/debuffs on the Whelp (such as escaping out of ensnares or webs, or "dispelling" slow or curse), so I guess this was always a pretty bad idea...


3. Selling Units, triggers and Chaos
This attempt was like attempt 2, except instead of removing the Whelp/Drake, I used Chaos to transform the unit into a Drake/Dragon.

I was able to make the Whelp transform into a Drake, but it seems that the transformation was not complete; the transformed unit would still be selling dummy Drakes, like a Whelp would, instead of selling dummy Dragons.


If possible, I would like to hear if anybody has better ideas on how I can create upgradeable units that also honor requirements for food and gold costs, and also have little to no side effects. Thanks to anyone that reads this topic and replies.
SuperLoser is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 10-04-2009, 03:06 AM   #2
Alevice
It feels good
 
Alevice's Avatar
 
Join Date: Mar 2006
Posts: 1,305

Alevice is a jewel in the rough (190)Alevice is a jewel in the rough (190)Alevice is a jewel in the rough (190)

Default

Quote:
Originally Posted by SuperLoser
This is the first attempt I made and what gave me the idea to begin with. Unfortunately it seems that custom versions of Destroyer Form will only cover the resource costs for one unit; if I have enough gold and food to upgrade one Whelp to a Drake, and I select the upgrading option across a group of Whelps, all the Whelps will be upgraded.

This is something that I absolutely hate of the ability.

In any case, just use the normal upgrade methods, the same used for buildings. If you are using JGNP, the field Upgrades to should be immediately available ion the Unit Editor. Otherwise, just check temporarily the Is a Building field so the Upgrades to field shows up. Then just uncheck the Is a Building field again and voila.
__________________
_-|-_

Alevice.jones is SC2 Beta, losers.

Check out my never updated deviantart gallery!!

Kalimdor Raiders (Race Contest #1) Pastebin Page
Cavern Crawlers (Race Contest #2) Pastebin Page
Airship Race Motherfuckers!
Quote:
Originally Posted by http://ajaxian.com/archives/would-you-like-a-_-with-that-new-library-gives-js-what-it-should-have#comment-276203
- Dont solve problems that dont exist.
- Improve the wheel, dont reinvent it.
- Port the wheel if it doesnt exist in your environment.
- Integrate the wheel into your project.
- Make sure you can replace your wooden wheel for a rubber one if someone else invents it.
Alevice is offline   Reply With Quote
Old 10-04-2009, 03:06 AM   #3
Anopob
Yay!
 
Anopob's Avatar
 
Join Date: May 2006
Posts: 870

Anopob has a spectacular aura about (120)

Default

1. How come? Melee games don't do this with Destroyers (obviously), so either it's hardcoded or you have wrong options selected for the spell's values.

2. ---

3. You can either use a dummy spell and detect this (and just putting the gold/lumber/food costs in the tooltip, check it in a trigger), or have the same food/lumber/gold cost/difference between Whelp -> Drake, and Drake -> Dragon (for example, Whelp -> Drake is 300 gold, 200 lumber, 2 food. Drake -> Dragon is 300 gold, 200 lumber, 2 food) and have the tooltip say like Evolve or something, and then change accordingly.

Another method; couldn't you have a REAL upgrade that change's X unit's unit types? Such as troll headhunter -> troll berserker (or whatever the name is)?

edit: Damn didn't see Alevice.
__________________
Give +REP to people who help you with things or make good resources.
Better Ways of Requesting For Help - Race Contest #2 WIP Thread (Bone Race)
As of December 1st I have my blue rep. Yay :D

Last edited by Anopob : 10-04-2009 at 03:06 AM.
Anopob is offline   Reply With Quote
Old 10-05-2009, 01:33 AM   #4
SuperLoser
User
 
Join Date: Aug 2007
Posts: 17

SuperLoser has little to show at this moment (4)

Default

Quote:
Originally Posted by Alevice
This is something that I absolutely hate of the ability.

In any case, just use the normal upgrade methods, the same used for buildings. If you are using JGNP, the field Upgrades to should be immediately available ion the Unit Editor. Otherwise, just check temporarily the Is a Building field so the Upgrades to field shows up. Then just uncheck the Is a Building field again and voila.
Wow that works great =] Thank you so much for your help Alevice. +Rep
SuperLoser is offline   Reply With Quote
Old 10-05-2009, 03:38 AM   #5
Ignitedstar
Moderator
 
Ignitedstar's Avatar


RP Section Moderator
 
Join Date: Jul 2005
Posts: 1,755

Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)

Send a message via MSN to Ignitedstar Send a message via Yahoo to Ignitedstar
Default

Hey, this is something that I should've used in my race. Then I wouldn't have had that crazy, funky error.
__________________
Current Activity: It's a secret, now.
Evaluation: I actually logged in?!?!
"If I speak in the tongues of men and of angels, but have not love,
I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all knowledge,
and if I have a faith that can move mountains, but have not love, I am nothing."

1 Corinthians 13:1-2

Current Works:
None.
Ignitedstar is offline   Reply With Quote
Old 10-05-2009, 05:33 AM   #6
Alevice
It feels good
 
Alevice's Avatar
 
Join Date: Mar 2006
Posts: 1,305

Alevice is a jewel in the rough (190)Alevice is a jewel in the rough (190)Alevice is a jewel in the rough (190)

Default

you never asked asshole :P
__________________
_-|-_

Alevice.jones is SC2 Beta, losers.

Check out my never updated deviantart gallery!!

Kalimdor Raiders (Race Contest #1) Pastebin Page
Cavern Crawlers (Race Contest #2) Pastebin Page
Airship Race Motherfuckers!
Quote:
Originally Posted by http://ajaxian.com/archives/would-you-like-a-_-with-that-new-library-gives-js-what-it-should-have#comment-276203
- Dont solve problems that dont exist.
- Improve the wheel, dont reinvent it.
- Port the wheel if it doesnt exist in your environment.
- Integrate the wheel into your project.
- Make sure you can replace your wooden wheel for a rubber one if someone else invents it.
Alevice is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 04:24 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services