sorry im VERY new to triggers and kinda suck with that ... kinda being a understatement for.. I SUCK UGE CHUNKS
and i need a small hand.
Is it possible to have a trigger check how many players are in the game. and with that add a % of HP and Damage to Units belonging to a predetermined player?
basically i have a RPG game. 1-4 players.... i want mobs to get more Hp and more damage depending on players in the game.
each player in game adds 10% to player 15
1 player = +0% to player 15, HP and damage
2players= +10% to player 15, HP and damage
3player= +20% to player 15, HP and damage
4players = +30% to player 15, HP and damage
how would i do that?
if you can show me an example with the explanation , it would help ALLOT!!! lol.
Ok here is how you do it. Sorry For the long post.
First create a upgrade similar to the marine combat shield but for the units you want it to effect. But set the possible levels of the upgrade to 4. This will add health to your unit.
Next create a upgrade similar to the weapon upgrades, that add damage to the unit you want.
Once you have created these two upgrades in the data editor do this.
Event: Every .1 seconds of Game Time
Action:
If
Player 1 status= playing
Then
Add Upgrade 1 (Health Upgrade) for player (Enemy Player Number)
Add Upgrade 1 (Weapon Upgrade) for player (Enemy Player Number)
If
Player 2 status= playing
Then
Add Upgrade 1 (Health Upgrade) for player (Enemy Player Number)
Add Upgrade 1 (Weapon Upgrade) for player (Enemy Player Number)
If
Player 3 status= playing
Then
Add Upgrade 1 (Health Upgrade) for player (Enemy Player Number)
Add Upgrade 1 (Weapon Upgrade) for player (Enemy Player Number)
If
Player 4 status= playing
Then
Add Upgrade 1 (Health Upgrade) for player (Enemy Player Number)
Add Upgrade 1 (Weapon Upgrade) for player (Enemy Player Number)
Then Simply do the same thing saying if status of (player)= left the game then remove 1 of both upgrades
I'm to lazy for an example right now, but I write something anyway.
First you need to save the amount of active players in a variable. Active players is a player group. That's the count of your players.
You can use upgrades, catalog for the bonus. That's the way with the best performance, but just adding a buff to every unit of a player shouldn't eat up many FPS.
-> So you should add a buff to every unit of player 15 which is created (event: enters region which would be "whole map"). The buff can adjust the damage and the health. You could adjust the health with triggers, too.
I would use 4 buffs and update them (delete old, apply new), if a player leaves the game (event).
@ricklypop: Go
Executing code every 0.1 seconds is terrible.
I am pretty sure, you can even do this data-only :)
There are multiple ways to modify health and damage for a unit, each with advantages and disadvantages. You can:
use upgrades or catalog triggers: They modify specific data fields for specific players. Advantage would be, that once changed, it affects all units, current and future, so no additional handling is required after modifying the fields. On the other side, you need to select and modify each unit type and each damage effect individually.
use trigger functions: You can modify the health of units directly with the UnitProperty functions. Nice and easy, but you need to modify each individual unit at creation; also this does not work for damage.
use data behaviors: You can use a stacking behavior and apply stacks based on player number. They can modify hp and damage easily, but need to be applied to all units individually.
Data-only would involve dummy units for each player emitting an aura to apply the stacking behavior. You can set a behavior to only stack once per caster, so they don't overlap.
hey guys.
sorry im VERY new to triggers and kinda suck with that ... kinda being a understatement for.. I SUCK UGE CHUNKS
and i need a small hand.
Is it possible to have a trigger check how many players are in the game. and with that add a % of HP and Damage to Units belonging to a predetermined player?
basically i have a RPG game. 1-4 players.... i want mobs to get more Hp and more damage depending on players in the game.
each player in game adds 10% to player 15
1 player = +0% to player 15, HP and damage
2players= +10% to player 15, HP and damage
3player= +20% to player 15, HP and damage
4players = +30% to player 15, HP and damage
how would i do that?
if you can show me an example with the explanation , it would help ALLOT!!! lol.
thanks :)
Ok here is how you do it. Sorry For the long post.
First create a upgrade similar to the marine combat shield but for the units you want it to effect. But set the possible levels of the upgrade to 4. This will add health to your unit.
Next create a upgrade similar to the weapon upgrades, that add damage to the unit you want.
Once you have created these two upgrades in the data editor do this.
Event: Every .1 seconds of Game Time
Action:
If
Player 1 status= playing
Then
Add Upgrade 1 (Health Upgrade) for player (Enemy Player Number)
Add Upgrade 1 (Weapon Upgrade) for player (Enemy Player Number)
If
Player 2 status= playing
Then
Add Upgrade 1 (Health Upgrade) for player (Enemy Player Number)
Add Upgrade 1 (Weapon Upgrade) for player (Enemy Player Number)
If
Player 3 status= playing
Then
Add Upgrade 1 (Health Upgrade) for player (Enemy Player Number)
Add Upgrade 1 (Weapon Upgrade) for player (Enemy Player Number)
If
Player 4 status= playing
Then
Add Upgrade 1 (Health Upgrade) for player (Enemy Player Number)
Add Upgrade 1 (Weapon Upgrade) for player (Enemy Player Number)
Then Simply do the same thing saying if status of (player)= left the game then remove 1 of both upgrades
I'm to lazy for an example right now, but I write something anyway.
First you need to save the amount of active players in a variable. Active players is a player group. That's the count of your players.
You can use upgrades, catalog for the bonus. That's the way with the best performance, but just adding a buff to every unit of a player shouldn't eat up many FPS.
-> So you should add a buff to every unit of player 15 which is created (event: enters region which would be "whole map"). The buff can adjust the damage and the health. You could adjust the health with triggers, too.
I would use 4 buffs and update them (delete old, apply new), if a player leaves the game (event).
@ricklypop: Go Executing code every 0.1 seconds is terrible.
ok so if i understand ( ill give damage example cause HP is the same )
make 4 damage Upgrade ( like regular ups ) give does 4 upgrade to ALL the mob types in the map??? ( belonging to enemy )
then creat does triggers witch will add or remove 1 upgrade value?
sorta like an upgrade in the actual game , but instead of paying 100 minerals you pay with a player : being in game. lol
meh Its one way to do it and i just put a random number it could be faster and i have done it before, worked fine so :P
I am pretty sure, you can even do this data-only :)
There are multiple ways to modify health and damage for a unit, each with advantages and disadvantages. You can:
Data-only would involve dummy units for each player emitting an aura to apply the stacking behavior. You can set a behavior to only stack once per caster, so they don't overlap.
What you want to use is up to you.