- Joined
- Aug 14, 2007
- Messages
- 66
Im trying to incorporate a system in my map that makes a computer controlled player serve as the pool of resources that every player on the same team withdraws from. Its pretty much that instead of 1 player controlling a base in a melee game, multiple Players on the same team control a base against another team of Players.
Each team has 5 players and 2 computers.
Main Computer - Owns workers and town hall types/barracks types. Shares resources, and vision with Players
Shared Computer - Owns blacksmith types/altar types. Shares resources with Main Computer. Also shares vision, and advanced unit control with Players.
So far I have each Players gold set to their Main Computer's resources divided by 5 (the number of players on the team) and the Shared Computer's resources set to the Main Computer's resources.
Now players can gain control of any one unit that isn't a building or a hero at any time. So they can grab a worker thats currently harvesting and build a tower somewhere.
Im having some issues with the pricing of this. So far the trigger looks like this:
The event Unit begins an upgrade or cancels an upgrade refers to a building upgrading into another building like a town hall becoming a keep. Not a research tech from say a blacksmith.
Now this works swimmingly for beginning upgrades and construction but when I cancel it for some reason there is a net gain in resources. Im not sure why that happens so if you know please post for +reps.
Now for my shared computer problem. The shared computer is where players buy heroes for their Team's Main Computer and upgrades for everyone. For purchasing heroes I am going to use an upgrade system with custom upgrades for each hero. The problem lies within the pricing of upgrades.
This is my trigger so far:
Now this works swimmingly as long as the blacksmith type unit only purchases one research throughout the time that the research is being researched.
The events only allow the actions to occur when a player cancels a research being researched, or when a unit begins researching a research.
So if a player purchases a research the unit will start to research and they will lose resources correctly. But when they purchase other researches while the first one is being researched the trigger does not work making each additional research purchased free of charge.
So I need to either prevent players from purchasing multiple researches on a single unit or allow the trigger to fire when multiple researches are purchased from a single unit.
+reps for help
Each team has 5 players and 2 computers.
Main Computer - Owns workers and town hall types/barracks types. Shares resources, and vision with Players
Shared Computer - Owns blacksmith types/altar types. Shares resources with Main Computer. Also shares vision, and advanced unit control with Players.
So far I have each Players gold set to their Main Computer's resources divided by 5 (the number of players on the team) and the Shared Computer's resources set to the Main Computer's resources.
-
Resources
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Player - Set Team 1 (Player 1) Current gold to ((Team 1 Main Computer (Player 11) Current gold) / 5)
-
Player - Set Team 1 (Player 1) Current lumber to ((Team 1 Main Computer (Player 11) Current lumber) / 5)
-
Player - Set Team 2 (Player 6) Current gold to ((Team 2 Main Computer (Player 12) Current gold) / 5)
-
Player - Set Team 2 (Player 6) Current lumber to ((Team 2 Main Computer (Player 12) Current lumber) / 5)
-
Player - Set Team 1 Shared Computer (Neutral Extra) Current gold to ((Team 1 Main Computer (Player 11) Current gold) + 0)
-
Player - Set Team 1 Shared Computer (Neutral Extra) Current lumber to ((Team 1 Main Computer (Player 11) Current lumber) + 0)
-
Player - Set Team 2 Shared Computer (Neutral Victim) Current gold to ((Team 2 Main Computer (Player 12) Current gold) + 0)
-
Player - Set Team 2 Shared Computer (Neutral Victim) Current lumber to ((Team 2 Main Computer (Player 12) Current lumber) + 0)
-
-
Now players can gain control of any one unit that isn't a building or a hero at any time. So they can grab a worker thats currently harvesting and build a tower somewhere.
Im having some issues with the pricing of this. So far the trigger looks like this:
-
Construction
-
Events
-
Unit - A unit Begins construction
-
Unit - A unit Cancels construction
-
Unit - A unit Begins an upgrade
-
Unit - A unit Cancels an upgrade
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Owner of (Triggering unit)) Equal to Team 1(Player 1)
-
(Owner of (Triggering unit)) Equal to Team 1(Player 2)
-
(Owner of (Triggering unit)) Equal to Team 1(Player 3)
-
(Owner of (Triggering unit)) Equal to Team 1(Player 4)
-
(Owner of (Triggering unit)) Equal to Team 1(Player 5)
-
-
-
-
Then - Actions
-
Player - Set Team 1 Main Computer (Player 11) Current gold to ((Team 1(Player 1) Current gold) + (Team 1(Player 2) Current gold) + ((Team 1(Player 3) Current gold) + ((Team 1(Player 4) Current gold) + (Team 1(Player 5) Current gold)))))
-
Player - Set Team 1 Main Computer (Player 11) Current lumber to ((Team 1(Player 1) Current lumber) + ((Team 1(Player 2) Current lumber) + ((Team 1(Player 3) Current lumber) + ((Team 1(Player 4) Current lumber) + (Team 1(Player 5) Current lumber)))))
-
-
Else - Actions
-
Do nothing
-
-
-
Trigger - Run Resources <gen> (checking conditions)
-
-
The event Unit begins an upgrade or cancels an upgrade refers to a building upgrading into another building like a town hall becoming a keep. Not a research tech from say a blacksmith.
Now this works swimmingly for beginning upgrades and construction but when I cancel it for some reason there is a net gain in resources. Im not sure why that happens so if you know please post for +reps.
Now for my shared computer problem. The shared computer is where players buy heroes for their Team's Main Computer and upgrades for everyone. For purchasing heroes I am going to use an upgrade system with custom upgrades for each hero. The problem lies within the pricing of upgrades.
This is my trigger so far:
-
Research Cost
-
Events
-
Unit - A unit Begins research
-
Unit - A unit Cancels research
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Researching unit)) Equal to Team 1 Shared Computer (Neutral Extra)
-
-
Then - Actions
-
Player - Set Team 1 Main Computer (Player 11) Current gold to (Team 1 Shared Computer (Neutral Extra) Current gold)
-
Player - Set Player 11 (Dark Green) Current lumber to (Team 1 Shared Computer (Neutral Extra) Current lumber)
-
-
Else - Actions
-
Do nothing
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Researching unit)) Equal to Neutral Victim
-
-
Then - Actions
-
Player - Set Team 2 Main Computer (Player 11) Current gold to (Team 2 Shared Computer (Neutral Victim) Current gold)
-
Player - Set Team 2 Main Computer (Player 11) Current lumber to (Team 2 Shared Computer (Neutral Victim) Current lumber)
-
-
Else - Actions
-
Do nothing
-
-
-
-
Now this works swimmingly as long as the blacksmith type unit only purchases one research throughout the time that the research is being researched.
The events only allow the actions to occur when a player cancels a research being researched, or when a unit begins researching a research.
So if a player purchases a research the unit will start to research and they will lose resources correctly. But when they purchase other researches while the first one is being researched the trigger does not work making each additional research purchased free of charge.
So I need to either prevent players from purchasing multiple researches on a single unit or allow the trigger to fire when multiple researches are purchased from a single unit.
+reps for help