How to make income per structure

iTroll

New Member
Reaction score
1
So I'm trying to make a map where you capture specific buildings or control points and you get income every 45 seconds or so for each one you control, but it can be recaptured by the other team and you lose the income from that. So how would i make a trigger for that?
p.s. Im thinking the trigger would be similar to village builder income houses, but i have no idea how to trigger that, or if its different idontknow...:banghead::banghead::banghead:
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
something like this could work:

Code:
e: every 45.00 seconds of game time
c:
a: for each (Integer A) from 1 to 12
      Loop
         set income_group = units in playable map area matching (matching unit-type equal to [income structure] and owner of matching unit equal to Player(Integer A))
         pick every unit in income_group and do actions
            add x gold to Player(Integer A)
         call DestroyGroup(udg_income_group)

it's pretty simple, I don't think you need any "special systems" for that...
 

iTroll

New Member
Reaction score
1
sorry Dinowc i feel really noob but how do you make those actions? i got as far as the loop thing but i dont know how to do the set income_group and on...
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
income_group is a unit group variable

first you need to create it, better to say "prepare" it for use in the variable editor, to be able to use it in the trigger

and then in the loop go to Actions > General > Set variable, find your variable and click on "units in region matching..."

there you set the condition

for the custom script part, go to Actions > General > Custom script and there you write the code
 

iTroll

New Member
Reaction score
1
hmm every time the trigger starts up the game crashes what do i do? and i wrote the call DestroyGroup(udg_income_group) part as a custom trigger because i couldnt find it, but i tried running the map without that thing as a custom trigger and it still crashed? so i dont know, maybe i have to find the real one or like is something wrong?
 

takethat

Active Member
Reaction score
12
if the custome is wrong, the WE will warn you before it start run the test, so the game crash most likely is bcause some infinite loop or whatever, you try remove this trigger and test run again, see if it is this trigger that cause the crash, if really is it, then you should just post your trigger so others can see if can help you out.
 

iTroll

New Member
Reaction score
1
hmm k wait nevermind it works i forgot to put the for each interger A from 1 to 12, but wait, what i more wanted i wasnt clear enough i realize, but there are two teams, and when you capture a control point it goes to control of the computer on your team (red/green) how do i make it so that for every control point they control every person on the team gets gold?
again sorry for all the hassle -.- lol
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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