HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Item Upgrading Trigger

01-09-2008, 02:21 AM#1
JetFangInferno
Ok, at the beginning of the map, the player chooses what element he wants to be out of 6 (fire,water,earth,wind,darkness,light). Later on, they pick their heroes. Afterwards, they see they have a building called an Upgrade Center. The player can put their items into the Upgrade Center (has 1 item slot) and press the Upgrade Ability (dummy ability that does nothing), the item will be upgraded. However, when the player puts the item into the Upgrade Center, a Floating Text should pop up in color corresponding to the element of the item (Ex. fire sword, darkness sword etc.). Fire will be red, Earth will be brown, Darkness will be purple, Wind will be light green, Light will be yellow, and Water will be blue. The text should display the Item Name, the Item's Level, and the Cost. I kinda started making this but got stuck already =/ Here's what I have so far:

Trigger:
Melee Initialization Copy
Collapse Events
Map initialization
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 10, do (Actions)
Collapse Loop - Actions
Set Element_Darkness[(Integer A)] = 1
Set Element_Earth[(Integer A)] = 2
Set Element_Fire[(Integer A)] = 3
Set Element_Light[(Integer A)] = 4
Set Element_Water[(Integer A)] = 5
Set Element_Wind[(Integer A)] = 6
Set Upgrade_Item_Name[(Integer(Fire Sword (Lvl1)))] = Fire Sword (Level 1)
Set Upgrade_Item_Name[(Integer(Fire Sword (Lvl2)))] = Fire Sword (Level 2)
Set Upgrade_Item_Name[(Integer(Fire Sword (Lvl1)))] = Fire Sword (Level 1)

Where do I go next?
01-09-2008, 02:35 AM#2
xombie
Alright, well in order to get the color displayed properly you are going to need to be able to reference the "element" given the item. There are a number of ways to do this... I'm not really sure what you're doing with the arrays that you have showing in your GUI code there though lol.

Anyways, once you're able to detect the "element" from the item, all you need to do is detect when this "Upgrade Center" unit acquires any item - based on that item, you can create a floating text of specified color. Look under 'Events':

Trigger:
Untitled Trigger 001
Collapse Events
Unit - A unit Acquires an item
Conditions
Actions

Sorry if this doesn't help a whole lot - I'm not really sure how to help you.
01-09-2008, 02:26 PM#3
JetFangInferno
I was thinking since I gave each Element a number (1-6), I would call this number up later to determine the color of the text but I'm not sure if this can be done.
01-09-2008, 02:34 PM#4
Tide-Arc Ephemera
If I had my world editor with me at the moment, I would rig up an entire GUI trigger for you just for this one task.

The way I see it, though, is that you will need a long and weary string of If/Then/Elses.
01-10-2008, 01:32 AM#5
JetFangInferno
God damn I hate If/Then/Elses ><