HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trading Ability for RTS Map! Help!

12-08-2004, 12:43 AM#1
cfmonkey45
I need a trading trigger where your trader has to select a destination (allied market), and can either bring back wood, or gold (your choice).

I tried previous attempts to use the Gather (goldmine harvest) and i got no luck.
plz help!
12-08-2004, 01:56 AM#2
cfmonkey45
srry for double posting, but i found something out.
In order to do this you need a function, so whoever can make a function for me, i will give gold to. :8
12-09-2004, 06:08 AM#3
Guest
OK:
What about making a trigger like the one in "Battle Ships" on Bnet?
You buy a contract at A1, you sail to for example B1 and when you reaches and area you get the gold (or ale or wood or whatever).......
When you got back, the trigger takes your thing (gold, wood, whatever again)..?

Also you can gve people the contract, or make a button that chooses destination.........


Try that.
12-09-2004, 06:01 PM#4
AntJAB
Bah, drop your battle ship on a rusty spoon and sink it.

Create the option at your market to make two type of traders.
One with an ability (that does nothing) called Trading for Wood.
The other with Trading for Gold.

On creation of the unit order it to patrol from your market to the location of the nearest allied market. (If you don't know hwo to trigger this, I can help.)

Make a trigger so when a trader comes within say a 300 range of a market it will do the following things:
IF- the trader is owned by the same player as the market and the trader has the ability "Full of Wood" then remove ability and add ability "Trading for Wood" and add 100 lumber to the owner of unit's lumber stock
IF- the trader is owned by a different player as the moarket and the trader has the ability "Trading for Wood" then remove ability and add ability "Full of Wood"

Now you don't have to deal with ugly items.
Also if you want to make it more interesting you can use floating text to show that you just recieved the gold/wood.
Or to make it actualy interesting set it so when a trader is "Full of Wood" it will drop a bundle of wood on death for anyone to claim.

Hope that helps.
12-15-2004, 01:21 AM#5
cfmonkey45
Yah thanks.
12-15-2004, 12:02 PM#6
AntJAB
No problem... <.< >.>
*cough -rep- cough*
Erm, sorry, something in my throat.
;)
12-15-2004, 10:52 PM#7
cfmonkey45
sorry for double posting again, but i havent been able to have my unit carry out the trigger, as when it selects the unit, it won't move because it says: "You must target a Market!" (My else action in this trigger)
select
Code:
Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Unit-type of (Casting unit)) Equal to Wagon
        (Ability being cast) Equal to Set Destination (frostnova)
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Target unit of ability being cast)) Equal to Market
                (Owner of (Target unit of ability being cast)) Not equal to (Owner of (Casting unit))
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Custom value of (Casting unit)) Not equal to 0
                    Then - Actions
                        Unit - Order (Casting unit) to Move To (Position of (Target unit of ability being cast))
                    Else - Actions
                        Advanced - For (Owner of (Casting unit)) display You must specify a resource to trade for to initialize trading! as error message
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Target unit of ability being cast)) Not equal to Market
                    Then - Actions
                        Advanced - For (Owner of (Casting unit)) display You Must Target a Market! as error message
                    Else - Actions
                        Do nothing
12-15-2004, 11:41 PM#8
harshateja
Dunno if you wanted this but according to what you currently have, you have to trade with a market of a different owner? If you were targeting your own market it would give that error messege. Another thing that might help is to change the event to a "unit begins casting an ability" or a "unit begins the effect of the ability" to prevent bugs.
12-16-2004, 09:41 PM#9
AntJAB
Let's see... I don't know why it wouldn't work, but I did notice some uneeded code.
You have two checks for if the target of the spell is a market.
The first If statement and the third If statment.
You can remove the If-Then-Else under the Else of the main trigger and just leave the display text under the else.

As for why it doesn't work I have these suggestions:
Make sure you are targeting a Market not owned by you.
Make sure your unit type of Market is the correct Market, and you didn't choose a duplicate market then what you have placed.
Make sure the custom value of the caster is correct.

Good luck man.