forceHitPointsDamageSync: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) No edit summary |
Killzone Kid (talk | contribs) No edit summary |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
|game1= arma3 | |game1= arma3 | ||
|version1=2. | |version1= 2.18 | ||
|arg= local | |arg= local | ||
Line 11: | Line 10: | ||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
|descr= | |descr= Synchronises hitpoints values and total damage across current network clients as well as JIP. | ||
Possible uses after executing script commands such as [[setHit]], [[setHitIndex]], [[setHitPointDamage]] or in conjunction with {{Link|Arma 3: Event Handlers#HandleDamage|HandleDamage}} event handler (see {{Link|#Example 2}}). | |||
|mp= Static buildings synchronisation should be executed on the [[isServer|server]] as the server is the authority in building damage and you would want every client in MP to have the same level of damage as the server has. | |||
|s1= [[forceHitPointsDamageSync]] entity | |s1= [[forceHitPointsDamageSync]] entity | ||
|p1= entity: [[Object]] - entity | |p1= entity: [[Object]] - entity | ||
|r1= [[Boolean]] - true if sync was attempted | |r1= [[Boolean]] - [[true]] if sync was attempted | ||
|x1= <sqf>forceHitPointsDamageSync house1;</sqf> | |x1= <sqf>forceHitPointsDamageSync house1;</sqf> | ||
|x2= <sqf>house1 addEventHandler ["HandleDamage", | |x2= <sqf> | ||
house1 addEventHandler ["HandleDamage", | |||
{ | { | ||
if (isServer && { _this select 9 == 2 }) then { (_this select 0) spawn { forceHitPointsDamageSync _this; } }; | |||
if (_this select 7 find "glass" >= 0) then { _this select 2 } else { 0 }; | |||
}];</sqf> | }]; | ||
</sqf> | |||
|seealso= [[getHit]] [[getHitPointDamage]] [[setHitPointDamage]] [[damage]] [[setDamage]] [[setFuel]] [[setAmmo]] [[getHitIndex]] [[setHitIndex]] | |seealso= [[getHit]] [[getHitPointDamage]] [[setHitPointDamage]] [[damage]] [[setDamage]] [[setFuel]] [[setAmmo]] [[getHitIndex]] [[setHitIndex]] | ||
}} | }} |
Latest revision as of 00:07, 10 November 2024
Description
- Description:
- Synchronises hitpoints values and total damage across current network clients as well as JIP. Possible uses after executing script commands such as setHit, setHitIndex, setHitPointDamage or in conjunction with HandleDamage event handler (see Example 2).
- Multiplayer:
- Static buildings synchronisation should be executed on the server as the server is the authority in building damage and you would want every client in MP to have the same level of damage as the server has.
- Groups:
- Object Manipulation
Syntax
- Syntax:
- forceHitPointsDamageSync entity
- Parameters:
- entity: Object - entity
- Return Value:
- Boolean - true if sync was attempted
Examples
- Example 1:
- forceHitPointsDamageSync house1;
- Example 2:
Additional Information
- See also:
- getHit getHitPointDamage setHitPointDamage damage setDamage setFuel setAmmo getHitIndex setHitIndex
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note