Difference between revisions of "Osiris/API/SetCanFight"
From Divinity Engine Wiki
(Osiris Core APIs) |
m |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
Sets whether '''_Target''' can fight in combats (get a turn in combats) depending on whether '''_Enabled''' is 0 or 1. | Sets whether '''_Target''' can fight in combats (get a turn in combats) depending on whether '''_Enabled''' is 0 or 1. | ||
===== Notes ===== | ===== Notes ===== | ||
− | * Fighting in a combat means performing actions to heal/hurt other participants in the combat. Controlling whether or not a character/item will enter the turn-based mode of combats happens using the | + | * Fighting in a combat means performing actions to heal/hurt other participants in the combat. Controlling whether or not a character/item will enter the turn-based mode of combats happens using the [[Osiris/API/SetCanJoinCombat|SetCanJoinCombat]] call. |
* Disabling this for NPCs means that they will not perform any actions when it is their turn in combat. Note that this can easily wreak havoc due to interactions with other systems, such as the crime system. | * Disabling this for NPCs means that they will not perform any actions when it is their turn in combat. Note that this can easily wreak havoc due to interactions with other systems, such as the crime system. | ||
− | * If '''''CanFight''''' is disabled for all enemies in combat, the combat will end immediately. Attacking a single, | + | * If '''''CanFight''''' is disabled for all enemies in combat, the combat will end immediately. Attacking a single, non-alied enemy whose '''''CanFight''''' is disabled may therefore start and immediately end a combat. |
* If you disable this for a player during a scripted event, ensure it is re-enabled in all possible exits! | * If you disable this for a player during a scripted event, ensure it is re-enabled in all possible exits! | ||
===== See Also ===== | ===== See Also ===== | ||
− | * [[Osiris/API/SetCanJoinCombat]] | + | * [[Osiris/API/SetCanJoinCombat|SetCanJoinCombat]] |
− | + | * [[Osiris/API/CharacterCanFight|CharacterCanFight]] | |
− | [[Category:Osiris Calls]] | + | |
+ | [[Category:Osiris Calls|SetCanFight]] |
Latest revision as of 19:13, 4 February 2018
Full Definition(s)
- call SetCanFight((GUIDSTRING)_Target, (INTEGER)_Enabled)
Description
Sets whether _Target can fight in combats (get a turn in combats) depending on whether _Enabled is 0 or 1.
Notes
- Fighting in a combat means performing actions to heal/hurt other participants in the combat. Controlling whether or not a character/item will enter the turn-based mode of combats happens using the SetCanJoinCombat call.
- Disabling this for NPCs means that they will not perform any actions when it is their turn in combat. Note that this can easily wreak havoc due to interactions with other systems, such as the crime system.
- If CanFight is disabled for all enemies in combat, the combat will end immediately. Attacking a single, non-alied enemy whose CanFight is disabled may therefore start and immediately end a combat.
- If you disable this for a player during a scripted event, ensure it is re-enabled in all possible exits!