• 🏆 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!

[Trigger] Some gold please

Status
Not open for further replies.
Level 2
Joined
Dec 4, 2006
Messages
7
can someone teach me how to create a trigger that sets the gold of a player to
amount/by number of alies of that player and how do I make a trigger that gives every player an amount of gold every second
 
Level 11
Joined
Jul 12, 2005
Messages
764
To get the number of allies:
Have an integer variable, i'll call it AllyNum. The trigger:

Event - Map Init
Actions -
For Each Integer A from 1 to 12 do Actions
-For Each Integer B from 1 to 12 do Actions
--If Player(For loop index B) is an ally of Player(For loop index A)
---Set AllyNum[For loop index A] = AllyNum[For loop index A] + 1
 
Level 2
Joined
Dec 4, 2006
Messages
7
hey thanks this will help by the way this is what i'm trying to say a trigger that will give each player an amount of gold in map init divided by the number of his/her allies
 
Level 6
Joined
Feb 2, 2005
Messages
205
Well that should be done by some math, set the maxammount Gold for an 1 Player game for example maxGold=1200. Then you have to count the players Playing like this

  • For each (Integer A) from 1 to 8, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • ((Player((Integer A))) slot status) equal Not in Use
              • ((Player((Integer A))) slot status) equal has left the Game
        • 'THEN'-Aktionen
          • Set Players = Players + 1
        • 'ELSE'-Aktionen
          • Do nothing
Afterward do this

  • maxGold=maxGold/Players
The last step is to set the ammount of Gold each Player has.

  • Playergroup - Pick every player in (All players) and do Player - Set (Picked player) Gold to maxGold

Done.
 
Last edited:
Level 6
Joined
Feb 2, 2005
Messages
205
Uh well, forgot about that, copied a part out of my TD. Well it would be easier to trigger, if you tell us what kind of map you are working at. We need to now how dynamic this trigger has to be. Maybe there is the posibility of this setup:

Player 1 allies Player 2 and 3
Player 3 allies only Player 1

More Information are required before i'll post another trigger.

Well and sorry for that wrong Trigger.
 
Level 11
Joined
Jul 12, 2005
Messages
764
Combine operator's and my trigger...

***Allies init trigger***
Event - Map Init
Action -
For Each Integer A from 1 to 12 do Actions
-For Each Integer B from 1 to 12 do Actions
--If Player(Integer B) is an ally of Player(Integer A)
---Set AllyNum[Integer A] = AllyNum[Integer A] + 1

***Add gold trigger***
Event - Every x seconds
Actions
For Each Integer A from 1 to 12 do Actions
-Add [FullAmmount]/AllyNum[Integer A] gold to Player(Integer A)
 
Status
Not open for further replies.
Top