Gold/Lumb every sec.

hasslarn

New Member
Reaction score
20
Hello , will this be MUI?

Its suppose to give gold and lumber for all players each time someone trains a speciall unit.

This is just a test trigger.

Trigger:
  • test trigger
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set goldlumbinteger = (Player number of (Triggering player))
      • Set PlayerGoldlumb[goldlumbinteger] = (Triggering player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Trained unit)) Equal to |cffffcc00L|rumber Harvester (Level 1)
        • Then - Actions
          • Set LumberInterger[goldlumbinteger] = (LumberInterger[goldlumbinteger] + 1)
          • Game - Display to (All players) the text: ((String(LumberInterger[goldlumbinteger])) + Is the Lumber)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Trained unit)) Equal to |cffffcc00G|rold Harvester (Level 1)
            • Then - Actions
              • Set Goldinterger[goldlumbinteger] = (Goldinterger[goldlumbinteger] + 1)
              • Game - Display to (All players) the text: ((String(Goldinterger[goldlumbinteger])) + Is the gold)
            • Else - Actions



Trigger:
  • test triggers
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add Goldinterger[goldlumbinteger] to PlayerGoldlumb[goldlumbinteger] Current gold
      • Player - Add LumberInterger[goldlumbinteger] to PlayerGoldlumb[goldlumbinteger] Current lumber
      • Game - Display to (All players) the text: (You got + ((String(Goldinterger[goldlumbinteger])) + Gold!))
      • Game - Display to (All players) the text: (You got + ((String(LumberInterger[goldlumbinteger])) + Lumber))
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, can't really be MUI since it doesn't use any units and such but you probably want MPI so yeah, but you need to change a few things, like:

Trigger:
  • Set goldlumbinteger = (Player number of (Triggering player))
    • Set PlayerGoldlumb[goldlumbinteger] = (Triggering player)


There is no Triggering Player :( so change that to (Owner of (Triggering Unit))

And for the second trigger, you probably want to use either an integer loop or player loop, like:

Trigger:
  • Income Again
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_PGroup = (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User)))
      • Player Group - Pick every player in Temp_PGroup and do (Actions)
        • Loop - Actions
          • Player - Add GoldInteger[(Player number of (Picked player))] to (Picked player) Current gold
          • Player - Add LumberInteger[(Player number of (Picked player))] to (Picked player) Current lumber
          • Game - Display to (Player group((Picked player))) the text: (You just recieved + ((String(GoldInteger[(Player number of (Picked player))])) + gold!))
          • Game - Display to (Player group((Picked player))) the text: (You just recieved + ((String(LumberInteger[(Player number of (Picked player))])) + lumber!))
      • Custom script: call DestroyForce(udg_Temp_PGroup)


And don't use that variable "goldlumbinteger", as it gets overwritten, and can't be used in another trigger, just use (Player number of (<Player>))
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top