enforcescript-patterns

Enforce EnforceScript development patterns for the Enfusion engine.

91|40|Updated May 24, 2022
One-click install
npx skills add https://github.com/ArmaOverthrow/Overthrow.Arma4 --skill enforcescript-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: enforcescript-patterns
Source: https://github.com/ArmaOverthrow/Overthrow.Arma4/tree/main/.claude/skills/enforcescript-patterns
Command: npx skills add https://github.com/ArmaOverthrow/Overthrow.Arma4 --skill enforcescript-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

EnforceScript, the scripting language for the Enfusion engine (Arma Reforger), has unique syntax, memory management, and networking paradigms. This Skill provides essential patterns and highlights common pitfalls, enabling developers to write robust, performant, and bug-free code more efficiently.

Core Features & Use Cases

  • Component Architecture: Implement Managers, Controllers, and general Components with correct lifecycle handling.
  • Network Replication: Master RplProp, RPC, and JIP for seamless client-server synchronization.
  • Persistence with EPF: Learn to save and load game state using the Enfusion Persistence Framework, including console platform considerations.
  • Memory Management: Understand strong references, garbage collection, and safe entity handling to prevent crashes.
  • Use Case: You're developing a multiplayer feature for Arma Reforger that requires player inventory to be synchronized across the network and saved between game sessions. Use this Skill to implement RplProp for simple item counts, RPC for complex inventory transfers, JIP for late-joiners, and EPF for saving the inventory state, all while avoiding common EnforceScript pitfalls.

Quick Start

Explain the correct way to handle network replication for an array of custom data objects in EnforceScript, including both JIP and runtime updates.

Frequently Asked Questions about enforcescript-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I synchronize player inventory across the network in Arma Reforger using EnforceScript?

Network replication in EnforceScript uses RplProp for simple data, RPC for complex operations, and JIP to sync late-joiners. Combine these with server authority validation to ensure clients cannot manipulate inventory state directly, maintaining security and consistency across multiplayer sessions.

What are the correct memory management practices to avoid crashes in EnforceScript components?

EnforceScript requires strong references for entity handling and careful garbage collection. Distinguish EntityID from RplId, avoid holding stale references, and implement proper cleanup in component lifecycles to prevent memory leaks and runtime crashes in long-running game sessions.

How do I persist game state between sessions using the Enfusion Persistence Framework?

EPF saves and loads game state through serialization. Account for console platform constraints when designing persistence logic, validate data on load, and coordinate with your component architecture to restore state correctly without corrupting multiplayer synchronization.

What common EnforceScript pitfalls should I avoid when building multiplayer features?

Avoid ternary operators, maintain server authority, use RPC guards on the console, and ensure RplProp and RPC calls distinguish between client and server contexts. Improper networking patterns cause desyncs; follow component architecture (Manager, Controller, Component) to prevent structural failures.

How do I handle late-joiner synchronization for array-based custom data in EnforceScript?

JIP enables late-joiners to receive current state via replicated properties and RPC backfill. For custom object arrays, replicate the container with RplProp and use RPC to send individual updates, ensuring new players receive complete state without bandwidth overhead from full replication.