Several Questions to Wargus

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

Re: Several Questions to Wargus

Postby Yukiko » Tue Dec 27, 2016 8:14 am

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

Postby Vendar » Wed Dec 28, 2016 2:59 am

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

Postby Mizukami999 » Sat Dec 31, 2016 2:32 am

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)

Who is online

Users browsing this forum: No registered users and 1 guest