i have been thinking for days and get no ideal of how it works.
this is what happens a player leaves the game. when a unit click on an item in the shop, it diverts all the gold and lumber of the leaving player to the player who click on the item.
how do i go about doin this please help me i have doing it for a few days and still not even a single thing came out.
Actually, it's quite easy. Just make a trigger that when the unti leaves the game, his current gold and lumber are stored in an array (or just two variables). Then, make a trigger that when the player buys the item (make a dummy item) in the market, the player adds the gold and lumber variable to his current gold and lumber. If you want, you can lso remove the itme from the unit.
I'm sorry I am a bit brief, if you still have questions or concerns please tell me and il give you step-by-step instructions on how to do it.
oz02 you're right. Had the idea with the variables too late, thought of something refering to the items attributes so the infos of gold/lumber are saved in the attributes...crazy idea.
@DarkShadow: Lol, I hate it when I do some type of triggering and it's really hard, and than I realize that I could have done it in a much easier way. ==================
I don't really have time right now to give it to you step-by-step, so i'll bookamrk this page and work on it tomorrow (if someone els doesn't get here first).
First, create a dummy item that can be bought at the shop (base it off something in the campaign folder). Than create two integers to store the amount of lumber and gold the player leaving the game has (i'll refer to them as Gold and Lumber). Now create the following triggers:
Events
--Player - Player 1 (Red) leaves the game
Conditions
Actions
--Set Gold = (Player 1 (Red) Current gold)
--Set Lumber = (Player 1 (Red) Current lumber)
Events
--Unit - A unit owned by Player 2 (Blue) Acquires an item
Conditions
--(Item-type of (Item being manipulated)) Equal to Dummy Item
Actions
--Player - Add Gold to Player 2 (Blue) Current gold
--Player - Add Lumber to Player 2 (Blue) Current lumber
--Item - Remove (Item being manipulated)