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

Simple system needed

Status
Not open for further replies.
Level 12
Joined
Dec 17, 2009
Messages
951
*need to be MUI, (for 10 players)
*every 5 sec add 10 lumber to the Builded structure (the market)
*need to show every seconds the +10 lumber count number
*if the building is destroyed cancels de lumber gained.

(sorry bad english)
thanks.
 
Level 5
Joined
Nov 30, 2010
Messages
184
  • Trigger
  • Event
  • Every 10 seconds
  • Condition
  • Action
  • Unit group - Pick every unit in playable map area and do actions
  • Loop - actions
  • If (all conditions are true) then do (then actions) else do (else actions)
  • If - conditions
  • Unit type of picked unit is market equals to true
  • Then - actions
  • Set tempPoint = position of market
  • Player - set lumber of owner of picked unit = lumber of owner of picked unit + 10
  • Floating text - Create a floating text at tempPoint saying +10 with colour 00 00 100
  • Set tempText = last created floating text
  • Floating text - Change velocity of tempText to 64 to 90 degrees
  • Floating text - Change fading age of tempText to 2 seconds
  • Custom Script: call RemoveLocation(udg_tempPoint)
  • Set tempPoint = no floating text
  • Else - actions
 
Level 12
Joined
Dec 17, 2009
Messages
951
  • Trigger
  • Event
  • Every 10 seconds
  • Condition
  • Action
  • Unit group - Pick every unit in playable map area and do actions
  • Loop - actions
  • If (all conditions are true) then do (then actions) else do (else actions)
  • If - conditions
  • Unit type of picked unit is market equals to true
  • Then - actions
  • Set tempPoint = position of market
  • Player - set lumber of owner of picked unit = lumber of owner of picked unit + 10
  • Floating text - Create a floating text at tempPoint saying +10 with colour 00 00 100
  • Set tempText = last created floating text
  • Floating text - Change velocity of tempText to 64 to 90 degrees
  • Floating text - Change fading age of tempText to 2 seconds
  • Custom Script: call RemoveLocation(udg_tempPoint)
  • Set tempPoint = no floating text
  • Else - actions

thanks +rep
 
  • Farm
  • Building
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup=true
      • Unit Group - Pick every unit in (Units of type Farm) and do (Actions)
        • Loop - Actions
          • Custom script: local unit building = GetEnumUnit()
          • Custom script: local location b = GetUnitLoc(building)
          • Custom script: call CreateTextTagLocBJ( "+10", b, 0, 10, 100, 100, 100, 0 )
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
          • Floating Text - Change the age of (Last created floating text) to 3.00 seconds
          • Custom script: set building = null
          • Custom script: set b = null
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
It destroys a Unit Group action right after its usage
Usually, this custom script is used IF your Unit Group is NOT a variable
If it's a variable, you must follow wolfman's suggestion

Put that custom script right above the Unit Group action

It would work for a global variable too.

  • Farm
  • Building
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup=true
      • Unit Group - Pick every unit in (Units of type Farm) and do (Actions)
        • Loop - Actions
          • Custom script: local unit building = GetEnumUnit()
          • Custom script: local location b = GetUnitLoc(building)
          • Custom script: call CreateTextTagLocBJ( "+10", b, 0, 10, 100, 100, 100, 0 )
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
          • Floating Text - Change the age of (Last created floating text) to 3.00 seconds
          • Custom script: set building = null
          • Custom script: set b = null

Leaks location b. Add RemoveLocation(b) before setting the var to null. Also,if you're going to use JASS,don't use locations at all. (use coordinates)
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
If it's a variable, you must follow wolfman's suggestion

According to this,set bj_wantDestroyGroup = true works only when you don't use global variables,something like
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
However,^ creates a local group as BJ.
It would be leakless like this too
  • Set GroupVar = (Units in (Playable map area))
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in GroupVar and do (Actions)
    • Loop - Actions
I didn't mean just global variables,but local ones can't be referenced in GUI functions.
 
Level 12
Joined
Dec 17, 2009
Messages
951
yeah doesnt works fine.
ok, i need this system working in MUI and I need a way to make the market be built in just over a mine. but when I build on top of mine (based on mine undead) when it is destroyed the mine is destroyed and I want to join a system like Anihhinlation Total Kingdoms mine
at 0:56
 
Status
Not open for further replies.
Top