• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

divert leaving players's resource

Status
Not open for further replies.
Level 2
Joined
Jun 11, 2004
Messages
13
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.
 
Level 13
Joined
Jan 9, 2004
Messages
1,037
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.
 
Level 13
Joined
Jan 9, 2004
Messages
1,037
@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).
 
Level 13
Joined
Jan 9, 2004
Messages
1,037
Ok, here's what you do:

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:
Code:
Events
--Player - Player 1 (Red) leaves the game
Conditions
Actions
--Set Gold = (Player 1 (Red) Current gold)
--Set Lumber = (Player 1 (Red) Current lumber)
Code:
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)
That's all.
 
Status
Not open for further replies.
Top