• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Some things I need help with:

Status
Not open for further replies.
Level 9
Joined
Aug 11, 2007
Messages
429
Hey everyone, continuing work on my Castle Builder map.

Completed | Problem With Existing | Not Competed

I could use help with the following [Posting a trigger would be very helpful]:

-Every 60 seconds [1 minute] players receive an amount of Gold depending on how much of Building X they have, and if building X is upgraded to X2, they get a bonus of income [say, A% more], and if it's upgraded to X3, they get say B% more [B>A]. Make sense? Well, at least the first part. And it will correspond with t he amount of upkeep. Also they get some amount of Lumber. If you are interested in this, contact me.

-Every random time between 3-10 minutes a plague will hit, causing your Lumber [in my game peasants] to drop by a random number based on your total lumber. Maybe like 10-40%. But, if you have "Plague Resistance" researched, each level reduced the % loss.

-If a player types "-submit *color*", *Color* gets 10% of the player who submitted's income.

-Some other random triggers, like "X Peasants have joined you from afar to serve you" or something, where peasants are lumber in this case, and your lumber increases. Along with one where random peasants leave, ect...

-I'd like to have some natural disasters in my map, such as: Tornado, Earthquake, Locus Swarm, Lightning Strike. Ideas for disasters are also welcome.

-Maybe some weather effects, where it will randomly start raining, or a fog will roll in. Something.


-When unit X dies for any player, they lose the game. And X isn't built yet.

-Event- Player types "-name X" | Action- Rename player to X and display a message to everyone.

-A unit, called a Spike Trap. When an enemy walks on it, it deals D damage to the enemy, and in return does G damage to itself, until it or the enemy dies.

-A trigger that when an ability X is casted, depending on how many "Military Specialists" are inside [a max of 4], the unit waits, 10 seconds if there are 4 inside, 15 seconds if their are 3 inside, 20 seconds if their are 2 inside, 25 if their is 1 inside, and it can't convert if there are 0 units inside. After the wait, the unit transforms into unit B, and the units that were inside spawn outside, but on the unit, where they can be put back inside. This, is for my trebuchets.

-When a certain spell / buff hits a unit, they freeze for X seconds. I have a unit called a "Ice Trap" it's invisable, and when a unit walks over it, I would like that unit to freeze for X seconds.




I will add to this list gradually.
If you can help with any one or more of these triggers, please do so, I WILL GIVE REP, and Credit in this map.

-Angry_Sun [Koopa124]
 
Last edited:
Level 9
Joined
Oct 22, 2006
Messages
599

This is the Gold Income system (Adv).

Variables Required:
CountHovels [Array: 12, Integer]
CountVillages [Array: 12, Integer]
CountTowns [Array: 12, Integer]


  • Building add 1
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Hovel
    • Actions
      • Set CountHovels[(Player number of (Owner of (Triggering unit)))] = (CountHovels[(Player number of (Owner of (Triggering unit)))] + 1)


  • Building add 1 Upg
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Hovel
        • Then - Actions
          • Set CountHovels[(Player number of (Owner of (Triggering unit)))] = (CountHovels[(Player number of (Owner of (Triggering unit)))] - 1)
          • Set CountVillages[(Player number of (Owner of (Triggering unit)))] = (CountVillages[(Player number of (Owner of (Triggering unit)))] + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Village
            • Then - Actions
              • Set CountVillages[(Player number of (Owner of (Triggering unit)))] = (CountVillages[(Player number of (Owner of (Triggering unit)))] - 1)
              • Set CountTowns[(Player number of (Owner of (Triggering unit)))] = (CountTowns[(Player number of (Owner of (Triggering unit)))] + 1)
            • Else - Actions


  • Building sub 1
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Hovel
        • Then - Actions
          • Set CountHovels[(Player number of (Owner of (Triggering unit)))] = (CountHovels[(Player number of (Owner of (Triggering unit)))] - 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Dying unit)) Equal to Village
            • Then - Actions
              • Set CountVillages[(Player number of (Owner of (Triggering unit)))] = (CountVillages[(Player number of (Owner of (Triggering unit)))] - 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Dying unit)) Equal to Town
                • Then - Actions
                  • Set CountTowns[(Player number of (Owner of (Triggering unit)))] = (CountTowns[(Player number of (Owner of (Triggering unit)))] - 1)
                • Else - Actions


  • Gold Income Adv
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add ((CountHovels[(Player number of (Picked player))] x 10) + ((CountVillages[(Player number of (Picked player))] x 20) + (CountBigTowns[(Player number of (Picked player))] x 30))) to (Picked player) Current gold


Give me +REP If I helped you.


EDIT: Removed Leaks
Also Notice that in the trigger I suppose you have 12 players, if you have less than 12 reduce the number so it fits.

EDIT2: Reworked the whole trigger thanks to Dr Super Good!
 
Last edited:
Level 9
Joined
Aug 11, 2007
Messages
429
Alright I'll give you rep as soon as I can, I guess I gave it to you before somehow, cause it says I can't. xD
 
Level 9
Joined
Oct 22, 2006
Messages
599
Update: Second "Plague" Trigger done!

  • Plague Activate
    • Events
      • Time - Every (Random real number between 180.00 and 600.00) seconds of game time
    • Conditions
    • Actions
      • Trigger - Turn on Plague <gen>
  • Plague
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlagueLasts Not equal to 20
        • Then - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Set (Picked player) Current lumber to (((Picked player) Current lumber) / ((Random integer number between 10 and 40) - ((Current research level of Studded Leather Armor for (Picked player)) x 5)))
        • Else - Actions
          • Trigger - Turn off (This trigger)
          • Set PlagueLasts = 0
      • Set PlagueLasts = (PlagueLasts + 1)
The Second Trigger is initially Off.
According to the default values, the plague hits every 2 seconds and lasts for 40 seconds. (Meaning it hits 20 times each player)
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
VergilThazaar, that income system is stupidly inefficent. Rather on construction / map int add all the buildings to a counter (use an array for MPI) and then every X time multiply that by the gold to give. On unit death just remove 1 from the counter.

Far more efficent than counting the units each time and checking almost all units on the map with a filter to find the right type for each type.
 
Level 9
Joined
Oct 22, 2006
Messages
599
VergilThazaar, that income system is stupidly inefficent. Rather on construction / map int add all the buildings to a counter (use an array for MPI) and then every X time multiply that by the gold to give. On unit death just remove 1 from the counter.

Far more efficent than counting the units each time and checking almost all units on the map with a filter to find the right type for each type.

Thanks a Lot! It really was stupid!:ugly:





EDIT: Updated the Income Triggger with one that depends on the Player's Food.

Income Triggers v2


Variables Required:
Income [Array 12, Integer]

  • Building add 1 V2
    • Events
      • Unit - A unit Finishes construction
      • Unit - A unit Finishes an upgrade
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Hovel
          • (Unit-type of (Triggering unit)) Equal to Village
          • (Unit-type of (Triggering unit)) Equal to Town
    • Actions
      • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] + 10)


  • Building sub 1 V2
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Hovel
        • Then - Actions
          • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] - 10)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Dying unit)) Equal to Village
            • Then - Actions
              • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] - 20)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Dying unit)) Equal to Town
                • Then - Actions
                  • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] - 30)
                • Else - Actions


  • Gold Income Adv V2
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add (Income[(Player number of (Picked player))] - (Integer((0.50 x (Real(((Picked player) Food used))))))) to (Picked player) Current gold
- These triggers were made after working with Koopa124.




EDIT2: This is an Example of the -submit command for there is no point in making all 12 of them, because they are all similar. You should copy & paste this 11 times and replace the correct Player Fields.

Submission Triggers


  • Submit to Red
    • Events
      • Player - Player 2 (Blue) types a chat message containing -submit red as An exact match
      • Player - Player 3 (Teal) types a chat message containing -submit red as An exact match
      • Player - Player 4 (Purple) types a chat message containing -submit red as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -submit red as An exact match
      • Player - Player 6 (Orange) types a chat message containing -submit red as An exact match
      • Player - Player 7 (Green) types a chat message containing -submit red as An exact match
      • Player - Player 8 (Pink) types a chat message containing -submit red as An exact match
      • Player - Player 9 (Gray) types a chat message containing -submit red as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -submit red as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -submit red as An exact match
      • Player - Player 12 (Brown) types a chat message containing -submit red as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Triggering player)) + ( has submited to + (Name of Player 1 (Red))))
      • Player - Divert 10% of the Gold income of (Triggering player) to Player 1 (Red)
So at the rest of the triggers you will replace these fields:
Player - Player # (Color) One will always be missing (the one that everyone is submiting to)
types a chat message containing -submit red The Command
( has submited to + (Name of Player # (Color)))) The Game Message
Player - Divert 10% of the Gold income of (Triggering player) to Player # (Color) Don't forget the guy that gets paid!



EDIT3: Another Trigger you asked for..

Random Peasant Triggers


Variables Required:
tmpPlayer [Player]

  • Peasants Random
    • Events
      • Time - Every (Random real number between 60.00 and 300.00) seconds of game time
    • Conditions
    • Actions
      • -------- Add or Subtract Peasants to a Random Player at a Random Time --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 2) Equal to 1
        • Then - Actions
          • -------- If you're lucky Add X Peasants --------
          • Set tmpPlayer = (Player((Random integer number between 1 and 12)))
          • Player - Add X to tmpPlayer Current lumber
          • Game - Display to (Player group(tmpPlayer)) for 15.00 seconds the text: X Peasants have joi...
        • Else - Actions
          • -------- If you're unlucky Substract X Peasants --------
          • Set tmpPlayer = (Player((Random integer number between 1 and 12)))
          • Player - Add (X x -1) to tmpPlayer Current lumber
          • Game - Display to (Player group(tmpPlayer)) for 15.00 seconds the text: X Peasants have lef...
 
Last edited:
Level 15
Joined
Aug 11, 2009
Messages
1,606
VergilThazaar, that income system is stupidly inefficent. Rather on construction / map int add all the buildings to a counter (use an array for MPI) and then every X time multiply that by the gold to give. On unit death just remove 1 from the counter.

Far more efficent than counting the units each time and checking almost all units on the map with a filter to find the right type for each type.

hehe :xxd:
The second one is much better.
 
Level 9
Joined
Aug 11, 2007
Messages
429
Thanks a ton Vergil, although the Hive won't let me add rep to you. I've never done so before, and it keeps telling me to "Spread some rep around". >.<
 
Level 9
Joined
Aug 11, 2007
Messages
429
Koopa124, you must have repped him already some timer recently.
You will need to rep many other different people before you can rep him again. It is to help stop people spamming rep to each other.

I realized. However, this must have been months ago. I repped 2 people already, how many more must I do? Is it in the single digits?
 
Level 9
Joined
Aug 11, 2007
Messages
429
Hey guys, figured out I need a name trigger.

Event- Player types "-name X"
Action- Rename player to X and display a message to everyone.

Something like that.
 
he wants
  • Events:
    • Player 1-12 types -name as a substring
  • Conditions:
    • Substring(Entered chatstring, 1, 5) = -name
  • Actions:
    • If Length of entered chat string equal or greater then 25 then
      • Player - set the name of Triggering player to (Substring(Entered chat string, 7, 25)
    • Else
      • Player - set the name of Triggering player to (Substring(Entered chat string, 7, Length of entered chat string)
    • Game - Display to (All players) the text "Player name of(Triggering player)" + " Has changed his/her name to " Substring(Entered chat string) 7, 25
 
Level 9
Joined
Aug 11, 2007
Messages
429
Alright guys, this ones a little hard.

A unit, called a Spike Trap. When an enemy walks on it, it deals D damage to the enemy, and in return does G damage to itself, until it dies.

Would anyone be able to make this one?
 
Level 9
Joined
Aug 11, 2007
Messages
429
  • DefaultTrigger001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to King
    • Actions
      • Game - Defeat (Owner of (Triggering unit)) with the message: Your king has died!

But I need one fore each player, and each player gets a "King".
 
Level 9
Joined
Aug 11, 2007
Messages
429
u dont need one for each player, it checks which unit died, then it defeats the owner of the triggering/dying unit, and defeats him.


-I'd like to have some natural disasters in my map, such as: Tornado, Lightning Strike.

-Maybe some weather effects, where it will randomly start raining, or a fog will roll in. Something.

-A unit, called a Spike Trap. When an enemy walks on it, it deals D damage to the enemy, and in return does G damage to itself, until it dies.
 
Last edited:
Level 9
Joined
Oct 22, 2006
Messages
599

Random Peasant Triggers Update!


Variables Required:
tmpPlayer [Player]

++Variables Required:
tmp_Integer [Integer]
Players [Player Group]


  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching (((Picked player) slot status) Equal to Is playing)) and do (Actions)
        • Loop - Actions
          • Player Group - Add (Picked player) to Players
Tip: You can add the above Actions only into a trigger that activates at the start of the map.

  • Player Leaves
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
      • Player - Player 7 (Green) leaves the game
      • Player - Player 8 (Pink) leaves the game
      • Player - Player 9 (Gray) leaves the game
      • Player - Player 10 (Light Blue) leaves the game
      • Player - Player 11 (Dark Green) leaves the game
      • Player - Player 12 (Brown) leaves the game
    • Conditions
    • Actions
      • Player Group - Remove (Triggering player) from Players
      • Game - Display to (All players) the text: (|cffFF0000 + ((Name of (Triggering player)) + has just left the game!|r))
Tip: Edit the old Peasants Random with the trigger Below.

  • Peasants Random Updated
    • Events
      • Time - Every (Random real number between 60.00 and 300.00) seconds of game time
    • Conditions
    • Actions
      • -------- Add or Subtract Peasants to a Random Player at a Random Time --------
      • Set tmpPlayer = (Random player from Players)
      • Set tmpInteger = (Integer((0.15 x (Real((tmpPlayer Current lumber))))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 2) Equal to 1
        • Then - Actions
          • -------- If you're lucky Add X Peasants --------
          • Player - Add tmpInteger to tmpPlayer Current lumber
          • Game - Display to (Player group(tmpPlayer)) for 15.00 seconds the text: ((String(tmpInteger)) + Peasants have joined you from afar to serve you.)
        • Else - Actions
          • -------- If you're unlucky Substract X Peasants --------
          • Player - Add (-1 x tmpInteger) to tmpPlayer Current lumber
          • Game - Display to (Player group(tmpPlayer)) for 15.00 seconds the text: ((String(tmpInteger)) + Peasants have left your Kingdom.)
 
Level 9
Joined
Dec 17, 2008
Messages
499
Perhaps for the lightning strike thing you can use a dummy unit thar warstomps around 200 range and a lighning effect, with triggers ofc.

The war stomp should have around 200 range and deal small dmg and a few sec stun from the lightning.
 
Level 9
Joined
Aug 11, 2007
Messages
429
Perhaps for the lightning strike thing you can use a dummy unit thar warstomps around 200 range and a lighning effect, with triggers ofc.

The war stomp should have around 200 range and deal small dmg and a few sec stun from the lightning.


Ohh I like that. Damn you, I had it done too xD

*Goes back and edits*
 
Level 9
Joined
Aug 11, 2007
Messages
429
I could really use the Spike trap trigger I requested. Also, I have a few new ones.

A trigger that when an ability X is casted, depending on how many "Military Specialists" are inside [a max of 4], the unit waits, 10 seconds if there are 4 inside, 15 seconds if their are 3 inside, 20 seconds if their are 2 inside, 25 if their is 1 inside, and it can't convert if there are 0 units inside. After the wait, the unit transforms into unit B, and the units that were inside spawn outside, but on the unit, where they can be put back inside. This, is for my trebuchets.
 

Kenji.1484

K

Kenji.1484

For the Spike Trap, I think it's quite simple, though I'm a noob at map making.

  • Events
    • Unit - A unit comes within X of Spike Trap <gen>
  • Conditions
    • (Owner of (Triggering unit)) Not equal to Player X (X)
  • Actions
    • Unit - Cause (Triggering unit) to damage Spike Trap <gen>, dealing X damage of attack type Normal and damage type Normal
    • Unit - Cause Spike Trap <gen> to damage (Triggering unit), dealing X damage of attack type Normal and damage type Normal
I will edit when I figure out how to do the "until the unit dies" bit.
 
Last edited by a moderator:
For the Spike Trap, I think it's quite simple, though I'm a noob at map making.

  • Events
    • Unit - A unit comes within X of Spike Trap <gen>
  • Conditions
    • (Owner of (Triggering unit)) Not equal to Player X (X)
  • Actions
    • Unit - Cause (Triggering unit) to damage Spike Trap <gen>, dealing X damage of attack type Normal and damage type Normal
    • Unit - Cause Spike Trap <gen> to damage (Triggering unit), dealing X damage of attack type Normal and damage type Normal
I will edit when I figure out how to do the "until the unit dies" bit.

That would also only work for one spike trap...

I'm guessing its a buildable building, right?

You could, however, give the spike trap an edited version of permanant immolation in a disabled spellbook, so when a unit comes near it it get damaged. and then just make it so they can attack the spike traps..?
 
Level 9
Joined
Oct 22, 2006
Messages
599
That would also only work for one spike trap...

I'm guessing its a buildable building, right?

You could, however, give the spike trap an edited version of permanant immolation in a disabled spellbook, so when a unit comes near it it get damaged. and then just make it so they can attack the spike traps..?

- That could work on a different version, adding 2 immolation abilities, one can target only enemies and the other one only self.
 
Level 9
Joined
Aug 11, 2007
Messages
429
Thanks a Lot! It really was stupid!:ugly:





EDIT: Updated the Income Triggger with one that depends on the Player's Food.

Income Triggers v2


Variables Required:
Income [Array 12, Integer]

  • Building add 1 V2
    • Events
      • Unit - A unit Finishes construction
      • Unit - A unit Finishes an upgrade
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Hovel
          • (Unit-type of (Triggering unit)) Equal to Village
          • (Unit-type of (Triggering unit)) Equal to Town
    • Actions
      • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] + 10)


  • Building sub 1 V2
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Hovel
        • Then - Actions
          • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] - 10)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Dying unit)) Equal to Village
            • Then - Actions
              • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] - 20)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Dying unit)) Equal to Town
                • Then - Actions
                  • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] - 30)
                • Else - Actions


  • Gold Income Adv V2
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add (Income[(Player number of (Picked player))] - (Integer((0.50 x (Real(((Picked player) Food used))))))) to (Picked player) Current gold

Don't even think that makes sense.
 
Level 9
Joined
Aug 11, 2007
Messages
429
Well, the most important thing is this Trebuchet trigger:

A trigger that when an ability X is casted, depending on how many "Military Specialists" are inside [a max of 4], the unit waits, 10 seconds if there are 4 inside, 15 seconds if their are 3 inside, 20 seconds if their are 2 inside, 25 if their is 1 inside, and it can't convert if there are 0 units inside. After the wait, the unit transforms into unit B, and the units that were inside spawn outside, but on the unit, where they can be put back inside. This, is for my trebuchets.

I can make it if someone can tell me how to spawn the units that were inside outside.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
koopa your not paying attention to me mate XD

here's another income system that probably works:


  • Recieve income
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 11, do (Actions)
        • Loop - Actions
          • -------- you should change the type of buildings to your types ofcourse ;) --------
          • Set Number_of_building1_Player[(Integer A)] = (Number of units in (Units owned by (Player((Integer A))) of type Farm))
          • Set Number_of_building2_Player[(Integer A)] = (Number of units in (Units owned by (Player((Integer A))) of type Cannon Tower))
          • Set Number_of_building3_Player[(Integer A)] = (Number of units in (Units owned by (Player((Integer A))) of type Town Hall))
          • Set Number_of_building4_Player[(Integer A)] = (Number of units in (Units owned by (Player((Integer A))) of type Barracks))
          • -------- you can also change these if then elses into a single action if then else since your only updating the income percentage variable... That shortens the code down a bit :) --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (((Player((Integer A))) Food used) Greater than or equal to 0) and (((Player((Integer A))) Food used) Less than or equal to 15)
            • Then - Actions
              • -------- if your upkeep is verry low then it will be 100% --------
              • Set income_percentage = 100
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (((Player((Integer A))) Food used) Greater than or equal to 16) and (((Player((Integer A))) Food used) Less than or equal to 25)
                • Then - Actions
                  • -------- if your upkeep is low then it will be 80% --------
                  • Set income_percentage = 80
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (((Player((Integer A))) Food used) Greater than or equal to 26) and (((Player((Integer A))) Food used) Less than or equal to 50)
                    • Then - Actions
                      • -------- if your upkeep is mediom then it will be 60% --------
                      • Set income_percentage = 60
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (((Player((Integer A))) Food used) Greater than or equal to 51) and (((Player((Integer A))) Food used) Less than or equal to 75)
                        • Then - Actions
                          • -------- if your upkeep is high then it will be 40% --------
                          • Set income_percentage = 40
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (((Player((Integer A))) Food used) Greater than or equal to 76) and (((Player((Integer A))) Food used) Less than or equal to 100)
                            • Then - Actions
                              • -------- if your upkeep is insane then it will be 20% --------
                              • Set income_percentage = 20
                              • -------- and so on ;) --------
                            • Else - Actions
          • -------- example: set total_income_of_player[(1)] = (total_income_of_player[(1)] + 16 x 2 buildings = 32 gold... --------
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[1] x Number_of_building1_Player[(Integer A)]))
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[2] x Number_of_building2_Player[(Integer A)]))
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[3] x Number_of_building3_Player[(Integer A)]))
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[4] x Number_of_building4_Player[(Integer A)]))
          • -------- example: set total_income_of_player([1]) = (total_income_of_player[(1)] /100 x 80 *percentage of income* = 25,6 (26) gold if you look @ previous example... --------
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] / (100 x income_percentage))
          • Player - Add total_income_of_player[(Integer A)] to (Player((Integer A))) Current gold
          • Set total_income_of_player[(Integer A)] = 0
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Building[1] = 16
      • Set Building[2] = 24
      • Set Building[3] = 32
      • Set Building[4] = 40
 
Level 9
Joined
Aug 11, 2007
Messages
429
koopa your not paying attention to me mate XD

here's another income system that probably works:


  • Recieve income
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 11, do (Actions)
        • Loop - Actions
          • -------- you should change the type of buildings to your types ofcourse ;) --------
          • Set Number_of_building1_Player[(Integer A)] = (Number of units in (Units owned by (Player((Integer A))) of type Farm))
          • Set Number_of_building2_Player[(Integer A)] = (Number of units in (Units owned by (Player((Integer A))) of type Cannon Tower))
          • Set Number_of_building3_Player[(Integer A)] = (Number of units in (Units owned by (Player((Integer A))) of type Town Hall))
          • Set Number_of_building4_Player[(Integer A)] = (Number of units in (Units owned by (Player((Integer A))) of type Barracks))
          • -------- you can also change these if then elses into a single action if then else since your only updating the income percentage variable... That shortens the code down a bit :) --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (((Player((Integer A))) Food used) Greater than or equal to 0) and (((Player((Integer A))) Food used) Less than or equal to 15)
            • Then - Actions
              • -------- if your upkeep is verry low then it will be 100% --------
              • Set income_percentage = 100
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (((Player((Integer A))) Food used) Greater than or equal to 16) and (((Player((Integer A))) Food used) Less than or equal to 25)
                • Then - Actions
                  • -------- if your upkeep is low then it will be 80% --------
                  • Set income_percentage = 80
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (((Player((Integer A))) Food used) Greater than or equal to 26) and (((Player((Integer A))) Food used) Less than or equal to 50)
                    • Then - Actions
                      • -------- if your upkeep is mediom then it will be 60% --------
                      • Set income_percentage = 60
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (((Player((Integer A))) Food used) Greater than or equal to 51) and (((Player((Integer A))) Food used) Less than or equal to 75)
                        • Then - Actions
                          • -------- if your upkeep is high then it will be 40% --------
                          • Set income_percentage = 40
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (((Player((Integer A))) Food used) Greater than or equal to 76) and (((Player((Integer A))) Food used) Less than or equal to 100)
                            • Then - Actions
                              • -------- if your upkeep is insane then it will be 20% --------
                              • Set income_percentage = 20
                              • -------- and so on ;) --------
                            • Else - Actions
          • -------- example: set total_income_of_player[(1)] = (total_income_of_player[(1)] + 16 x 2 buildings = 32 gold... --------
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[1] x Number_of_building1_Player[(Integer A)]))
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[2] x Number_of_building2_Player[(Integer A)]))
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[3] x Number_of_building3_Player[(Integer A)]))
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[4] x Number_of_building4_Player[(Integer A)]))
          • -------- example: set total_income_of_player([1]) = (total_income_of_player[(1)] /100 x 80 *percentage of income* = 25,6 (26) gold if you look @ previous example... --------
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] / (100 x income_percentage))
          • Player - Add total_income_of_player[(Integer A)] to (Player((Integer A))) Current gold
          • Set total_income_of_player[(Integer A)] = 0
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Building[1] = 16
      • Set Building[2] = 24
      • Set Building[3] = 32
      • Set Building[4] = 40

I realize that, however, there are many leaks to that. But I'll give you +rep for making the trigger. :]
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
lol are you that lasy :p?
complainting about leaks XD?
if you know so much about leaks you could've done it yourself but I saved you the trouble...

  • Recieve income
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 11, do (Actions)
        • Loop - Actions
          • Set Temp_group = (Units owned by (Player((Integer A))) of type Farm)
          • Set Number_of_building1_Player[(Integer A)] = (Number of units in Temp_group)
          • Custom script: call DestroyGroup(udg_Temp_group)
          • Set Temp_group = (Units owned by (Player((Integer A))) of type Cannon Tower)
          • Set Number_of_building2_Player[(Integer A)] = (Number of units in Temp_group)
          • Custom script: call DestroyGroup(udg_Temp_group)
          • Set Temp_group = (Units owned by (Player((Integer A))) of type Town Hall)
          • Set Number_of_building3_Player[(Integer A)] = (Number of units in Temp_group)
          • Custom script: call DestroyGroup(udg_Temp_group)
          • Set Temp_group = (Units owned by (Player((Integer A))) of type Barracks)
          • Set Number_of_building4_Player[(Integer A)] = (Number of units in Temp_group)
          • Custom script: call DestroyGroup(udg_Temp_group)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (((Player((Integer A))) Food used) Greater than or equal to 0) and (((Player((Integer A))) Food used) Less than or equal to 15)
            • Then - Actions
              • -------- if your upkeep is verry low then it will be 100% --------
              • Set income_percentage = 100
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (((Player((Integer A))) Food used) Greater than or equal to 16) and (((Player((Integer A))) Food used) Less than or equal to 25)
                • Then - Actions
                  • -------- if your upkeep is low then it will be 80% --------
                  • Set income_percentage = 80
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (((Player((Integer A))) Food used) Greater than or equal to 26) and (((Player((Integer A))) Food used) Less than or equal to 50)
                    • Then - Actions
                      • -------- if your upkeep is mediom then it will be 60% --------
                      • Set income_percentage = 60
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (((Player((Integer A))) Food used) Greater than or equal to 51) and (((Player((Integer A))) Food used) Less than or equal to 75)
                        • Then - Actions
                          • -------- if your upkeep is high then it will be 40% --------
                          • Set income_percentage = 40
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (((Player((Integer A))) Food used) Greater than or equal to 76) and (((Player((Integer A))) Food used) Less than or equal to 100)
                            • Then - Actions
                              • -------- if your upkeep is insane then it will be 20% --------
                              • Set income_percentage = 20
                              • -------- and so on ;) --------
                            • Else - Actions
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[1] x Number_of_building1_Player[(Integer A)]))
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[2] x Number_of_building2_Player[(Integer A)]))
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[3] x Number_of_building3_Player[(Integer A)]))
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] + (Building[4] x Number_of_building4_Player[(Integer A)]))
          • Set total_income_of_player[(Integer A)] = (total_income_of_player[(Integer A)] / (100 x income_percentage))
          • Player - Add total_income_of_player[(Integer A)] to (Player((Integer A))) Current gold
          • Set total_income_of_player[(Integer A)] = 0
 
Last edited:
Level 9
Joined
Aug 11, 2007
Messages
429
Uhm, that type of trigger was my first one... and it was corrected by a member, check the posts dude. What don't you understand in my trigger koopa124?

PS: Don't Doublepost, use the "Edit" Button.

I'm testing out multiple income triggers. I need to get it just right.

What I DO need, is that trebuchet trigger. I REALLY need that.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
PS: Don't Doublepost, use the "Edit" Button.

are you referring to me or koopa? since I didnt and you posted underneath my post.. ;)

Uhm, that type of trigger was my first one... and it was corrected by a member, check the posts dude.

and yes I know but he started a new thread where he asked for an income system and afterwards he brought up this thread so I realized that i was actually creating a trigger for nothing since it was already solved... Thats why i got a bit grumpy at my last post...

proof:

http://www.hiveworkshop.com/forums/world-editor-help-zone-98/income-trigger-146912/
 
Level 9
Joined
Aug 11, 2007
Messages
429
Hey everyone, continuing work on my Castle Builder map.

Completed | Problem With Existing | Not Competed

I could use help with the following [Posting a trigger would be very helpful]:

-Every 60 seconds [1 minute] players receive an amount of Gold depending on how much of Building X they have, and if building X is upgraded to X2, they get a bonus of income [say, A% more], and if it's upgraded to X3, they get say B% more [B>A]. Make sense? Well, at least the first part. And it will correspond with t he amount of upkeep. Also they get some amount of Lumber. If you are interested in this, contact me.

-Every random time between 3-10 minutes a plague will hit, causing your Lumber [in my game peasants] to drop by a random number based on your total lumber. Maybe like 10-40%. But, if you have "Plague Resistance" researched, each level reduced the % loss.

-If a player types "-submit *color*", *Color* gets 10% of the player who submitted's income.

-Some other random triggers, like "X Peasants have joined you from afar to serve you" or something, where peasants are lumber in this case, and your lumber increases. Along with one where random peasants leave, ect...

-I'd like to have some natural disasters in my map, such as: Tornado, Earthquake, Locus Swarm, Lightning Strike. Ideas for disasters are also welcome.

-Maybe some weather effects, where it will randomly start raining, or a fog will roll in. Something.


-When unit X dies for any player, they lose the game. And X isn't built yet.

-Event- Player types "-name X" | Action- Rename player to X and display a message to everyone.

-A unit, called a Spike Trap. When an enemy walks on it, it deals D damage to the enemy, and in return does G damage to itself, until it or the enemy dies.

-A trigger that when an ability X is casted, depending on how many "Military Specialists" are inside [a max of 4], the unit waits, 10 seconds if there are 4 inside, 15 seconds if their are 3 inside, 20 seconds if their are 2 inside, 25 if their is 1 inside, and it can't convert if there are 0 units inside. After the wait, the unit transforms into unit B, and the units that were inside spawn outside, but on the unit, where they can be put back inside. This, is for my trebuchets.

-When a certain spell / buff hits a unit, they freeze for X seconds. I have a unit called a "Ice Trap" it's invisable, and when a unit walks over it, I would like that unit to freeze for X seconds.




I will add to this list gradually.
If you can help with any one or more of these triggers, please do so, I WILL GIVE REP, and Credit in this map.

-Angry_Sun [Koopa124]


Things in Orange and Red I still need some help with.
 
Level 9
Joined
Dec 17, 2008
Messages
499
For the tornado you can make 1 invulnerable unit with locust (like a big dummy unit) and it has the critter ability. Make a trigger so when something is within 200 range or 500 range or w/e it gets damaged/killed.
 
Level 9
Joined
Aug 11, 2007
Messages
429
Yup, I'm just having some income problems still. I need to get it just right.

But would anyone know how to have random weather effects come into play?
 
Level 9
Joined
Oct 22, 2006
Messages
599
Another trigger served for Koopa124!

  • Random Weather
    • Events
      • Time - Every 180.00 seconds of game time
    • Conditions
    • Actions
      • Environment - Remove (Last created weather effect)
      • Set tmpInteger = (Random integer number between 1 and 5)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • tmpInteger Equal to 1
        • Then - Actions
          • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • tmpInteger Equal to 2
            • Then - Actions
              • Environment - Create at (Playable map area) the weather effect Dungeon White Fog (Heavy)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • tmpInteger Equal to 3
                • Then - Actions
                  • Environment - Create at (Playable map area) the weather effect Northrend Snow (Heavy)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • tmpInteger Equal to 4
                    • Then - Actions
                      • Environment - Create at (Playable map area) the weather effect Rays Of Moonlight
                    • Else - Actions

How it works:

It picks a random number between 1 and 5 (you can set the range if you want more weather effects). If the number is 1 then make it Rain in the whole map. If the number is 2 make a fog, e.t.c. If the number is 5 then the weather is normal (you can add more than 1 "empty numbers" if you want a bigger chance to have the normal weather). Also you can set the event not to happen every 3 minutes, but random.
 
Level 9
Joined
Aug 11, 2007
Messages
429
Another trigger served for Koopa124!

  • Random Weather
    • Events
      • Time - Every 180.00 seconds of game time
    • Conditions
    • Actions
      • Environment - Remove (Last created weather effect)
      • Set tmpInteger = (Random integer number between 1 and 5)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • tmpInteger Equal to 1
        • Then - Actions
          • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • tmpInteger Equal to 2
            • Then - Actions
              • Environment - Create at (Playable map area) the weather effect Dungeon White Fog (Heavy)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • tmpInteger Equal to 3
                • Then - Actions
                  • Environment - Create at (Playable map area) the weather effect Northrend Snow (Heavy)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • tmpInteger Equal to 4
                    • Then - Actions
                      • Environment - Create at (Playable map area) the weather effect Rays Of Moonlight
                    • Else - Actions

How it works:

It picks a random number between 1 and 5 (you can set the range if you want more weather effects). If the number is 1 then make it Rain in the whole map. If the number is 2 make a fog, e.t.c. If the number is 5 then the weather is normal (you can add more than 1 "empty numbers" if you want a bigger chance to have the normal weather). Also you can set the event not to happen every 3 minutes, but random.


What about:
-Random sized ragion in a random spot on the map
-Make it move? o_O
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
-I'd like to have some natural disasters in my map, such as: Tornado, Earthquake, Locus Swarm, Lightning Strike. Ideas for disasters are also welcome.

Check the attachment for the Tornado Disaster.

PP: Theres not documentation included into the map, if you think you can't handle the trigger, gimme a PM to remake it.
 

Attachments

  • Tornado Disaster.w3x
    26.6 KB · Views: 34
Status
Not open for further replies.
Top