Few Questions

KaosKnight

New Member
Reaction score
0
I created the following triggers. The variable is integer, array 1
Civilian
Event:
Unit-a unit finishes training a unit
Condition:
Unit type of (Trained Unit)) Equal to Troll Citizen
Action:
Set TaxIncome[(player number of (Owner of (Trained Unit)))]=player
number of(owner of (Trained Unit)))+3)

Tax Income
Event:
Time-Every 5.00 second of game time
Action:
Player Group-Pick every player in (All Players) and do action
Loop Actions
Player-Add TaxIncome[(Player number of (Owner of (Trained Unit)))] to
(picked Player) Current gold

1. However, whenever I trained my citizen, the gold increase steady rate of 3 gold for 5 second no matter what, instead of increasing exponentially, depending on number of civilians. For Example, if there were 20 civilians then gold would continue to climb instead of steady rate of three gold for five second. How could I solve this problem?
2. Also, in the middle of the game, I want to trigger a demonic invasion to destroy every player on the map. How Do I trigger that event?
3. In addition, in early part of the game I want to hold the barbarians at bay for three minutes so they can prepare for raiding the villagers. How Do I create trigger based on that?
4. How do you make players ally to each other if they type ally(color)?
5. How do you, when you finished training the king in starting building in center of the map, replace the building with two workers and king?
 

Moridin

Snow Leopard
Reaction score
144
I think you meant this:

Set TaxIncome[(player number of (Owner of (Trained Unit)))]=player number of(owner of (Trained Unit)))+3)

... to be this:

Set TaxIncome[(player number of (Owner of (Trained Unit)))]=TaxIncome[player number of(owner of (Trained Unit)))+3)]


Also, your second trigger will not work, because there is no Trained unit anymore. You have to use picked player over here:

Player-Add TaxIncome[(Player number of (Owner of (Trained Unit)))] to (picked Player) Current gold

-----------------------------

Q2) You can use this event:

Game - Time elapsed

... to trigger an event after a certain amount of time has passed. Just create lots of demon units and order them to attack move to the other end of the map.

-----------------------------

Q3) Depends on what you mean by holding the barbarians at bay? Let's say you don't want the barbarians to be able to move outside their base for the first 3 minutes. Then you can use a timer, for something liket this:

Trigger:
  • Map init
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Timer - Start Prep_Time as a one-shot timer that expires in 180.00 seconds


Trigger:
  • No Barbarian Attack
    • Events
      • Unit - A unit leaves Barbarian Base <gen> -> This is a unit leaves a region event, with the barbarian base being your region
    • Conditions
    • Actions
      • Unit - Move (Triggering unit) instantly to (Center of (Barbarian Base <gen>))
      • Game - Display ("You can't raid yet!") to (Triggering Player)


*Triggering player automatically gets (Owner of triggering unit)
*The trigger above this leaks a point variable

Trigger:
  • Start Attack
    • Events
      • Prep_Time expires
    • Conditions
    • Actions
      • Trigger - Turn off No Barbarian Attack <gen>


-----------------------------

Q4) Look at the actions under "Player

-----------------------------

Q5) Similar to your first trigger, you use the same event and use different conditions and actions.

For the condition, you would check to see if the trained unit is the king.
For the actions, you would use:

Unit - Remove unit (to remove the building from the game)
Unit - Create unit for player facing ____ (to create the two workers)
 

KaosKnight

New Member
Reaction score
0
1.The Tax income thing is very tricky the master.
I set the set tax income(player number(owner of trained unit)=Taxincome (playernumber(owner of Trained unit))+3
and I don't know what you were implying me to do in tax income trigger. Can you illustrate for me in detail?
so, I did what you said with first trigger, but now the income doesn't work. I put the condition "unit type of trained unit equals troll civilian" in my tax income trigger but that didn't work.
2. Also, how do I stop villagers or units from entering the barberian's base? and you weren't clear about the demonic invasion trigger. How do I make them move to other ends of the map and kill every one?
3. The countdown timer doesn't show in game when I did your barbarian at bay trigger. Do I have to make seperate trigger for that?
3. Should I just put gold mines at each corner of the map if that is more convenient? This tax income trigger is really frustrasting. :banghead:
 

Gummi_Bears

New Member
Reaction score
5
1.The Tax income thing is very tricky the master.
I set the set tax income(player number(owner of trained unit)=Taxincome (playernumber(owner of Trained unit))+3
and I don't know what you were implying me to do in tax income trigger. Can you illustrate for me in detail?
so, I did what you said with first trigger, but now the income doesn't work. I put the condition "unit type of trained unit equals troll civilian" in my tax income trigger but that didn't work.

You sure this don't work?

Trigger:
  • Set TaxIncome[(Player number of (Owner of (Trained unit)))] = (TaxIncome[(Player number of (Owner of (Trained unit)))] + 3)
    • Player - Add TaxIncome[(Player number of (Owner of (Trained unit)))] to (Owner of (Trained unit)) Current gold


2. Also, how do I stop villagers or units from entering the barberian's base? and you weren't clear about the demonic invasion trigger. How do I make them move to other ends of the map and kill every one?

Use regions to prevent ppl from going into base. Moridin just means create loads of units, and make each one attack-move to the other side. Or create whole swarms of monsters around the map and attack-move into the centre of the map.

3. The countdown timer doesn't show in game when I did your barbarian at bay trigger. Do I have to make seperate trigger for that?

Set the timer to a variable, then

Trigger:
  • Countdown Timer - Show (Your timer or last created timer)
 

KaosKnight

New Member
Reaction score
0
1.How did you managed to do that? Do I put it in first trigger:Civilian or second trigger: Tax income?
Set TaxIncome[(Player number of (Owner of (Trained unit)))] = (TaxIncome[(Player number of (Owner of (Trained unit)))] + 3)
Player - Add TaxIncome[(Player number of (Owner of (Trained unit)))] to
(Owner of (Trained unit)) Current gold
2. Where do I place the coundown timer trigger?
3. How do you, when you finished training the king in starting building in center of the map, replace the building with two workers and king? Because Moridin's suggestion didn't work. When I finished training the king, I end up with king instead of to workers and king.

Look fellas, I appreciate your help and appreciate it very much. I know the more you guys try to offer solution, I spew out more questions. I'm sorry to be this way. I'm just a new guy. Please understand. If you prefer, I can attach my trigger file and let you guys fix it(not the entire map because people would steal my ideas) or you guys can send me a attachment file with the right triggers and post it on the forum instead of running around in circles and wasting you guy's time. Thank you :)
 

KaosKnight

New Member
Reaction score
0
Not a typo, perhaps that can be the problem.
Variable named "Taxincome" is integer, array 1
came out like this on the trigger
Taxincome[index].
 

KaosKnight

New Member
Reaction score
0
:banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead:
 

Guest3z

New Member
Reaction score
22
1. However, whenever I trained my citizen, the gold increase steady rate of 3 gold for 5 second no matter what, instead of increasing exponentially, depending on number of civilians. For Example, if there were 20 civilians then gold would continue to climb instead of steady rate of three gold for five second. How could I solve this problem?
2. Also, in the middle of the game, I want to trigger a demonic invasion to destroy every player on the map. How Do I trigger that event?
3. In addition, in early part of the game I want to hold the barbarians at bay for three minutes so they can prepare for raiding the villagers. How Do I create trigger based on that?
4. How do you make players ally to each other if they type ally(color)?
5. How do you, when you finished training the king in starting building in center of the map, replace the building with two workers and king?

For income I dont think you really need any variables. (except unitgroup if you want to clean the memory leaks) The below would choose all troll citizen and give 3 gold for each troll citizen to the player that owns the troll citizen. So say blue has 2 troll citizens and red 1, it picks all 3 and gives 6 gold to blue and 3 to red.
Trigger:
  • Income
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Troll Citizen) and do (Actions)
        • Loop - Actions
          • Player - Add 3 to (Owner of (Picked unit)) Current gold


For keeping raiders at bay and others out of raiders zone you could place gates around their base to prevent them from leaving? To do this you could do the following
Trigger:
  • Raiders At Bay
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Destructible - Make Gate (Horizontal) 0000 <gen> Invulnerable
      • Wait 180.00 seconds
      • Destructible - Open Gate (Horizontal) 0000 <gen>


For spawning the two workers when you pick a king you can do the following assuming the buildings are preplaced on the map so that you can click on them in the editor. (as opposed to spawning them in game through triggers.)
Trigger:
  • King
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to King
    • Actions
      • Unit - Create 2 Worker for (Owner of (Triggering unit)) at (Position of Farm 0000 <gen>) facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Unit - Remove Farm 0000 <gen> from the game
        • Else - Actions


For the ally(color) commands you would need a chat command for each of the players you can ally similar to the one below should you choose to do it this way.
Trigger:
  • Ally Red
    • Events
      • Player - Player 1 (Red) types a chat message containing ally red as An exact match
      • Player - Player 2 (Blue) types a chat message containing ally red as An exact match
      • Player - Player 3 (Teal) types a chat message containing ally red as An exact match
      • Player - Player 4 (Purple) types a chat message containing ally red as An exact match
      • Player - Player 5 (Yellow) types a chat message containing ally red as An exact match
      • Player - Player 6 (Orange) types a chat message containing ally red as An exact match
      • Player - Player 7 (Green) types a chat message containing ally red as An exact match
      • Player - Player 8 (Pink) types a chat message containing ally red as An exact match
      • Player - Player 9 (Gray) types a chat message containing ally red as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing ally red as An exact match
    • Conditions
    • Actions
      • Player - Make (Triggering player) treat Player 1 (Red) as an Ally with shared vision


As for the demonic invasion im not really sure what you are looking for so ill just leave that one to you.

Lastly a few of these triggers will leak memory but were left that way for simplicitys-sake. Cleaning memory leaks is a good habbit to get into and can prevent some lag from building up in your game.

Anyways I hope some of these is helpful
 

KaosKnight

New Member
Reaction score
0
Thank you for your triggers guest, your triggers work. :thup: some problems off my shoulder.
1. but how do I clean leaks?
2. How do I show timer indicating when the raiders come out.
3. Also, I have this problem, how do I set hero limit to 3 because I don't want three same heroes. For example I don't want to train three blademasters. Just like in the melee game, when you train hero, you can't train the same hero again. How would I do that? :)
 

Gummi_Bears

New Member
Reaction score
5
2. How do I show timer indicating when the raiders come out.

Create a timer variable named 'RaiderTimer' or something similiar

Go to Set = Set RaiderTimer = (Last created timer)
Then do the Countdown Timer - Show RaiderTimer. If you can't find it use the search function and search 'timer'. You should find it.

3. Also, I have this problem, how do I set hero limit to 3 because I don't want three same heroes. For example I don't want to train three blademasters. Just like in the melee game, when you train hero, you can't train the same hero again. How would I do that?

Are you using a buidling to train your units? If so it should only allow one person to make that type of unit oO.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top