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

Need help with triggers I can't make, map project: Settlers of Catan

Status
Not open for further replies.
Level 3
Joined
Jan 3, 2019
Messages
15
Hey all!

Not sure if this post is in the right place, but looking at "Request a Resource" makes me believe it's only for models and graphical stuff. Looking at the description of "Triggers & Scripts" it clearly states that "if you need help getting started with a trigger, this is not the right place — use the World Editor Help Zone." So I hope this is the right place for this!

I've started to make a map based on the well known board game Settlers of Catan.

You will find info about the map further down the post.

I need help

I have put the last two weeks of my time into the project and now sadly, I can't continue because I lack the skills required to make variable-based complex triggers that is still needed to complete the map.

The things that still needs triggers are:
  • Turn-based system
  • Generated income when typing -roll
  • Frequent updating point-status, longest road, largest army in multiboard
  • Trading system
  • Robber functions (Also needs a unit, working on this)
Alot is already done, I think its "only" the above thats missing to make the map playable.

I have attached the map so that you can give it a go!

In-game commands are atm: -reg (regenerate resources) -ready (start game) and -roll (roll the dice)

Info about game and Map:


Before game start:

The map is for 4 players, red, blue, orange and white "settler". The game begins with random generation of resources: sheep, clay, stone, tree and wheat in 65 regions of a total 69 random regions (13 of each resource) which leaves 4 spaces empty (aka. deserts which yields no income of any sort).

Along with that, there are also 65 randomly generated numbers between 2 and 12 (Except the number 7, I'll come to this) in the 65 regions that now contains a random resource.

Host can now type -reg to regenerate resource and number locations, this works until all 4 players have typed -ready.

Game start:

When all 4 players have typed -ready, a random player is picked to begin placing his first free settlement and road. When the settlement and road is placed by that player, turn goes over to next player in line: (if orange was picked (player 3) then its now whites turn (player 4) to place his/her first settlement and road. Next up is now player 1 and then it's player 2. When player 2 have placed his first settlement and road he may place another settlement and road since he was the last one in line. When this is done, turn goes over to player 1, then player 4 and lastly player 3 (who got to start). So all in all, all 4 players will start the game by placing 2 free settlements and 2 free roads.

Player who was picked to start (player 3 orange) now has a timer of 60 seconds to make his turn, player starts by rolling the dice by typing -roll. If a resource have the random number that is rolled, all players gain 1 of that resource for each nearby settlement they have to the region (2 if they've upgraded to a city). If player 3 orange have enough resources he can now (within his turn of 60 seconds or until "-done") either build a road, a settlement, upgrade a settlement to a city, buy a developer card or trade resources with other players. After 60 seconds has passed (or player typed "-done") the turn goes over to the next player (player 4 white in this case) and procedure continues like this)

Number 7:

If a player rolls a 7, that player gets to move the Robber. The Robber is placed on a region to block that regions source of income until moved and also the player steals a random resource from a random player who has a settlement/city connected to the region. (Often placed on region that player with the most points has settlements/citys around and that has numbers like 6, 8 and 9 (which rolls most often). Another thing with #7 is that you may have a maximum of 7 resources on you, if you have 8 or more you have to discard half that amount. For example: If you have 8 resources, you trash 4 (selected by you) gathered resources. If you have 9 you also trash 4. (10 = 5, 11 = 5, 12 = 6 and so on). When number 7 is rolled again, the rolling player moves the robber to another region.

Costs:
  • Road: 1 clay 1 tree
  • Settlement: 1 clay 1 tree 1 sheep 1 wheat
  • City: 2 wheat 3 stone
  • Development card: 1 sheep 1 wheat 1 stone
Development cards that players can purchase during their turn consists of:

(Development cards can only be played on the players next turn after obtaining the card)
  • 14x Knight cards (can be used to move the robber)
  • 2x Monopoly cards (can be used to steal all other players resources of a specific type)
  • 5x Victory cards (can be played to gain 1 victory point, often not played until you know you will win by playing it)
  • 3x Progress cards (can be played to obtain 2 free resources selected by player)
  • 2x Building cards (can be played to build 2 free roads)
Victory points:
  • 1 settlement equals 1 victory point
  • 1 city equals 2 victory points
  • player with longest connected road (minimum of 5 connected) equals 2 victory points
  • player with the largest army (minimum of 3 played) equals 2 victory points
  • 1 victory card equals 1 victory point
To be crowned the winner you need 14 victory points.

Screenshots:


Thanks for reading! :)
 

Attachments

  • Settlers of Catan v0.0.688.w3x
    210 KB · Views: 42
Level 24
Joined
Feb 9, 2009
Messages
1,787
"Resource" I would like to believe include Triggers as you're requesting that the triggers be done for you.
Although Request a "Resource" isn't all that descriptive in the first place!
I'll see if I can't take a closer look at your request today though, I'm pretty amateur but I'll see what I can do.
 
Level 3
Joined
Jan 3, 2019
Messages
15
"Resource" I would like to believe include Triggers as you're requesting that the triggers be done for you.
Although Request a "Resource" isn't all that descriptive in the first place!
I'll see if I can't take a closer look at your request today though, I'm pretty amateur but I'll see what I can do.

I see! It felt right, but when browsing it, it kinda seemed wrong hehe :) If it truly is in the wrong, a moderator will surely help me move it to the right category.

Thanks alot for taking a look at it! If you're amateur, then I'm super noob :). I'm very grateful for your help, i truly value it!

Let me know if you have any questions regarding anything, I'll be happy to answer.

Forgot to mention that I will also implement "harbours" where players can trade 3:1 resource and 2:1. 4:1 trade should be available to everyone. I think harbours will be shops with spells and if specific spell is triggered, a deduction of players resource will occur + adding the requested resource to the player balance, shouldn't be too hard, I think I can manage this.
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
Generating income sounds easy enough if you mean the base gold / lumber values.
But unfortunately the rest looks over my head.

  • Income
    • Events
    • Conditions
    • Actions
      • Player - Set Player 1 (Red) Current gold to 750
      • Player - Add 1000 to Player 1 (Red) Current gold
      • Player - Divert 0% of the Gold income of Player 1 (Red) to Player 2 (Blue)
Abuse the Search function as well.
[Link] - Turn Based WC ( from searching Turn-Based System )
 
Level 3
Joined
Jan 3, 2019
Messages
15
Generating income sounds easy enough if you mean the base gold / lumber values.
But unfortunately the rest looks over my head.

  • Income
    • Events
    • Conditions
    • Actions
      • Player - Set Player 1 (Red) Current gold to 750
      • Player - Add 1000 to Player 1 (Red) Current gold
      • Player - Divert 0% of the Gold income of Player 1 (Red) to Player 2 (Blue)
Abuse the Search function as well.
[Link] - Turn Based WC ( from searching Turn-Based System )

Resources are stored in variables, thanks for the link! It helped me create an idea so now I have the ground for the turn-based system, looks like this atm, there are some things I still can't figure out, for example, if player 3 is the starting player, it should go to: 4, 1, 2, 2, 1, 4, 3. My current setup doesn't make that happen hehe. See below:

  • Red types ready
    • Events
      • Player - Player 1 (Red) types a chat message containing -ready as An exact match
    • Conditions
    • Actions
      • Set Ready = (Ready + 4.00)
      • Game - Display to (All players) the text: (|c00ff0000 + ((Name of Player 1 (Red)) + |r is |c0000ff24ready|r!))
      • Trigger - Turn off (This trigger)
  • All players typed ready
    • Events
      • Game - Ready becomes Equal to 4.00
    • Conditions
    • Actions
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: |c0000ff2aMatch is ...
      • Wait 2.00 seconds
      • Set Roll = 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Roll Equal to 1
        • Then - Actions
          • Game - Display to (All players) for 15.00 seconds the text: (PC[1] + ((Name of Player 1 (Red)) + |r, you may now place your first settlement.))
          • Cinematic - Ping minimap for (All players) at (Center of (Playable map area)) for 5.00 seconds, using a Simple ping of color (100.00%, 0.00%, 0.00%)
          • Trigger - Turn on FirstTimeSelectBuildRedSettlement <gen>
          • Trigger - Turn on Deselect build red <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Roll Equal to 2
            • Then - Actions
              • Game - Display to (All players) for 15.00 seconds the text: (PC[2] + ((Name of Player 2 (Blue)) + |r, you may now place your first settlement.))
              • Cinematic - Ping minimap for (All players) at (Center of (Playable map area)) for 5.00 seconds, using a Simple ping of color (0.00%, 0.00%, 100.00%)
              • Trigger - Turn on FirstTimeSelectBuildBlueSettlement <gen>
              • Trigger - Turn on Deselect build blue <gen>
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Roll Equal to 3
                • Then - Actions
                  • Game - Display to (All players) for 15.00 seconds the text: (PC[3] + ((Name of Player 6 (Orange)) + |r, you may now place your first settlement.))
                  • Cinematic - Ping minimap for (All players) at (Center of (Playable map area)) for 5.00 seconds, using a Simple ping of color (100.00%, 75.00%, 0.00%)
                  • Trigger - Turn on FirstTimeSelectBuildOrangeSettlement <gen>
                  • Trigger - Turn on Deselect build orange <gen>
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Roll Equal to 4
                    • Then - Actions
                      • Game - Display to (All players) for 15.00 seconds the text: (PC[4] + ((Name of Player 22 (Snow)) + |r, you may now place your first settlement.))
                      • Cinematic - Ping minimap for (All players) at (Center of (Playable map area)) for 5.00 seconds, using a Simple ping of color (100.00%, 100.00%, 100.00%)
                      • Trigger - Turn on FirstTimeSelectBuildWhiteSettlement <gen>
                      • Trigger - Turn on Deselect build white <gen>
                    • Else - Actions
                      • Game - Display to (All players) for 30.00 seconds the text: You seem to be miss...
                      • Wait 30.00 seconds
                      • Player Group - Pick every player in (All players) and do (Actions)
                        • Loop - Actions
                          • Game - Defeat (Picked player) with the message: |c00ff0000Defeat!|r...
      • Trigger - Turn off (This trigger)
  • Deselect build red
    • Events
      • Player - Player 1 (Red) Deselects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • ((Unit-type of (Triggering unit)) Equal to Ground for settlements) and ((Owner of (Triggering unit)) Not equal to Neutral Passive)
          • ((Unit-type of (Triggering unit)) Equal to Ground for roads) and ((Owner of (Triggering unit)) Not equal to Neutral Passive)
    • Actions
      • Unit - Change ownership of (Triggering unit) to Neutral Passive and Change color
  • FirstTimeSelectBuildRedSettlement
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • ((Unit-type of (Triggering unit)) Equal to Ground for settlements) and ((Owner of (Triggering unit)) Equal to Neutral Passive)
    • Actions
      • Unit - Change ownership of (Triggering unit) to (Triggering player) and Change color
      • Wait until ((Number of units in (Units owned by Player 1 (Red) of type Settlement)) Equal to 1), checking every 1.00 seconds
      • Game - Display to (All players) for 15.00 seconds the text: (PC[1] + ((Name of Player 1 (Red)) + |r, you may now place one road.))
      • Trigger - Turn on FirstTimeSelectBuildRedRoad <gen>
      • Trigger - Turn off (This trigger)
  • FirstTimeSelectBuildRedRoad
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • ((Unit-type of (Triggering unit)) Equal to Ground for roads) and ((Owner of (Triggering unit)) Equal to Neutral Passive)
    • Actions
      • Unit - Change ownership of (Triggering unit) to (Triggering player) and Change color
      • Wait until ((Number of units in (Units owned by Player 1 (Red) of type Road)) Greater than or equal to 1), checking every 3.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Road units owned by Player 1 (Red)) Equal to 2
        • Then - Actions
          • Trigger - Turn off Deselect build red <gen>
          • Trigger - Turn on Red players turn <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (All players) for 15.00 seconds the text: (PC[2] + ((Name of Player 2 (Blue)) + |r, you may now place a settlement.))
          • Trigger - Turn on FirstTimeSelectBuildBlueSettlement <gen>
          • Trigger - Turn off Deselect build red <gen>
          • Trigger - Turn off (This trigger)
And so on...

  • Red players turn
    • Events
    • Conditions
      • (Player 1 (Red) slot status) Equal to Is playing
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True)) and do (Unit - Pause (Picked unit))
      • Cinematic - Ping minimap for (All players) at (Center of (Playable map area)) for 5.00 seconds, using a Simple ping of color (100.00%, 0.00%, 0.00%)
      • Trigger - Turn on Select build red <gen>
      • Trigger - Turn on Deselect build red <gen>
      • Trigger - Turn on Red roll <gen>
      • Game - Display to (All players) the text: (PC[1] + ((Name of Player 1 (Red)) + |r, you're up!))
      • Countdown Timer - Create a timer window for RoundTimer with title (null)
      • Countdown Timer - Change the title of (Last created timer window) to (PC[1] + ((Name of Player 1 (Red)) + |r's turn))
      • Countdown Timer - Change the color of the time for (Last created timer window) to (0.00%, 100.00%, 0.00%) with 0.00% transparency
      • Countdown Timer - Show (Last created timer window)
      • Countdown Timer - Start RoundTimer as a One-shot timer that will expire in 60.00 seconds
      • Countdown Timer - Change the color of the time for (Last created timer window) to (100.00%, 0.00%, 0.00%) with 0.00% transparency
      • Wait until (((Elapsed time for RoundTimer) Greater than 59.00) or ((Ability being cast) Equal to Animate Dead)), checking every 0.50 seconds
      • Countdown Timer - Destroy (Last created timer window)
      • Game - Display to (All players) the text: (PC[1] + ((Name of Player 1 (Red)) + 's|r turn is over))
      • Trigger - Turn off Select build red <gen>
      • Trigger - Turn off Deselect build red <gen>
      • Trigger - Turn off Red roll <gen>
      • Trigger - Run Blue players turn <gen> (checking conditions)
  • Select build red
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • ((Unit-type of (Triggering unit)) Equal to Ground for settlements) and ((Owner of (Triggering unit)) Equal to Neutral Passive)
          • ((Unit-type of (Triggering unit)) Equal to Ground for roads) and ((Owner of (Triggering unit)) Equal to Neutral Passive)
    • Actions
      • Unit - Change ownership of (Triggering unit) to (Triggering player) and Change color
Then when starting phase is done it goes on to, which does not work atm, I need the rolled number to give out resources to players where the number occurs and if they have a settlement/city on that number:

  • Red roll
    • Events
      • Player - Player 1 (Red) types a chat message containing -roll as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (|c00ff0000 + ((Name of (Triggering player)) + |r is rolling the dice...))
      • Wait 3.00 seconds
      • Trigger - Run Red players turn <gen> (checking conditions)
      • Game - Display to (All players) the text: (PC[1] + ((Name of Player 1 (Red)) + |r, you're up!))
      • Wait 1.00 seconds
      • Set AlgNumbersTypes[1] = 2
      • Set AlgNumbersTypes[2] = 3
      • Set AlgNumbersTypes[3] = 4
      • Set AlgNumbersTypes[4] = 5
      • Set AlgNumbersTypes[5] = 6
      • Set AlgNumbersTypes[6] = 7
      • Set AlgNumbersTypes[7] = 8
      • Set AlgNumbersTypes[8] = 9
      • Set AlgNumbersTypes[9] = 10
      • Set AlgNumbersTypes[10] = 11
      • Set AlgNumbersTypes[11] = 12
      • Set Roll = AlgNumbersTypes[(Random integer number between 1 and 11)]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Roll Equal to AlgNumbersTypes[6]
        • Then - Actions
          • Game - Display to (All players) the text: (((|c00ff0000 + (Name of (Triggering player))) + |r rolled #) + ((String(Roll)) + and may now place the robber!))
        • Else - Actions
          • For each (Integer A) from 1 to 69, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Roll Equal to AlgNumbersTypes[(Integer B)]
                • Then - Actions
                  • Game - Display to (All players) the text: (((|c00ff0000 + (Name of (Triggering player))) + |r rolled #) + ((String(Roll)) + and may now place the robber!))
                • Else - Actions
                  • Game - Display to (All players) the text: (((PC[1] + (Name of (Triggering player))) + |r rolled #) + ((String(Roll)) + (! +1 + (Name of (Random unit from (Units owned by Neutral Passive matching ((Unit-type of (Matching unit)) Equal to AlgResourceTypes[(Integer A)])))))))
                  • Set Clay[(Integer A)] = (Clay[(Integer A)] + 1)
      • Trigger - Turn on Blue roll <gen>
      • Trigger - Turn off (This trigger)
And heres the resource generation:

  • Alg Generate resources
    • Events
    • Conditions
    • Actions
      • -------- Regions --------
      • Set AlgRegionsCount = 69
      • Set RRR[1] = (RRR1 <gen> offset by (0.00, 0.00))
      • ...
      • Set RRR[69] = (RRR69 <gen> offset by (0.00, 0.00))
      • -------- Numbers --------
      • Set AlgFloatCount = 0
      • Set AlgNumbersCount = 10
      • Set AlgNumbersTypes[1] = 2
      • Set AlgNumbersTypes[2] = 3
      • Set AlgNumbersTypes[3] = 4
      • Set AlgNumbersTypes[4] = 5
      • Set AlgNumbersTypes[5] = 6
      • Set AlgNumbersTypes[6] = 8
      • Set AlgNumbersTypes[7] = 9
      • Set AlgNumbersTypes[8] = 10
      • Set AlgNumbersTypes[9] = 11
      • Set AlgNumbersTypes[10] = 12
      • Set AlgNumbersColorCount = 5
      • Set AlgNumbersColorTypes[1] = |c0050f4d3
      • Set AlgNumbersColorTypes[2] = |c00c67000
      • Set AlgNumbersColorTypes[3] = |c00c4c4c4
      • Set AlgNumbersColorTypes[4] = |c0000bf16
      • Set AlgNumbersColorTypes[5] = |c00ffd400
      • Set AlgNumbersColorTypeListCount = 0
      • -------- Resources --------
      • Set AlgResourceTypesCount = 5
      • Set AlgResourceTypes[1] = |c0050f4d3Sheep|r Resource
      • Set AlgResourceTypes[2] = |c00c67000Clay|r Resource
      • Set AlgResourceTypes[3] = |c00c4c4c4Stone|r Resource
      • Set AlgResourceTypes[4] = |c0000bf16Tree|r Resource
      • Set AlgResourceTypes[5] = |c00ffd400Wheat|r Resource
      • Set AlgResourceTypeListCount = 0
      • -------- Terrain --------
      • Set AlgTerrainCount = 5
      • Set AlgTerrainTypes[1] = Lordaeron Summer - Grass
      • Set AlgTerrainTypes[2] = Barrens - Rough Dirt
      • Set AlgTerrainTypes[3] = Lordaeron Summer - Rock
      • Set AlgTerrainTypes[4] = Lordaeron Summer - Dark Grass
      • Set AlgTerrainTypes[5] = Lordaeron Summer - Grassy Dirt
      • Set AlgTerrainTypeListCount = 0
      • For each (Integer A) from 1 to 13, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to AlgResourceTypesCount, do (Actions)
            • Loop - Actions
              • Set AlgResourceTypeListCount = (AlgResourceTypeListCount + 1)
              • Set AlgResourceTypes[AlgResourceTypeListCount] = AlgResourceTypes[(Integer B)]
              • Set AlgTerrainTypeListCount = (AlgTerrainTypeListCount + 1)
              • Set AlgTerrainTypes[AlgTerrainTypeListCount] = AlgTerrainTypes[(Integer B)]
              • Set AlgNumbersColorTypeListCount = (AlgNumbersColorTypeListCount + 1)
              • Set AlgNumbersColorTypes[AlgNumbersColorTypeListCount] = AlgNumbersColorTypes[(Integer B)]
      • Set AlgTempInteger = AlgResourceTypeListCount
      • For each (Integer A) from 1 to AlgTempInteger, do (Actions)
        • Loop - Actions
          • Set AlgRandomRegion = (Random integer number between 1 and AlgRegionsCount)
          • Set AlgRandomResourceType = (Random integer number between 1 and AlgResourceTypeListCount)
          • Set AlgTerrainCount = ((Random integer number between 1 and AlgTerrainTypeListCount) + 1)
          • Set AlgNumbersCount = AlgNumbersTypes[(Random integer number between 1 and 10)]
          • Set AlgFloatCount = (AlgFloatCount + 1)
          • Floating Text - Create floating text that reads ((AlgNumbersColorTypes[AlgRandomResourceType] + #|r) + (String(AlgNumbersCount))) at (Center of RRR[AlgRandomRegion]) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set FloatTextNumber[AlgFloatCount] = (Last created floating text)
          • Environment - Change terrain type at (Center of RRR[AlgRandomRegion]) to AlgTerrainTypes[AlgRandomResourceType] using variation -1 in an area of size 2 and shape Square
          • Unit - Create 1 AlgResourceTypes[AlgRandomResourceType] for Neutral Passive at (Center of RRR[AlgRandomRegion]) facing (Random angle) degrees
          • Unit Group - Add (Last created unit) to AllResources
          • Set RRR[AlgRandomRegion] = RRR[AlgRegionsCount]
          • Set AlgRegionsCount = (AlgRegionsCount - 1)
          • Set AlgResourceTypes[AlgRandomResourceType] = AlgResourceTypes[AlgResourceTypeListCount]
          • Set AlgResourceTypeListCount = (AlgResourceTypeListCount - 1)
          • Set AlgTerrainTypes[AlgRandomResourceType] = AlgTerrainTypes[AlgTerrainTypeListCount]
          • Set AlgTerrainTypeListCount = (AlgTerrainTypeListCount - 1)
          • Set AlgNumbersColorTypes[AlgRandomResourceType] = AlgNumbersColorTypes[AlgNumbersColorTypeListCount]
          • Set AlgNumbersColorTypeListCount = (AlgNumbersColorTypeListCount - 1)
 
Last edited:
Status
Not open for further replies.
Top