diff --git a/RotorOps-PERKS.md b/RotorOps-PERKS.md index ec5534f..a22bdd2 100644 --- a/RotorOps-PERKS.md +++ b/RotorOps-PERKS.md @@ -68,6 +68,35 @@ The script is desinged to be easy to create your own perks for your use or to ea - Max uses per mission - Points cost +### Creating Perks +You can create your own perks by modifying the script, or from another script after the perks script has loaded (preferred method). The radio menu and all other aspects are handled automatically. First define a function that will fire when the perk is activated by a player. Then add the perk table to RotorOpsPerks.perks, like below: + +``` +---- INSTANT STRIKE PERK ---- + +function requestStrikePerk(args) + --explosion at target point after 10 seconds + timer.scheduleFunction(function() + trigger.action.explosion(args.target_point, 1000) + end, nil, timer.getTime() + 10) +end + +RotorOpsPerks.perks["strike"] = { + perk_name='strike', --name used for target marks on F10 map + display_name='Instant Strike', + cost=100, + cooldown=60, --minimum seconds between uses in mission + max_per_player=1, + max_per_mission=3, + at_mark=true, --if players can request a map mark as the target + at_position=false, --if players can request their own position as the target + enabled=true, + last_used=0, --don't change + used=0, --don't change + action_function=requestStrikePerk --the name of your predefined function to call when the perk is used +} +``` + ## Demo Mission Check out the PERKS system together with our atmospheric Black Hawk Down mission! [Demo Mission: Black Hawk Down](https://dcs-helicopters.com/wp-content/uploads/2023/01/ROTOROPS_PERKS_1_1-Black_Hawk_Down_Pt_1.miz)