• 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.

Player leaves game, adding to player x gold ( and 20 gold for each minutes)

Status
Not open for further replies.
Level 6
Joined
Sep 24, 2015
Messages
174
Hello, here's the trigger i want to do :

A player leaves the game ---> add to player x the current amount of gold of the leaving player + 20 gold for each minutes the leaving player was in the game.

I knoww i need arithmatic but i don't know how to do the thing.
 
Level 23
Joined
Feb 6, 2014
Messages
2,466
Keep track of time
  • Time Update
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Set elapsedMinute = (elapsedMinute+ 1)
Then add the gold when player leaves
  • Player Leave
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • ...
      • ...
      • Player - Player 12 (Brown) leaves the game
    • Conditions
    • Actions
      • Set goldToAdd = (((Triggering player) Current gold) + (20 x elapsedMinute))
      • Player - Add goldToAdd to Player X Current gold
 

Ardenian

A

Ardenian

Yes, gold and lumber are integer values.
Does 5.3521 lumber, as real value, makes sense ? It might, but Warcraft 3 use integers for these.

You can easily find out what is needed. If you choose an action, for example:
  • Player - Add goldToAdd to Player X Current gold
and you click on goldToAdd,
then you can choose either a variable or from a bunch of different options.
The third option is something with 'Load integer value from hashtable'. Now you know you need an integer.
 
Status
Not open for further replies.
Top