HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Button based sell system

01-26-2003, 10:23 AM#1
Hivemind
Someone asked about this on another forum. This is the system we use. It uses triggers only so u dont need to mess with editing abilites. First modify one of the unused neurtal passive units to create a sell button. Change these unit values on the unit...

Name to - Sell

Interface Icon to - ReplaceableTextures\CommandButtons\BTNPeriapt.blp

Tool Tip to - S|cffffcc00e|rll Building

Hotkey to - E

Exstended Tooltip to - Returns 75% of the gold value

You wont need to mess with any other unit stats if you use a neutral passive. On non passive set gold and lumber cost to 0 and build time to 1.

Now create this trigger....

Name
Sell

Event
Unit owned by player X finishes training a unit

Conditions
Unit type of trained unit equil to sell

Events
Player- Add(intiger(((Real((Point-Value of (Triggering unit)))) x 0.75))) to (Owner of(Triggering unit)) Current gold

Special effect - Crate special effect at (Possiton of (Triggering unit)) Using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl

Unit- Remove (triggering unit) from the game

Unit - Remove (Traned unit) from the game

Now you will need to change the point value of each unit that can sell to equil its gold cost. Give each sellable unit the ability to build Sell. If its only buildings you want to sell thats all you need to do. If you make a non building able to sell and dont want a rally flag sticking out of his head create a small region named Rally where you can put the rally flag. It could be off playable map area or in a location you want a flag to sit. Now make this trigger....

Name
Rally

Event
Unit - A unit enters (playable map area)

Conditions
((Entering unit) is A structure) Equil to False

Events
Unit - Order (Entering unit) to set rally point to (Center of rally<gen>)

In our TD we put the rally flag near each players monster shop. For that you will need a region and seporate trigger for each player.
02-15-2003, 03:24 AM#2
Guest
neat!
02-24-2003, 12:25 PM#3
FyreDaug
Old news, but nicely worded.