Re: How To Use ActivateBonus
Posted: Thu Nov 29, 2007 11:44 pm
Took me a while, but I finally figured out how to get those Galactic Conquest bonuses working in mod maps. Ignore the scripting documentation for this, its wrong or outdated. Ignore the other functions with Bonus in them, they seem to have been removed from the game but left in the code.
The function you want to use is:where you replace <team> with the number of the team you want to have the bonus and <bonus> with the 'name' of the bonus you want the team to have. Its not very important where you put the ActivateBonus() line in the Lua.
Bonus 'Names':
team_bonus_advanced_blasters
team_bonus_autoturrets
team_bonus_bacta_tanks
team_bonus_combat_shielding
team_bonus_energy_boost
team_bonus_garrison
team_bonus_leader
team_bonus_sabotage
team_bonus_supplies
Here is a code example:Here is another code example:
Bonus Descriptions:
Advanced Blasters - Increases the damage of all blaster-type weapons
Auto Turrets - Adds defense grid turrets to your CPs
Bacta Tanks - Gives your units a health regen
Combat Shielding - Increases the health of your units
Energy Boost - Gives your units an energy regen
Garrison - Gives you extra reinforcements if your reinforcement count drops too low
Leader - Activates your team's playable hero
Sabotage - Causes enemy vehicles to spawn damaged
Supplies - Increases the amount of ammo and supplies your units can carry
Important Notes:
Each team can only have one bonus at a time. If you try to give a team two bonuses, you will get an error in the error log. However, the second bonus does replace the team's first bonus.
You may be able to clear/remove some bonuses by replacing <bonus> with an invalid bonus 'name'. Example: You will get an error in the error log about an invalid voice over sound. Just ignore it.
All these bonuses work online except team_bonus_autoturrets.
WARNING:
The team_bonus_autoturrets and team_bonus_supplies bonuses may crash others in MP. That is to say, if you use one of those bonuses in a map and that map is played online, everyone who attempts to connect to that server may crash to desktop, even though the admin (if not a dedicated server) will be able to play just fine. The crashes occurs when the bonuses are enabled ingame (like when using the FakeConsole mod). I'm not sure if the crashing still occurs when used in a mod map while the map is being loaded.
The function you want to use is:
Code: Select all
ActivateBonus( <team>, "<bonus>" )Bonus 'Names':
team_bonus_advanced_blasters
team_bonus_autoturrets
team_bonus_bacta_tanks
team_bonus_combat_shielding
team_bonus_energy_boost
team_bonus_garrison
team_bonus_leader
team_bonus_sabotage
team_bonus_supplies
Here is a code example:
Code: Select all
--give the rebels extra ammo
ActivateBonus( ALL, "team_bonus_supplies" )Code: Select all
--damage the Republic's vehicles
ActivateBonus( CIS, "team_bonus_sabotage" )Advanced Blasters - Increases the damage of all blaster-type weapons
Auto Turrets - Adds defense grid turrets to your CPs
Bacta Tanks - Gives your units a health regen
Combat Shielding - Increases the health of your units
Energy Boost - Gives your units an energy regen
Garrison - Gives you extra reinforcements if your reinforcement count drops too low
Leader - Activates your team's playable hero
Sabotage - Causes enemy vehicles to spawn damaged
Supplies - Increases the amount of ammo and supplies your units can carry
Important Notes:
Each team can only have one bonus at a time. If you try to give a team two bonuses, you will get an error in the error log. However, the second bonus does replace the team's first bonus.
You may be able to clear/remove some bonuses by replacing <bonus> with an invalid bonus 'name'. Example:
Code: Select all
ActivateBonus( IMP, "haha_no_bonus_for_you" )All these bonuses work online except team_bonus_autoturrets.
WARNING:
The team_bonus_autoturrets and team_bonus_supplies bonuses may crash others in MP. That is to say, if you use one of those bonuses in a map and that map is played online, everyone who attempts to connect to that server may crash to desktop, even though the admin (if not a dedicated server) will be able to play just fine. The crashes occurs when the bonuses are enabled ingame (like when using the FakeConsole mod). I'm not sure if the crashing still occurs when used in a mod map while the map is being loaded.