Several Questions to Wargus

Wargus is a Warcraft 2 mod that allows you to play Warcraft 2 with the Stratagus engine.
User avatar
Yukiko
Posts: 63
Joined: Sun May 24, 2015 6:52 pm

Re: Several Questions to Wargus

Post by Yukiko »

Looks good. You might also try combining the two like this:

Code: Select all

local Peon1_time
  AddTrigger(
      function()
         if (GameCycle == 0) then
            return false
         end
         return true
      end,
      function() 
         if (GetNumUnitsAt(-1, "unit-peon", {0, 0}, {256, 256}) >= 1 ) then
            DefineAllow("unit-peon", "FFFFFFFFFFFFFFFF")
			Peon1_time = GameCycle
            return true
         elseif ((GetNumUnitsAt(-1, "unit-peon", {0, 0}, {256, 256}) <= 0) and (GameCycle - Peon1_time > 300)) then
            DefineAllow("unit-peon", "AAAAAAAAAAAAAAAA")
            return true
         end
         return true
      end
   )
Vendar
Posts: 8
Joined: Sun Jan 19, 2014 9:15 pm

Re: Several Questions to Wargus

Post by Vendar »

Guys, what about limiting unit per player? I would like to make unit-lord, one for each player. For example: when Player1 trained unit-lord, this unit is unable only for Player1, but other players still can train one unit of that kind.

When I'm using DefineAllow("unit-lord", "FFFFFFFFFFFFFFFF") it makes unit-lord unable for all players.
Mizukami999
Posts: 14
Joined: Tue Dec 20, 2016 7:00 am

Re: Several Questions to Wargus

Post by Mizukami999 »

I've just found what you're looking for. It's much more simple:

DefineUnitAllow("unit-dwarves", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
Post Reply