detect how many building there are.

DrakeMagi

New Member
Reaction score
0
ROC code
Code:
Set temp = (Number of units in (Units in (Playable map area) matching ((Unit-type of (Picked unit)) Equal to Black Citadel)))
If (temp Equal to 0) then do (Trigger - Run Vamps Lose <gen> (ignoring conditions)) else do (Do nothing)
have this code but it is not working right.
at least i think it not working right.

people tell me they have a black citadel left and they still lose.

wonder if there a better way of writing it.
 

Napenthe

New Member
Reaction score
2
ROC code
Code:
Set temp = (Number of units in (Units in (Playable map area) matching ((Unit-type of (Picked unit)) Equal to Black Citadel)))
If (temp Equal to 0) then do (Trigger - Run Vamps Lose <gen> (ignoring conditions)) else do (Do nothing)
have this code but it is not working right.
at least i think it not working right.

people tell me they have a black citadel left and they still lose.

wonder if there a better way of writing it.
At first glance, looks like you should maybe be using "matching unit" instead of 'picked unit' to refer to the units as they're considered for the matching. Maybe yes? No?
 

DrakeMagi

New Member
Reaction score
0
"matching unit" dont work
"pick unit" work in the code except some are people saying it glitching.
vamps lose game. It never happen to me. im trusting other people.

looking else where in code to see if error happens else where.

Code:
Events:
Unit - A unit owned by Player 1 (Red) Dies
# repeats per player upto player 8
Conditions:
(Unit-type of (Triggering unit)) Equal to Black Citadel
Actions:
Set temp = (Number of units in (Units in (Playable map area) matching ((Unit-type of (Picked unit)) Equal to Black Citadel)))
If (temp Equal to 0) then do (Trigger - Run Vamps Lose <gen> (ignoring conditions)) else do (Do nothing)
Player Leaves , i convert this to jass for roc map.
Code:
Events:
Player - Player 1 (Red) leaves the game
# repeats per player upto player 8
Actions:
Player Group - Remove (Triggering player) from Vamp_Group
Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Unit - Remove (Picked unit) from the game)

Set temp = (Number of units in (Units in (Playable map area) matching ((Unit-type of (Picked unit)) Equal to Black Citadel)))
If (temp Equal to 0) then do (Trigger - Run Vamps Lose <gen> (ignoring conditions)) else do (Do nothing)
 

cleeezzz

The Undead Ranger.
Reaction score
268
it should definitely be matching unit, add another condition such as "Matching Unit is alive" it may be bugging because it counts a dead building
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I reorganized the forums somewhat but I doubt anyone would notice
  • The Helper The Helper:
    Happy Friday!
    +1
  • The Helper The Helper:
    Happy Saturday!
    +1
  • The Helper The Helper:
    The forum software says we have 554 members online now. We did not have that many unique visitors the whole day today. Too many bots and the disconnect between the forum counts and the stats.
  • Varine Varine:
    Currently it says 413 guests and 2 members
    +1
  • Varine Varine:
    Aww
  • The Helper The Helper:
    That is going to be mostly bots
  • The Helper The Helper:
    527 (members: 2, guests: 525)
  • The Helper The Helper:
    Happy Saturday!
    +1
  • V-SNES V-SNES:
    Happy Saturday!
    +1
  • The Helper The Helper:
    622 (members: 2, guests: 620)
  • The Helper The Helper:
    666 (members: 4, guests: 662) :)
    +1
  • Varine Varine:
    609 (members: 4, guests: 605)
  • The Helper The Helper:
    I was posting that last one because the 666 users online :)
    +1
  • The Helper The Helper:
    Happy Wednesday Night!
    +1
  • The Helper The Helper:
    Happy Thursday!
    +1
  • The Helper The Helper:
    Marathon watching The Expanse!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    leaving for the weekend in San Antonio will be gone until Sunday afternoon
    +1
  • The Helper The Helper:
    and I am back :)
    +1
  • The Helper The Helper:
    Happy Tuesday!
    +1

    The Helper Discord

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top