Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
71438fe393 | ||
![]() |
39d080fca5 | ||
![]() |
b5bd3c6cb8 | ||
![]() |
209b243620 | ||
![]() |
73086cfe97 | ||
![]() |
a106fef2fd | ||
![]() |
0858d9a173 | ||
![]() |
9f672e1795 | ||
![]() |
9936d6ddc3 | ||
![]() |
dfaddaa279 | ||
![]() |
2b5648b303 | ||
![]() |
3ba3fe82d2 | ||
![]() |
201371a411 | ||
![]() |
635460f9d8 | ||
![]() |
86ae5c4248 | ||
![]() |
be8e19a1a7 | ||
![]() |
58eb7bf841 | ||
![]() |
3ab612fad1 | ||
![]() |
d171b02d65 | ||
![]() |
4c9c2bd755 | ||
![]() |
0cbe027b3b | ||
![]() |
48c45731b7 | ||
![]() |
40eccaed69 | ||
![]() |
c822d4e601 |
@ -1,7 +1,7 @@
|
||||
# Forge Admin Module
|
||||
|
||||
## Overview
|
||||
The Admin module provides administrative functionality for the Forge client system. It includes features for user management, messaging, and administrative controls.
|
||||
The Admin module provides comprehensive administrative functionality for the Forge client system. It includes features for user management, financial operations, messaging, and administrative controls through both traditional and web-based interfaces.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
@ -18,9 +18,13 @@ The Admin module provides administrative functionality for the Forge client syst
|
||||
- Initializes the admin system
|
||||
- Sets up necessary permissions and configurations
|
||||
|
||||
2. **Admin Interface** (`fnc_openAdmin.sqf`)
|
||||
- Opens the administrative user interface
|
||||
- Provides access to administrative controls
|
||||
2. **Admin Interface**
|
||||
- **Traditional UI** (`fnc_openAdmin.sqf`)
|
||||
- Opens the administrative user interface
|
||||
- Provides access to administrative controls
|
||||
- **Web-based UI** (`RscWebAdmin.hpp`)
|
||||
- Modern web interface for administrative tasks
|
||||
- Real-time player statistics and management
|
||||
|
||||
3. **User Management**
|
||||
- **Promotion** (`fnc_adminPromote.sqf`)
|
||||
@ -30,16 +34,36 @@ The Admin module provides administrative functionality for the Forge client syst
|
||||
- **Refresh** (`fnc_adminRefresh.sqf`)
|
||||
- Updates administrative permissions and states
|
||||
|
||||
4. **Communication**
|
||||
4. **Financial Operations**
|
||||
- **Payday System**
|
||||
- Distributes funds based on player ranks
|
||||
- Configurable paygrade amounts
|
||||
- **Money Management**
|
||||
- Advance funds to players
|
||||
- Deduct funds from players
|
||||
- Global money distribution
|
||||
- Company account balance tracking
|
||||
|
||||
5. **Communication**
|
||||
- **Admin Messages** (`fnc_adminMessage.sqf`)
|
||||
- Handles administrative messaging system
|
||||
- **Broadcast System**
|
||||
- Send messages to all players
|
||||
- Targeted player messaging
|
||||
|
||||
### User Interface
|
||||
The module includes two main UI components:
|
||||
1. **RscCommon.hpp**
|
||||
- Common UI elements and definitions
|
||||
2. **RscAdmin.hpp**
|
||||
- Administrative interface specific elements
|
||||
### User Interface Components
|
||||
1. **Traditional UI** (`RscAdmin.hpp`)
|
||||
- Player list management
|
||||
- Rank selection and promotion
|
||||
- Financial operations
|
||||
- Messaging system
|
||||
|
||||
2. **Web Interface** (`ui/_site/`)
|
||||
- Modern, responsive design
|
||||
- Real-time statistics
|
||||
- Player management
|
||||
- Financial operations
|
||||
- Messaging system
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
@ -50,7 +74,9 @@ The module uses several event handlers for initialization and execution:
|
||||
## Usage
|
||||
To use the admin module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Access administrative functions through the provided UI
|
||||
2. Access administrative functions through either:
|
||||
- Traditional UI: Use the provided dialog interface
|
||||
- Web Interface: Access through the modern web-based panel
|
||||
3. Use appropriate administrative commands based on your role
|
||||
|
||||
## Debugging
|
||||
@ -61,3 +87,17 @@ Debug mode can be enabled by uncommenting the following in `script_component.hpp
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Security
|
||||
The module includes built-in security features:
|
||||
- Admin authentication
|
||||
- Permission-based access control
|
||||
- Secure financial transactions
|
||||
- Protected administrative functions
|
||||
|
||||
## Technical Details
|
||||
- Supports both traditional Arma 3 UI and modern web interface
|
||||
- Real-time data updates
|
||||
- Configurable paygrade system
|
||||
- Comprehensive player management
|
||||
- Secure financial operations
|
74
addons/ambient/README.md
Normal file
74
addons/ambient/README.md
Normal file
@ -0,0 +1,74 @@
|
||||
# Forge Ambient Module
|
||||
|
||||
## Overview
|
||||
The Ambient module provides environmental sound management for the Forge client system. It enables the creation and management of ambient sound effects in the game environment, enhancing the immersive experience for players.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
### Sound Management
|
||||
1. **Ambient Sound System** (`fnc_ambientSound.sqf`)
|
||||
- Creates and manages sound sources in the game world
|
||||
- Handles sound effect playback and cleanup
|
||||
- Supports timed and continuous sound effects
|
||||
|
||||
2. **Sound Source Features**
|
||||
- Dynamic sound source creation
|
||||
- Position-based sound placement
|
||||
- Automatic cleanup of sound sources
|
||||
- Support for various sound types and durations
|
||||
|
||||
3. **Sound Control**
|
||||
- Lifecycle management of sound sources
|
||||
- Automatic cleanup when source is destroyed
|
||||
- Configurable sound duration
|
||||
- Position tracking for moving sound sources
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
- `XEH_postInit_client.sqf`: Client-specific post-initialization
|
||||
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
|
||||
|
||||
## Usage
|
||||
To use the ambient module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Create sound sources using the ambient sound function:
|
||||
```sqf
|
||||
[source, "sfx_sound_name"] spawn forge_client_ambient_fnc_ambientSound
|
||||
```
|
||||
3. Optionally specify a duration for temporary sounds:
|
||||
```sqf
|
||||
[source, "sfx_sound_name", duration] spawn forge_client_ambient_fnc_ambientSound
|
||||
```
|
||||
|
||||
## Parameters
|
||||
The ambient sound function accepts the following parameters:
|
||||
1. `source`: The object or position where the sound will be played
|
||||
2. `sfx`: The name of the sound effect to play
|
||||
3. `time` (optional): Duration in seconds before the sound is removed
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Supports both object-attached and position-based sound sources
|
||||
- Automatic cleanup of sound sources when source is destroyed
|
||||
- Configurable sound duration for temporary effects
|
||||
- Efficient sound source management
|
||||
- Client-side sound processing
|
@ -1,7 +1,7 @@
|
||||
# Forge Arsenal Module
|
||||
|
||||
## Overview
|
||||
The Arsenal module provides a comprehensive weapon and vehicle management system for the Forge client. It includes features for managing armory items, vehicle garages, and unlock systems.
|
||||
The Arsenal module provides a comprehensive weapon and vehicle management system for the Forge client. It includes features for managing armory items, vehicle garages, and unlock systems, with support for both traditional and virtual arsenals.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
@ -17,27 +17,52 @@ The Arsenal module provides a comprehensive weapon and vehicle management system
|
||||
1. **Armory Initialization** (`fnc_initArsenal.sqf`)
|
||||
- Initializes the arsenal system
|
||||
- Sets up necessary configurations and permissions
|
||||
- Configures default armory and garage data
|
||||
- Supports both traditional and virtual arsenal types
|
||||
|
||||
2. **Armory Interface** (`fnc_openArmory.sqf`)
|
||||
- Opens the armory user interface
|
||||
- Provides access to weapon and equipment management
|
||||
- Supports both traditional and ACE arsenal interfaces
|
||||
|
||||
3. **Item Management**
|
||||
- **Add Armory Items** (`fnc_addArmoryItem.sqf`)
|
||||
- Handles adding new items to the armory
|
||||
- Supports multiple item types:
|
||||
- Facewear (goggles, masks)
|
||||
- Headgear (helmets, caps)
|
||||
- HMD (night vision devices)
|
||||
- Items (tools, medical supplies)
|
||||
- Uniforms
|
||||
- Vests
|
||||
- Weapons
|
||||
- Magazines
|
||||
- Backpacks
|
||||
- **Save Unlocks** (`fnc_saveUnlocks.sqf`)
|
||||
- Manages the persistence of unlocked items
|
||||
- Integrates with player database system
|
||||
- **Update Unlocks** (`fnc_updateUnlocks.sqf`)
|
||||
- Updates the unlock status of items
|
||||
- Maintains synchronization between client and server
|
||||
|
||||
### Vehicle Management
|
||||
1. **Garage System**
|
||||
- **Open Garage** (`fnc_openGarage.sqf`)
|
||||
- Provides access to the vehicle garage interface
|
||||
- Categorizes vehicles by type
|
||||
- **Add Garage Vehicle** (`fnc_addGarageVehicle.sqf`)
|
||||
- Handles adding new vehicles to the garage
|
||||
- Supports vehicle categories:
|
||||
- Cars
|
||||
- Armored vehicles
|
||||
- Helicopters
|
||||
- Planes
|
||||
- Naval vessels
|
||||
- Static weapons
|
||||
- **Add Virtual Vehicles** (`fnc_addVirtualVehicles.sqf`)
|
||||
- Manages virtual vehicle entries in the garage
|
||||
- Automatically categorizes vehicles by type
|
||||
- Maintains vehicle model information
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
@ -54,6 +79,27 @@ To use the arsenal module:
|
||||
3. Use the garage interface for vehicle management
|
||||
4. Manage unlocks and permissions through the appropriate functions
|
||||
|
||||
## Item Types
|
||||
The module supports various item categories:
|
||||
- Weapons (Primary, Secondary, Handgun)
|
||||
- Magazines
|
||||
- Items (Tools, Medical, etc.)
|
||||
- Uniforms
|
||||
- Vests
|
||||
- Backpacks
|
||||
- Facewear
|
||||
- Headgear
|
||||
- HMD (Night Vision)
|
||||
|
||||
## Vehicle Categories
|
||||
Vehicles are organized into the following categories:
|
||||
1. Cars (Light vehicles, transport)
|
||||
2. Armor (Tanks, APCs)
|
||||
3. Helicopters (All rotary-wing aircraft)
|
||||
4. Planes (Fixed-wing aircraft)
|
||||
5. Naval (Boats, ships)
|
||||
6. Static (Weapons, emplacements)
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
@ -62,3 +108,12 @@ Debug mode can be enabled by uncommenting the following in `script_component.hpp
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Supports both traditional Arma 3 arsenal and ACE arsenal systems
|
||||
- Automatic vehicle categorization based on class inheritance
|
||||
- Persistent unlock system with database integration
|
||||
- Efficient item and vehicle management
|
||||
- Client-server synchronization for unlocks
|
||||
- Integration with the locker system for item storage
|
||||
- Support for virtual and physical vehicle spawning
|
@ -1,7 +1,7 @@
|
||||
# Forge Bank Module
|
||||
|
||||
## Overview
|
||||
The Bank module provides a comprehensive banking system for the Forge client. It includes features for managing player finances, transfers, and timesheet functionality.
|
||||
The Bank module provides a comprehensive banking system for the Forge client. It includes features for managing player finances, transfers, and timesheet functionality, with a modern web-based interface for seamless user experience.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
@ -17,39 +17,70 @@ The Bank module provides a comprehensive banking system for the Forge client. It
|
||||
1. **Bank Initialization** (`fnc_initBank.sqf`)
|
||||
- Initializes the banking system
|
||||
- Sets up necessary configurations and account structures
|
||||
- Configures player account data and balances
|
||||
- Handles server-side synchronization
|
||||
|
||||
2. **Bank Interface** (`fnc_openBank.sqf`)
|
||||
- Opens the banking user interface
|
||||
- Provides access to all banking functions
|
||||
- Modern web-based UI with real-time updates
|
||||
- Responsive design for optimal user experience
|
||||
|
||||
3. **Transaction Management**
|
||||
- **Deposit** (`fnc_deposit.sqf`)
|
||||
- Handles money deposits into bank accounts
|
||||
- Validates transaction amounts
|
||||
- Updates account balances in real-time
|
||||
- **Withdraw** (`fnc_withdraw.sqf`)
|
||||
- Manages money withdrawals from bank accounts
|
||||
- Ensures sufficient funds
|
||||
- Updates wallet balance immediately
|
||||
- **Transfer** (`fnc_transfer.sqf`)
|
||||
- Handles money transfers between players
|
||||
- Validates recipient and amount
|
||||
- Supports both account-to-account and wallet transfers
|
||||
- **Submit** (`fnc_submit.sqf`)
|
||||
- Processes transaction submissions
|
||||
- Handles timesheet submissions
|
||||
- Manages pending payments
|
||||
- **Refresh** (`fnc_refresh.sqf`)
|
||||
- Updates account information and balances
|
||||
- Synchronizes with server data
|
||||
- Updates UI elements
|
||||
|
||||
### User Interface
|
||||
The module includes several UI components:
|
||||
1. **Base Controls** (`BaseControls.hpp`)
|
||||
- Common UI elements and definitions
|
||||
2. **Bank Dialog** (`RscBankDialog.hpp`)
|
||||
- Banking interface specific elements
|
||||
The module includes a modern web-based interface with:
|
||||
1. **Account Overview**
|
||||
- Current wallet balance
|
||||
- Bank account balance
|
||||
- Pending payments
|
||||
- Transaction history
|
||||
|
||||
### Interface Elements
|
||||
The module defines several UI control IDs:
|
||||
- Account Information Display
|
||||
- Amount Input Fields
|
||||
- Player Selection
|
||||
- Transaction Buttons (Deposit, Withdraw, Transfer)
|
||||
- Wallet and Bank Balance Displays
|
||||
- Rating System
|
||||
- Timesheet Integration
|
||||
2. **Transaction Features**
|
||||
- Transfer between wallet and account
|
||||
- Player-to-player transfers
|
||||
- Timesheet submission
|
||||
- Transaction history view
|
||||
|
||||
3. **UI Components**
|
||||
- Real-time balance updates
|
||||
- Transaction notifications
|
||||
- Input validation
|
||||
- Error handling
|
||||
- Responsive design
|
||||
|
||||
### Timesheet System
|
||||
1. **Rating Integration**
|
||||
- Tracks player rating
|
||||
- Calculates pending payments
|
||||
- Automatic payment processing
|
||||
- Rating reset after submission
|
||||
|
||||
2. **Payment Processing**
|
||||
- Automatic calculation based on rating
|
||||
- Configurable payment multiplier
|
||||
- Pending payment tracking
|
||||
- Instant payment processing
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
@ -63,8 +94,12 @@ The module uses several event handlers for initialization and execution:
|
||||
To use the bank module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Access the bank through the provided UI
|
||||
3. Perform transactions using the appropriate functions
|
||||
4. Monitor account status and transactions
|
||||
3. Perform transactions using the appropriate functions:
|
||||
- Transfer money between wallet and account
|
||||
- Send money to other players
|
||||
- Submit timesheets for payment
|
||||
- View transaction history
|
||||
4. Monitor account status and transactions in real-time
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
@ -74,3 +109,15 @@ Debug mode can be enabled by uncommenting the following in `script_component.hpp
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Web-based interface using HTML5, CSS3, and JavaScript
|
||||
- Real-time data synchronization with server
|
||||
- Secure transaction processing
|
||||
- Client-server event system
|
||||
- Persistent data storage
|
||||
- Rating-based payment system
|
||||
- Transaction history tracking
|
||||
- Input validation and error handling
|
||||
- Responsive UI design
|
||||
- Cross-browser compatibility
|
114
addons/briefing/README.md
Normal file
114
addons/briefing/README.md
Normal file
@ -0,0 +1,114 @@
|
||||
# Forge Briefing Module
|
||||
|
||||
## Overview
|
||||
The Briefing module provides a comprehensive presentation and lecture system for the Forge client. It includes features for creating interactive slideshows, managing presentations, and delivering lectures with synchronized audio and visual elements.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
### Presentation System
|
||||
1. **Slide Show Management** (`fnc_initSlideShow.sqf`)
|
||||
- Initializes interactive slide shows
|
||||
- Configures display screens and controllers
|
||||
- Sets up image sequences and timing
|
||||
- Manages presentation flow and transitions
|
||||
|
||||
2. **Presentation Controls**
|
||||
- **Start Slide Show** (`fnc_startSlideShow.sqf`)
|
||||
- Initiates the presentation sequence
|
||||
- Synchronizes audio and visual elements
|
||||
- Manages presentation state
|
||||
- **Next Image** (`fnc_nextImage.sqf`)
|
||||
- Advances to the next slide
|
||||
- Updates display screens
|
||||
- Maintains presentation state
|
||||
- **Previous Image** (`fnc_prevImage.sqf`)
|
||||
- Returns to the previous slide
|
||||
- Updates display screens
|
||||
- Maintains presentation state
|
||||
- **End Slide Show** (`fnc_endSlideShow.sqf`)
|
||||
- Terminates the presentation
|
||||
- Cleans up resources
|
||||
- Resets presentation state
|
||||
|
||||
3. **Lecture System**
|
||||
- **Spawn Lecture** (`fnc_spawnLecture.sqf`)
|
||||
- Initiates AI-driven lectures
|
||||
- Manages speaker animations
|
||||
- Controls presentation timing
|
||||
- **Spawn Presentation** (`fnc_spawnPresentation.sqf`)
|
||||
- Creates automated presentations
|
||||
- Manages slide timing
|
||||
- Controls visual transitions
|
||||
|
||||
### Presentation Features
|
||||
1. **Interactive Controls**
|
||||
- Manual slide navigation
|
||||
- Auto-scroll capability
|
||||
- Presentation state management
|
||||
- Speaker control integration
|
||||
|
||||
2. **Visual Elements**
|
||||
- Multiple display screen support
|
||||
- Synchronized image transitions
|
||||
- Customizable timing
|
||||
- Power-of-2 image optimization
|
||||
|
||||
3. **Audio Integration**
|
||||
- Speaker synchronization
|
||||
- Topic-based conversations
|
||||
- Sentence-specific playback
|
||||
- Multi-speaker support
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
- `XEH_postInit_client.sqf`: Client-specific post-initialization
|
||||
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
|
||||
|
||||
## Usage
|
||||
To use the briefing module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Set up presentation screens and controllers
|
||||
3. Configure slide shows or lectures:
|
||||
```sqf
|
||||
// Initialize a slide show
|
||||
[Screen01, [Controller01], ["images/folder/image.paa"]] call forge_client_briefing_fnc_initSlideShow;
|
||||
|
||||
// Start a lecture
|
||||
[player, "topic", "sentence"] call forge_client_briefing_fnc_spawnLecture;
|
||||
|
||||
// Create a presentation
|
||||
[screen, [["texture.paa", 5]]] call forge_client_briefing_fnc_spawnPresentation;
|
||||
```
|
||||
4. Control the presentation using the provided functions
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Support for multiple display screens
|
||||
- Synchronized audio-visual presentations
|
||||
- Interactive control system
|
||||
- AI-driven lecture capabilities
|
||||
- Power-of-2 image optimization
|
||||
- State management for presentations
|
||||
- Multi-speaker support
|
||||
- Customizable timing controls
|
||||
- Resource cleanup on completion
|
||||
- Error handling and validation
|
1
addons/common/$PBOPREFIX$
Normal file
1
addons/common/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\forge_client\addons\common
|
19
addons/common/CfgEventHandlers.hpp
Normal file
19
addons/common/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
class Extended_PreStart_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preStart));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
serverInit = QUOTE(call COMPILE_FILE(XEH_preInit_server));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
clientInit = QUOTE(call COMPILE_FILE(XEH_postInit_client));
|
||||
};
|
||||
};
|
3
addons/common/XEH_PREP.hpp
Normal file
3
addons/common/XEH_PREP.hpp
Normal file
@ -0,0 +1,3 @@
|
||||
PREP(actorStateGet);
|
||||
PREP(actorStateSet);
|
||||
PREP(getPlayer);
|
1
addons/common/XEH_postInit.sqf
Normal file
1
addons/common/XEH_postInit.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
1
addons/common/XEH_postInit_client.sqf
Normal file
1
addons/common/XEH_postInit_client.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
8
addons/common/XEH_preInit.sqf
Normal file
8
addons/common/XEH_preInit.sqf
Normal file
@ -0,0 +1,8 @@
|
||||
#include "script_component.hpp"
|
||||
ADDON = false;
|
||||
|
||||
PREP_RECOMPILE_START;
|
||||
#include "XEH_PREP.hpp"
|
||||
PREP_RECOMPILE_END;
|
||||
|
||||
ADDON = true;
|
1
addons/common/XEH_preInit_server.sqf
Normal file
1
addons/common/XEH_preInit_server.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
2
addons/common/XEH_preStart.sqf
Normal file
2
addons/common/XEH_preStart.sqf
Normal file
@ -0,0 +1,2 @@
|
||||
#include "script_component.hpp"
|
||||
#include "XEH_PREP.hpp"
|
16
addons/common/config.cpp
Normal file
16
addons/common/config.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"forge_client_main"};
|
||||
authors[] = {"J. Schmidt", "Creedcoder"};
|
||||
author = "IDSolutions";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
43
addons/common/functions/fnc_actorStateGet.sqf
Normal file
43
addons/common/functions/fnc_actorStateGet.sqf
Normal file
@ -0,0 +1,43 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Gets the current state of a player
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Player State <HASHMAP>
|
||||
*
|
||||
* Example:
|
||||
* _state = [player] call forge_client_common_fnc_actorStateGet
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params [["_player", objNull, [objNull]]];
|
||||
|
||||
private _loadout = getUnitLoadout _player;
|
||||
private _pos = getPosASL _player;
|
||||
private _dir = getDir _player;
|
||||
private _stance = stance _player;
|
||||
private _phone = GETVAR(_player,FORGE_Phone,QUOTE(000-000-0000));
|
||||
private _email = GETVAR(_player,FORGE_Email,QUOTE(player@example.com));
|
||||
private _bank = GETVAR(_player,FORGE_Bank,0);
|
||||
private _cash = GETVAR(_player,FORGE_Cash,0);
|
||||
private _state = lifeState _player;
|
||||
|
||||
private _hash = createHashMap;
|
||||
|
||||
_hash set ["loadout", _loadout];
|
||||
_hash set ["position", _pos];
|
||||
_hash set ["direction", _dir];
|
||||
_hash set ["stance", _stance];
|
||||
_hash set ["phone", _phone];
|
||||
_hash set ["email", _email];
|
||||
_hash set ["bank", _bank];
|
||||
_hash set ["cash", _cash];
|
||||
_hash set ["state", _state];
|
||||
|
||||
_hash
|
65
addons/common/functions/fnc_actorStateSet.sqf
Normal file
65
addons/common/functions/fnc_actorStateSet.sqf
Normal file
@ -0,0 +1,65 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Sets the state of a player
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player <OBJECT>
|
||||
* 1: Data <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Unit State <HASHMAP>
|
||||
*
|
||||
* Example:
|
||||
* [player, _data] call forge_client_common_fnc_actorStateSet
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params [["_player", objNull, [objNull]], ["_data", "", [""]]];
|
||||
private _hash = createHashMap;
|
||||
|
||||
if (isNull _player || _data isEqualTo "") exitWith {
|
||||
diag_log text format ["[FORGE:Player:Actor] Invalid player or data: %1", _player];
|
||||
};
|
||||
|
||||
(parseSimpleArray _data) params ["_uid", "_loadout", "_pos", "_dir", "_stance", "_email", "_phone", "_bank", "_cash", "_state"];
|
||||
|
||||
_player setUnitLoadout _loadout;
|
||||
|
||||
if !(isNil "_pos") then {
|
||||
_player setPosASL _pos;
|
||||
|
||||
private _pAlt = ((getPosATLVisual player) select 2);
|
||||
private _pVelZ = ((velocity player) select 2);
|
||||
if (_pAlt > 5 && _pVelZ < 0) then {
|
||||
player setVelocity [0, 0, 0];
|
||||
player setPosATL [((getPosATLVisual player) select 0), ((getPosATLVisual player) select 1), 1];
|
||||
hint "You logged off mid air. You were moved to a safe position on the ground.";
|
||||
};
|
||||
};
|
||||
|
||||
if !(isNil "_dir") then {
|
||||
_player setDir _dir;
|
||||
};
|
||||
|
||||
_player playAction _stance;
|
||||
SETPVAR(_player,FORGE_Phone,_phone);
|
||||
SETPVAR(_player,FORGE_Email,_email);
|
||||
SETPVAR(_player,FORGE_Bank,_bank);
|
||||
SETPVAR(_player,FORGE_Cash,_cash);
|
||||
SETPVAR(_player,FORGE_State,_state);
|
||||
|
||||
_hash set ["uid", _uid];
|
||||
_hash set ["loadout", _loadout];
|
||||
_hash set ["position", _pos];
|
||||
_hash set ["direction", _dir];
|
||||
_hash set ["stance", _stance];
|
||||
_hash set ["phone", _phone];
|
||||
_hash set ["email", _email];
|
||||
_hash set ["bank", _bank];
|
||||
_hash set ["cash", _cash];
|
||||
_hash set ["state", _state];
|
||||
|
||||
_hash
|
27
addons/common/functions/fnc_getPlayer.sqf
Normal file
27
addons/common/functions/fnc_getPlayer.sqf
Normal file
@ -0,0 +1,27 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Gets a player object by UID.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player UID <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Player object or objNull if not found <OBJECT>
|
||||
*
|
||||
* Example:
|
||||
* ["76561198012345678"] call forge_client_common_fnc_getPlayer
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_uid"];
|
||||
|
||||
private _player = objNull;
|
||||
|
||||
{
|
||||
if ((getPlayerUID _x) isEqualTo _uid) exitWith { _player = _x; };
|
||||
} forEach allPlayers;
|
||||
|
||||
_player
|
0
addons/common/functions/fnc_vehicleStateGet.sqf
Normal file
0
addons/common/functions/fnc_vehicleStateGet.sqf
Normal file
0
addons/common/functions/fnc_vehicleStateSet.sqf
Normal file
0
addons/common/functions/fnc_vehicleStateSet.sqf
Normal file
16
addons/common/script_component.hpp
Normal file
16
addons/common/script_component.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
#define COMPONENT common
|
||||
#define COMPONENT_BEAUTIFIED Common
|
||||
#include "\z\forge_client\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
|
||||
#ifdef DEBUG_ENABLED_COMMON
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_COMMON
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_COMMON
|
||||
#endif
|
||||
|
||||
#include "\z\forge_client\addons\main\script_macros.hpp"
|
125
addons/db/README.md
Normal file
125
addons/db/README.md
Normal file
@ -0,0 +1,125 @@
|
||||
# Forge Database Module
|
||||
|
||||
## Overview
|
||||
The Database module provides a comprehensive data persistence system for the Forge client. It includes features for managing player data, organization information, and game state persistence using the ArmaDragonflyClient database system.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
- ArmaDragonflyClient
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
### Database System
|
||||
1. **Server Communication** (`fnc_requestServerDB.sqf`)
|
||||
- Handles client-server database communication
|
||||
- Manages asynchronous database operations
|
||||
- Provides callback support for data retrieval
|
||||
- Ensures data consistency across clients
|
||||
|
||||
2. **Data Management**
|
||||
- **Player Data**
|
||||
- Armory unlocks
|
||||
- Garage unlocks
|
||||
- Locker contents
|
||||
- Vehicle inventory
|
||||
- Financial information
|
||||
- Contact details
|
||||
- Organization membership
|
||||
- Player statistics
|
||||
- Equipment loadouts
|
||||
- Position and state
|
||||
|
||||
- **Organization Data**
|
||||
- Member information
|
||||
- Asset tracking
|
||||
- Financial records
|
||||
- Reputation system
|
||||
- Activity logs
|
||||
- Creation timestamps
|
||||
- Modification history
|
||||
|
||||
3. **Persistence Features**
|
||||
- Automatic data saving
|
||||
- Periodic state synchronization
|
||||
- Data validation and sanitization
|
||||
- Error recovery mechanisms
|
||||
- Transaction logging
|
||||
- Data versioning
|
||||
|
||||
### Data Operations
|
||||
1. **Storage Operations**
|
||||
- Hash-based storage (HSET)
|
||||
- Bulk data operations
|
||||
- Atomic transactions
|
||||
- Data serialization
|
||||
- String normalization
|
||||
|
||||
2. **Retrieval Operations**
|
||||
- Hash-based retrieval (HGET)
|
||||
- Bulk data loading
|
||||
- Data deserialization
|
||||
- Error handling
|
||||
- Default value management
|
||||
|
||||
3. **Synchronization**
|
||||
- Client-server sync
|
||||
- Real-time updates
|
||||
- Conflict resolution
|
||||
- State verification
|
||||
- Data integrity checks
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
- `XEH_postInit_client.sqf`: Client-specific post-initialization
|
||||
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
|
||||
|
||||
## Usage
|
||||
To use the database module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Initialize database connections
|
||||
3. Perform database operations:
|
||||
```sqf
|
||||
// Request data from server
|
||||
["hgetall", "Hello World!", {
|
||||
systemChat format ["Message: %1", _this];
|
||||
}] call forge_db_fnc_requestServerDB;
|
||||
|
||||
// Save player data
|
||||
[] call forge_client_init_fnc_playerDBSave;
|
||||
|
||||
// Load player data
|
||||
[] call forge_client_init_fnc_playerDBLoad;
|
||||
```
|
||||
4. Handle database callbacks and responses
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Asynchronous database operations
|
||||
- Callback-based response handling
|
||||
- Data serialization and normalization
|
||||
- Error handling and recovery
|
||||
- Transaction logging
|
||||
- State management
|
||||
- Data validation
|
||||
- Conflict resolution
|
||||
- Real-time synchronization
|
||||
- Bulk operation support
|
||||
- Atomic transactions
|
||||
- Data versioning
|
||||
- Integrity verification
|
90
addons/dialogue/README.md
Normal file
90
addons/dialogue/README.md
Normal file
@ -0,0 +1,90 @@
|
||||
# Forge Dialogue Module
|
||||
|
||||
## Overview
|
||||
The Dialogue module provides a comprehensive AI conversation system for the Forge client. It enables dynamic interactions between players and AI units, supporting topic-based conversations, sentence management, and AI behavior control.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
### AI Dialogue System
|
||||
1. **AI Selection** (`fnc_selectAI.sqf`)
|
||||
- Manages AI unit selection for dialogue
|
||||
- Controls AI behavior during conversations
|
||||
- Handles unit state management
|
||||
- Disables AI actions during dialogue
|
||||
|
||||
2. **Dialogue Management** (`fnc_selectDialogue.sqf`)
|
||||
- Topic-based conversation system
|
||||
- Sentence management and playback
|
||||
- AI unit synchronization
|
||||
- Conversation flow control
|
||||
|
||||
3. **Conversation Features**
|
||||
- **Topic Management**
|
||||
- Dynamic topic selection
|
||||
- Context-aware conversations
|
||||
- Topic-based responses
|
||||
- Conversation branching
|
||||
|
||||
- **Sentence Control**
|
||||
- Sentence playback
|
||||
- Timing management
|
||||
- Response coordination
|
||||
- Conversation state tracking
|
||||
|
||||
- **AI Behavior**
|
||||
- Animation control
|
||||
- Movement management
|
||||
- State synchronization
|
||||
- Interaction handling
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
- `XEH_postInit_client.sqf`: Client-specific post-initialization
|
||||
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
|
||||
|
||||
## Usage
|
||||
To use the dialogue module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Select AI units for dialogue:
|
||||
```sqf
|
||||
// Select AI units for dialogue
|
||||
[units group player] call forge_client_dialogue_fnc_selectAI;
|
||||
|
||||
// Select specific dialogue for AI
|
||||
[units, [["topic", "sentence"]]] call forge_client_dialogue_fnc_selectDialogue;
|
||||
```
|
||||
3. Manage conversation flow and AI behavior
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Topic-based conversation system
|
||||
- AI behavior control
|
||||
- Sentence management
|
||||
- State synchronization
|
||||
- Animation handling
|
||||
- Movement control
|
||||
- Interaction management
|
||||
- Conversation flow control
|
||||
- Response coordination
|
||||
- Error handling
|
||||
- Debug support
|
||||
- Event system integration
|
@ -1,7 +1,7 @@
|
||||
# Forge Garage Module
|
||||
|
||||
## Overview
|
||||
The Garage module provides a comprehensive vehicle management system for the Forge client. It includes features for storing, spawning, and managing vehicles in a garage environment.
|
||||
The Garage module provides a comprehensive vehicle management system for the Forge client. It includes features for storing, spawning, and managing vehicles in a garage environment, with support for various vehicle types and states.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
@ -16,21 +16,72 @@ The Garage module provides a comprehensive vehicle management system for the For
|
||||
### Garage System
|
||||
1. **Garage Initialization** (`fnc_initGarage.sqf`)
|
||||
- Initializes the garage system
|
||||
- Sets up necessary configurations and vehicle storage
|
||||
- Sets up vehicle storage and management
|
||||
- Configures garage locations and spawn points
|
||||
- Manages vehicle state persistence
|
||||
|
||||
2. **Garage Interface** (`fnc_openGarage.sqf`)
|
||||
- Opens the garage user interface
|
||||
- Provides access to vehicle management functions
|
||||
|
||||
3. **Vehicle Management**
|
||||
2. **Vehicle Management**
|
||||
- **Spawn Vehicle** (`fnc_spawnVehicle.sqf`)
|
||||
- Handles vehicle spawning from garage
|
||||
- Manages spawn locations and orientations
|
||||
- Preserves vehicle type information
|
||||
- Updates garage inventory
|
||||
|
||||
- **Store Vehicle** (`fnc_storeVehicle.sqf`)
|
||||
- Manages vehicle storage in garage
|
||||
- Handles vehicle cleanup
|
||||
- Updates garage inventory
|
||||
- Preserves vehicle data
|
||||
|
||||
- **Fetch Garage** (`fnc_fetchGarage.sqf`)
|
||||
- Retrieves garage vehicle information
|
||||
- Updates garage interface
|
||||
- Manages vehicle listings
|
||||
- Handles vehicle categorization
|
||||
|
||||
- **Fetch Nearby** (`fnc_fetchNearby.sqf`)
|
||||
- Locates and manages nearby vehicles
|
||||
- Validates vehicle ownership
|
||||
- Handles vehicle state checks
|
||||
- Updates interface with nearby vehicles
|
||||
|
||||
3. **Vehicle Categories**
|
||||
- Cars (Light vehicles, transport)
|
||||
- Armor (Tanks, APCs)
|
||||
- Helicopters (All rotary-wing aircraft)
|
||||
- Planes (Fixed-wing aircraft)
|
||||
- Naval (Boats, ships)
|
||||
- Static (Weapons, emplacements)
|
||||
|
||||
4. **Vehicle States**
|
||||
- Available
|
||||
- In Use
|
||||
- Maintenance
|
||||
- Damaged
|
||||
- Fuel Status
|
||||
- Condition Tracking
|
||||
|
||||
### User Interface
|
||||
1. **Garage Dialog**
|
||||
- Vehicle listing and management
|
||||
- Category filtering
|
||||
- Status indicators
|
||||
- Action buttons (Spawn/Store)
|
||||
- Vehicle details display
|
||||
|
||||
2. **Vehicle Information**
|
||||
- Vehicle name and type
|
||||
- Status indicators
|
||||
- Fuel level
|
||||
- Damage state
|
||||
- Maintenance status
|
||||
- Last used timestamp
|
||||
|
||||
3. **Controls**
|
||||
- Category filters
|
||||
- Vehicle actions
|
||||
- Status management
|
||||
- Quick access buttons
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
@ -44,7 +95,17 @@ The module uses several event handlers for initialization and execution:
|
||||
To use the garage module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Access the garage through the provided UI
|
||||
3. Manage vehicles using the appropriate functions
|
||||
3. Manage vehicles using the appropriate functions:
|
||||
```sqf
|
||||
// Open garage interface
|
||||
[] call forge_client_garage_fnc_openGarage;
|
||||
|
||||
// Store a vehicle
|
||||
[] call forge_client_garage_fnc_storeVehicle;
|
||||
|
||||
// Spawn a vehicle
|
||||
[] call forge_client_garage_fnc_spawnVehicle;
|
||||
```
|
||||
4. Monitor vehicle status and location
|
||||
|
||||
## Debugging
|
||||
@ -55,3 +116,17 @@ Debug mode can be enabled by uncommenting the following in `script_component.hpp
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Vehicle state persistence
|
||||
- Category-based organization
|
||||
- Status tracking system
|
||||
- Location management
|
||||
- Spawn point configuration
|
||||
- Vehicle cleanup handling
|
||||
- Interface synchronization
|
||||
- Event system integration
|
||||
- Error handling
|
||||
- Debug support
|
||||
- Data validation
|
||||
- State management
|
118
addons/init/README.md
Normal file
118
addons/init/README.md
Normal file
@ -0,0 +1,118 @@
|
||||
# Forge Initialization Module
|
||||
|
||||
## Overview
|
||||
The Initialization module provides a comprehensive player initialization and data persistence system for the Forge client. It handles player data loading, saving, and synchronization with the database, ensuring a seamless experience across sessions.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
- ArmaDragonflyClient
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
### Player Initialization
|
||||
1. **Player Setup** (`fnc_initPlayer.sqf`)
|
||||
- Initializes player state
|
||||
- Clears default equipment
|
||||
- Sets up player variables
|
||||
- Configures initial loadout
|
||||
- Manages loading screen
|
||||
|
||||
2. **Data Management**
|
||||
- **Player Load** (`fnc_playerDBLoad.sqf`)
|
||||
- Loads player data from database
|
||||
- Handles first-time login
|
||||
- Restores player state
|
||||
- Manages data synchronization
|
||||
|
||||
- **Player Save** (`fnc_playerDBSave.sqf`)
|
||||
- Saves player data to database
|
||||
- Manages data persistence
|
||||
- Handles state synchronization
|
||||
- Preserves player information
|
||||
|
||||
- **Save Loop** (`fnc_playerSaveLoop.sqf`)
|
||||
- Periodic data saving
|
||||
- Configurable save intervals
|
||||
- Automatic state persistence
|
||||
- Error handling
|
||||
|
||||
3. **Data Handling** (`fnc_handlePlayerLoad.sqf`)
|
||||
- Processes loaded data
|
||||
- Restores player state
|
||||
- Manages default values
|
||||
- Handles data validation
|
||||
|
||||
### Persisted Data
|
||||
1. **Player Information**
|
||||
- Armory unlocks
|
||||
- Garage unlocks
|
||||
- Locker contents
|
||||
- Vehicle inventory
|
||||
- Financial data (cash/bank)
|
||||
- Contact details
|
||||
- Organization membership
|
||||
- Player statistics
|
||||
- Equipment loadouts
|
||||
- Position and state
|
||||
|
||||
2. **State Management**
|
||||
- Player position
|
||||
- Player direction
|
||||
- Weapon state
|
||||
- Stance information
|
||||
- Rating/reputation
|
||||
- Paygrade
|
||||
- Organization status
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
- `XEH_postInit_client.sqf`: Client-specific post-initialization
|
||||
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
|
||||
|
||||
## Usage
|
||||
To use the initialization module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. The module automatically handles player initialization
|
||||
3. Access player data using the appropriate functions:
|
||||
```sqf
|
||||
// Initialize player
|
||||
[] call forge_client_init_fnc_initPlayer;
|
||||
|
||||
// Load player data
|
||||
[] call forge_client_init_fnc_playerDBLoad;
|
||||
|
||||
// Save player data
|
||||
[] call forge_client_init_fnc_playerDBSave;
|
||||
```
|
||||
4. Monitor player state and data persistence
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Automatic player initialization
|
||||
- Database integration
|
||||
- Periodic data saving
|
||||
- State persistence
|
||||
- Error handling
|
||||
- Data validation
|
||||
- First-time login handling
|
||||
- Default value management
|
||||
- Position tracking
|
||||
- Equipment management
|
||||
- Financial synchronization
|
||||
- Organization integration
|
@ -1,4 +1,124 @@
|
||||
forge_interaction
|
||||
===============
|
||||
# Forge Interaction Module
|
||||
|
||||
Core interaction addon that handles all player interactions with the game world. This system manages how players engage with objects, NPCs, items and other interactive elements in the environment.
|
||||
## Overview
|
||||
The Interaction module provides a comprehensive player interaction system for the Forge client. It manages how players engage with objects, NPCs, items, and other interactive elements in the environment through a dynamic and context-sensitive interface.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
### Interaction System
|
||||
1. **Interaction Initialization** (`fnc_initInteraction.sqf`)
|
||||
- Initializes the interaction system
|
||||
- Sets up interaction buttons and items
|
||||
- Configures team coordination settings
|
||||
- Manages virtual arsenal integration
|
||||
|
||||
2. **Interaction Interface**
|
||||
- **Open Interaction** (`fnc_openInteraction.sqf`)
|
||||
- Opens the interaction menu
|
||||
- Displays available actions
|
||||
- Manages button visibility
|
||||
- Handles action execution
|
||||
|
||||
- **Interaction Action** (`fnc_interactionAction.sqf`)
|
||||
- Processes selected actions
|
||||
- Executes interaction commands
|
||||
- Manages action feedback
|
||||
- Handles interface updates
|
||||
|
||||
3. **Available Interactions**
|
||||
- **Player Interactions**
|
||||
- Give Cash
|
||||
- Add Contact
|
||||
- Access ATM
|
||||
- Access CPOF (Company Point of Finance)
|
||||
- Take Cash
|
||||
- Open Locker
|
||||
- Access Store
|
||||
- Open Garage
|
||||
- Virtual Armory (if enabled)
|
||||
- Virtual Garage (if enabled)
|
||||
|
||||
4. **Team Coordination**
|
||||
- Company garage access
|
||||
- Team-specific interactions
|
||||
- Permission-based actions
|
||||
- Organization integration
|
||||
|
||||
### User Interface
|
||||
1. **Interaction Menu**
|
||||
- Dynamic button display
|
||||
- Context-sensitive actions
|
||||
- Distance-based availability
|
||||
- Permission-based options
|
||||
|
||||
2. **Control Elements**
|
||||
- Action buttons
|
||||
- Status indicators
|
||||
- Feedback messages
|
||||
- Error handling
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
- `XEH_postInit_client.sqf`: Client-specific post-initialization
|
||||
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
|
||||
|
||||
## Usage
|
||||
To use the interaction module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Access interactions using the configured key (default: TAB)
|
||||
3. Interact with objects and players:
|
||||
```sqf
|
||||
// Open interaction menu
|
||||
[] call forge_client_interaction_fnc_openInteraction;
|
||||
|
||||
// Initialize interaction system
|
||||
[] call forge_client_interaction_fnc_initInteraction;
|
||||
```
|
||||
4. Monitor interaction feedback and results
|
||||
|
||||
## Configuration
|
||||
The module can be configured through the main Forge client configuration:
|
||||
```cpp
|
||||
// Interaction key (default: TAB)
|
||||
interactionKey = 15;
|
||||
|
||||
// Team coordination mode
|
||||
FORGE_Team_Coord = 1;
|
||||
|
||||
// Virtual arsenal enable
|
||||
FORGE_VA_Enable = 1;
|
||||
```
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Dynamic interaction system
|
||||
- Context-sensitive actions
|
||||
- Distance-based availability
|
||||
- Permission management
|
||||
- Team coordination
|
||||
- Virtual arsenal integration
|
||||
- Error handling
|
||||
- User feedback
|
||||
- Interface management
|
||||
- Action validation
|
||||
- State tracking
|
||||
- Event system integration
|
@ -1,7 +1,7 @@
|
||||
# Forge Locker Module
|
||||
|
||||
## Overview
|
||||
The Locker module provides a comprehensive equipment management system for the Forge client. It includes features for storing, equipping, and managing player gear in a secure locker system.
|
||||
The Locker module provides a comprehensive equipment management system for the Forge client. It includes features for storing, equipping, and managing player gear in a secure locker system with a modern web-based interface.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
@ -16,21 +16,76 @@ The Locker module provides a comprehensive equipment management system for the F
|
||||
### Locker System
|
||||
1. **Locker Initialization** (`fnc_initLocker.sqf`)
|
||||
- Initializes the locker system
|
||||
- Sets up necessary configurations and storage structures
|
||||
- Sets up storage structures
|
||||
- Configures player variables
|
||||
- Manages equipment tracking
|
||||
|
||||
2. **Locker Interface** (`fnc_openLocker.sqf`)
|
||||
- Opens the locker user interface
|
||||
- Provides access to equipment management functions
|
||||
|
||||
3. **Equipment Management**
|
||||
2. **Equipment Management**
|
||||
- **Store Gear** (`fnc_storeGear.sqf`)
|
||||
- Handles equipment storage in locker
|
||||
- Stores equipment in locker
|
||||
- Handles different item types:
|
||||
- Backpacks (with contents)
|
||||
- Facewear (goggles)
|
||||
- Headgear
|
||||
- HMD (Head Mounted Display)
|
||||
- Uniforms
|
||||
- Vests
|
||||
- Weapons (with attachments)
|
||||
- Items
|
||||
- Magazines (with ammo count)
|
||||
- Manages storage space
|
||||
- Preserves item condition
|
||||
|
||||
- **Equip Gear** (`fnc_equipGear.sqf`)
|
||||
- Manages equipment equipping from locker
|
||||
- Equips items from locker
|
||||
- Handles equipment compatibility
|
||||
- Manages inventory space
|
||||
- Preserves attachments and magazines
|
||||
- Provides feedback on actions
|
||||
|
||||
3. **Data Management**
|
||||
- **Fetch Locker** (`fnc_fetchLocker.sqf`)
|
||||
- Retrieves locker contents and information
|
||||
- Retrieves locker contents
|
||||
- Updates UI display
|
||||
- Manages item categorization
|
||||
- Handles item metadata
|
||||
|
||||
- **Fetch Player** (`fnc_fetchPlayer.sqf`)
|
||||
- Retrieves player equipment information
|
||||
- Retrieves player equipment
|
||||
- Updates UI display
|
||||
- Manages equipment lists
|
||||
- Handles item metadata
|
||||
|
||||
### User Interface
|
||||
1. **Modern Web Interface**
|
||||
- Responsive design
|
||||
- Category filtering
|
||||
- Item categorization
|
||||
- Storage statistics
|
||||
- Equipment details view
|
||||
|
||||
2. **Interface Features**
|
||||
- Storage space tracking
|
||||
- Item count display
|
||||
- Category filters:
|
||||
- All Items
|
||||
- Weapons
|
||||
- Clothing
|
||||
- Equipment
|
||||
- Magazines
|
||||
- Item details:
|
||||
- Name
|
||||
- Category
|
||||
- Condition
|
||||
- Quantity
|
||||
- Attachments
|
||||
|
||||
3. **Control Elements**
|
||||
- Store button
|
||||
- Equip button
|
||||
- Category filters
|
||||
- Item lists
|
||||
- Status indicators
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
@ -43,9 +98,30 @@ The module uses several event handlers for initialization and execution:
|
||||
## Usage
|
||||
To use the locker module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Access the locker through the provided UI
|
||||
3. Manage equipment using the appropriate functions
|
||||
4. Monitor equipment status and storage
|
||||
2. Access the locker through the interaction menu
|
||||
3. Manage equipment using the interface:
|
||||
```sqf
|
||||
// Open locker interface
|
||||
[] call forge_client_locker_fnc_openLocker;
|
||||
|
||||
// Store equipment
|
||||
[] call forge_client_locker_fnc_storeGear;
|
||||
|
||||
// Equip items
|
||||
[] call forge_client_locker_fnc_equipGear;
|
||||
```
|
||||
4. Monitor storage space and item status
|
||||
|
||||
## Configuration
|
||||
The module can be configured through the main Forge client configuration:
|
||||
```cpp
|
||||
// Locker storage space (default: 100)
|
||||
FORGE_Locker_Space = 100;
|
||||
|
||||
// Enable/disable features
|
||||
FORGE_Locker_EnableAttachments = 1;
|
||||
FORGE_Locker_EnableMagazines = 1;
|
||||
```
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
@ -55,3 +131,19 @@ Debug mode can be enabled by uncommenting the following in `script_component.hpp
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Modern web-based interface
|
||||
- Real-time storage tracking
|
||||
- Equipment condition preservation
|
||||
- Attachment management
|
||||
- Magazine ammo tracking
|
||||
- Category-based filtering
|
||||
- Responsive UI design
|
||||
- Error handling
|
||||
- User feedback
|
||||
- State management
|
||||
- Event system integration
|
||||
- Database persistence
|
||||
- Inventory validation
|
||||
- Space management
|
@ -1,4 +1,4 @@
|
||||
#define MAJOR 1
|
||||
#define MINOR 0
|
||||
#define PATCH 0
|
||||
#define BUILD 23
|
||||
#define BUILD 32
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Forge Medical Module
|
||||
|
||||
## Overview
|
||||
The Medical module provides a comprehensive medical system for the Forge client. It includes features for handling player health, death, respawn, and medical costs.
|
||||
The Medical module provides a comprehensive medical system for the Forge client. It includes features for handling player health, death, respawn, medical costs, and inventory management during medical events.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
@ -16,25 +16,85 @@ The Medical module provides a comprehensive medical system for the Forge client.
|
||||
### Medical System
|
||||
1. **Medical Initialization** (`fnc_initMedical.sqf`)
|
||||
- Initializes the medical system
|
||||
- Sets up necessary configurations and health monitoring
|
||||
- Sets up stretcher detection and triggers
|
||||
- Configures medical service points
|
||||
- Manages occupancy tracking
|
||||
- Handles system variables
|
||||
|
||||
2. **Health Management**
|
||||
- **Heart Beat** (`fnc_heartBeat.sqf`)
|
||||
- Monitors player vital signs
|
||||
- Tracks medical costs
|
||||
- Manages respawn conditions
|
||||
- Handles payment verification
|
||||
- Controls spectator mode
|
||||
|
||||
- **On Killed** (`fnc_onKilled.sqf`)
|
||||
- Handles player death events
|
||||
- Creates body bag
|
||||
- Saves dropped weapons
|
||||
- Manages inventory transfer
|
||||
- Triggers respawn process
|
||||
|
||||
- **On Respawn** (`fnc_onRespawn.sqf`)
|
||||
- Manages player respawn process
|
||||
- Handles medical costs
|
||||
- Sets default loadout
|
||||
- Manages stretcher placement
|
||||
- Controls spectator mode
|
||||
- Processes payment verification
|
||||
|
||||
3. **Inventory Management**
|
||||
- **Move Inventory** (`fnc_moveInventory.sqf`)
|
||||
- Handles inventory transfers during medical events
|
||||
- Transfers player inventory to body bag
|
||||
- Handles all equipment types:
|
||||
- Headgear
|
||||
- Uniforms and items
|
||||
- Vests and contents
|
||||
- Backpacks and contents
|
||||
- Weapons and attachments
|
||||
- Magazines and ammo
|
||||
- Assigned items
|
||||
- Dropped equipment
|
||||
- Manages weapon holders
|
||||
- Preserves item condition
|
||||
|
||||
- **Save Dropped Weapons** (`fnc_saveDroppedWeapons.sqf`)
|
||||
- Manages weapon preservation on death
|
||||
- Tracks dropped weapons
|
||||
- Manages weapon attachments
|
||||
- Preserves magazine data
|
||||
- Handles handgun equipment
|
||||
- Stores item information
|
||||
|
||||
4. **Medical Costs**
|
||||
- **Deduct Medical Cost** (`fnc_deductMedicalCost.sqf`)
|
||||
- Handles medical service payments
|
||||
- Manages account selection
|
||||
- Processes payment deduction
|
||||
- Provides payment feedback
|
||||
- Updates account balances
|
||||
|
||||
### Medical Features
|
||||
1. **Stretcher System**
|
||||
- Automatic stretcher detection
|
||||
- Occupancy tracking
|
||||
- Position management
|
||||
- Respawn placement
|
||||
- Trigger-based activation
|
||||
|
||||
2. **Body Bag System**
|
||||
- Custom body bag class
|
||||
- Increased storage capacity
|
||||
- ACE dragging support
|
||||
- Inventory preservation
|
||||
- Equipment management
|
||||
|
||||
3. **Payment System**
|
||||
- Insurance deductible
|
||||
- Medical service costs
|
||||
- Account balance checking
|
||||
- Payment processing
|
||||
- Transaction feedback
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
@ -48,9 +108,36 @@ The module uses several event handlers for initialization and execution:
|
||||
To use the medical module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Monitor player health through the medical system
|
||||
3. Handle medical events using the appropriate functions
|
||||
3. Handle medical events using the appropriate functions:
|
||||
```sqf
|
||||
// Initialize medical system
|
||||
[] call forge_client_medical_fnc_initMedical;
|
||||
|
||||
// Handle player death
|
||||
[player, killer, instigator, true] call forge_client_medical_fnc_onKilled;
|
||||
|
||||
// Process respawn
|
||||
[player, corpse] call forge_client_medical_fnc_onRespawn;
|
||||
```
|
||||
4. Manage medical costs and inventory during medical events
|
||||
|
||||
## Configuration
|
||||
The module can be configured through the main Forge client configuration:
|
||||
```cpp
|
||||
// Medical cost (default: 1000)
|
||||
MED_COST = 1000;
|
||||
|
||||
// Insurance deductible (default: 200)
|
||||
INS_DEDUCT = 200;
|
||||
|
||||
// Stretcher types
|
||||
FORGE_Medical_StretcherTypes = [
|
||||
"Land_Stretcher_01_F",
|
||||
"Land_Stretcher_01_olive_F",
|
||||
"Land_Stretcher_01_sand_F"
|
||||
];
|
||||
```
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
@ -59,3 +146,19 @@ Debug mode can be enabled by uncommenting the following in `script_component.hpp
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Stretcher-based respawn system
|
||||
- Body bag inventory management
|
||||
- Medical cost processing
|
||||
- Insurance system integration
|
||||
- Inventory preservation
|
||||
- Equipment tracking
|
||||
- Payment verification
|
||||
- Spectator mode control
|
||||
- Trigger-based activation
|
||||
- Event system integration
|
||||
- State management
|
||||
- Error handling
|
||||
- User feedback
|
||||
- Database persistence
|
132
addons/misc/README.md
Normal file
132
addons/misc/README.md
Normal file
@ -0,0 +1,132 @@
|
||||
# Forge Misc Module
|
||||
|
||||
## Overview
|
||||
The Misc module provides a collection of utility functions and features for the Forge client. It includes a notification system, string handling, number formatting, and various helper functions used throughout the client.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
### Notification System
|
||||
1. **Notification Display** (`fnc_notify.sqf`)
|
||||
- Creates customizable notifications
|
||||
- Supports multiple notification types:
|
||||
- Error (red)
|
||||
- Warning (amber)
|
||||
- Success (green)
|
||||
- Info (blue)
|
||||
- Custom colors
|
||||
- Configurable display options:
|
||||
- Text content
|
||||
- Display duration
|
||||
- Display side (left/right)
|
||||
- Animation speed
|
||||
- Material Design color scheme
|
||||
- Sound effects
|
||||
- Stacking support
|
||||
- Fade animations
|
||||
|
||||
### String Handling
|
||||
1. **String Serialization** (`fnc_serializeString.sqf`)
|
||||
- Converts strings to serialized format
|
||||
- Handles special characters
|
||||
- Supports data transfer
|
||||
|
||||
2. **String Deserialization** (`fnc_deserializeString.sqf`)
|
||||
- Converts serialized strings back to original format
|
||||
- Restores special characters
|
||||
- Processes received data
|
||||
|
||||
### Number Formatting
|
||||
1. **Number Format** (`fnc_formatNumber.sqf`)
|
||||
- Formats numbers for display
|
||||
- Adds thousand separators
|
||||
- Handles decimal places
|
||||
- Currency formatting support
|
||||
|
||||
### Utility Functions
|
||||
1. **System Time** (`fnc_getSystemTime.sqf`)
|
||||
- Gets current system time
|
||||
- Timestamp generation
|
||||
- Time-based operations
|
||||
|
||||
2. **Equipment Checks**
|
||||
- **Binocular Check** (`fnc_isAssignableBinocular.sqf`)
|
||||
- Validates binocular equipment
|
||||
- Checks compatibility
|
||||
- Equipment type verification
|
||||
|
||||
- **Weapon Type Check** (`fnc_isWeaponType.sqf`)
|
||||
- Validates weapon types
|
||||
- Equipment categorization
|
||||
- Type verification
|
||||
|
||||
3. **Cargo Management** (`fnc_cargoToPairs.sqf`)
|
||||
- Converts cargo to paired format
|
||||
- Inventory management
|
||||
- Equipment organization
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
|
||||
## Usage
|
||||
To use the misc module functions:
|
||||
```sqf
|
||||
// Create a notification
|
||||
["Hello World!", "default", 3, "right"] call forge_client_misc_fnc_notify;
|
||||
|
||||
// Format a number
|
||||
[1000000] call forge_client_misc_fnc_formatNumber; // Returns "1,000,000"
|
||||
|
||||
// Get system time
|
||||
[] call forge_client_misc_fnc_getSystemTime;
|
||||
|
||||
// Check weapon type
|
||||
["arifle_MX_F"] call forge_client_misc_fnc_isWeaponType;
|
||||
```
|
||||
|
||||
## Configuration
|
||||
The module can be configured through the main Forge client configuration:
|
||||
```cpp
|
||||
// Notification colors (Material Design)
|
||||
#define COLOR_RED [0.957, 0.263, 0.212, 1]
|
||||
#define COLOR_GREEN [0.298, 0.686, 0.314, 1]
|
||||
#define COLOR_BLUE [0.129, 0.588, 0.953, 1]
|
||||
#define COLOR_AMBER [1, 0.757, 0.027, 1]
|
||||
|
||||
// Notification settings
|
||||
#define NOTIFICATION_DEFAULT_DURATION 3
|
||||
#define NOTIFICATION_MAX_STACK 3
|
||||
#define NOTIFICATION_MARGIN 0.01
|
||||
```
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Material Design color scheme
|
||||
- Responsive notification system
|
||||
- String serialization/deserialization
|
||||
- Number formatting utilities
|
||||
- Equipment validation
|
||||
- Time management
|
||||
- Cargo handling
|
||||
- Event system integration
|
||||
- Error handling
|
||||
- User feedback
|
||||
- Cross-module compatibility
|
120
addons/money/README.md
Normal file
120
addons/money/README.md
Normal file
@ -0,0 +1,120 @@
|
||||
# Forge Money Module
|
||||
|
||||
## Overview
|
||||
The Money module provides a comprehensive currency management system for the Forge client. It includes features for handling cash transactions, money transfers, and currency management across the client's various systems.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
### Cash Management
|
||||
1. **Give Cash** (`fnc_giveCash.sqf`)
|
||||
- Handles giving cash to players
|
||||
- Validates transaction amounts
|
||||
- Updates player balances
|
||||
- Provides transaction feedback
|
||||
- Supports direct transfers
|
||||
|
||||
2. **Take Cash** (`fnc_takeCash.sqf`)
|
||||
- Manages cash removal from players
|
||||
- Validates available funds
|
||||
- Updates player balances
|
||||
- Provides transaction feedback
|
||||
- Supports direct deductions
|
||||
|
||||
3. **Cash Submission** (`fnc_giveCashSubmit.sqf`)
|
||||
- Processes cash transactions
|
||||
- Validates transaction data
|
||||
- Updates player balances
|
||||
- Handles transaction feedback
|
||||
- Manages transaction history
|
||||
|
||||
### Transaction Features
|
||||
1. **Direct Transfers**
|
||||
- Player-to-player transfers
|
||||
- Amount validation
|
||||
- Balance verification
|
||||
- Transaction confirmation
|
||||
- Error handling
|
||||
|
||||
2. **Balance Management**
|
||||
- Real-time balance updates
|
||||
- Transaction history
|
||||
- Balance verification
|
||||
- Error prevention
|
||||
- Transaction logging
|
||||
|
||||
3. **Transaction Validation**
|
||||
- Amount verification
|
||||
- Player validation
|
||||
- Balance checks
|
||||
- Error handling
|
||||
- Transaction confirmation
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
|
||||
## Usage
|
||||
To use the money module:
|
||||
```sqf
|
||||
// Give cash to a player
|
||||
[player, 1000] call forge_client_money_fnc_giveCash;
|
||||
|
||||
// Take cash from a player
|
||||
[player, 500] call forge_client_money_fnc_takeCash;
|
||||
|
||||
// Submit a cash transaction
|
||||
[player, 750, "Payment for services"] call forge_client_money_fnc_giveCashSubmit;
|
||||
```
|
||||
|
||||
## Integration
|
||||
The money module integrates with other Forge client systems:
|
||||
1. **Bank System**
|
||||
- Wallet management
|
||||
- Account transfers
|
||||
- Balance synchronization
|
||||
- Transaction history
|
||||
|
||||
2. **Organization System**
|
||||
- Organization funds
|
||||
- Member payments
|
||||
- Transaction tracking
|
||||
- Balance management
|
||||
|
||||
3. **Admin System**
|
||||
- Administrative transfers
|
||||
- Balance modifications
|
||||
- Transaction oversight
|
||||
- System management
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Real-time transaction processing
|
||||
- Secure balance management
|
||||
- Transaction validation
|
||||
- Error handling
|
||||
- User feedback
|
||||
- Cross-module integration
|
||||
- Event system integration
|
||||
- State management
|
||||
- Database persistence
|
||||
- Transaction logging
|
||||
- Balance verification
|
||||
- Player validation
|
@ -1,126 +1,134 @@
|
||||
# Player Organization Module
|
||||
# Forge Organization Module
|
||||
|
||||
## Overview
|
||||
The Organization module provides a comprehensive system for managing player-created organizations in the Forge client. It enables players to create, join, and manage organizations with features including member management, asset tracking, financial operations, and reputation systems.
|
||||
|
||||
The Player Organization Module provides a comprehensive system for managing player-created organizations in Arma 3. This module enables players to create, join, and manage organizations with features including member management, asset tracking, financial operations, and reputation systems.
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
- ArmaDragonflyClient
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
- **Organization Creation & Management**: Create and disband organizations with customizable names
|
||||
- **Member Management**: Add, remove, and manage organization members with different roles
|
||||
- **Asset Tracking**: Register and manage organization-owned assets (vehicles, buildings, etc.)
|
||||
- **Financial System**: Track organization funds with deposit and withdrawal capabilities
|
||||
- **Reputation System**: Manage organization reputation that can influence gameplay mechanics
|
||||
- **Database Integration**: Persistent storage using ArmaDragonflyClient for reliable data management
|
||||
- **User-Friendly Notifications**: Visual feedback for all organization operations
|
||||
### Organization Management
|
||||
1. **Creation & Disbanding**
|
||||
- Create new organizations with custom names
|
||||
- Set initial funds and reputation
|
||||
- Disband organizations (owner only)
|
||||
- Automatic database persistence
|
||||
|
||||
2. **Member Management**
|
||||
- Add and remove members
|
||||
- Role-based permissions
|
||||
- Member status tracking
|
||||
- Join date tracking
|
||||
- Leave organization option
|
||||
|
||||
3. **Asset Management**
|
||||
- Track organization-owned assets
|
||||
- Categorize assets by type
|
||||
- Store custom properties
|
||||
- Asset value tracking
|
||||
- Asset history logging
|
||||
|
||||
### Financial System
|
||||
1. **Fund Management**
|
||||
- Add and remove funds
|
||||
- Transaction history
|
||||
- Balance tracking
|
||||
- Financial logging
|
||||
- Real-time updates
|
||||
|
||||
2. **Reputation System**
|
||||
- Reputation tracking
|
||||
- Reputation adjustments
|
||||
- Reputation history
|
||||
- Impact on gameplay
|
||||
- Reputation logging
|
||||
|
||||
### Data Management
|
||||
1. **Database Integration**
|
||||
- Persistent storage
|
||||
- Automatic synchronization
|
||||
- Data validation
|
||||
- Error handling
|
||||
- Backup support
|
||||
|
||||
2. **Logging System**
|
||||
- Comprehensive activity logs
|
||||
- Transaction history
|
||||
- Member changes
|
||||
- Asset modifications
|
||||
- System events
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
|
||||
## Usage
|
||||
|
||||
### Creating an Organization
|
||||
|
||||
To use the organization module:
|
||||
```sqf
|
||||
// Create a new organization with default funds and reputation
|
||||
[getPlayerUID player, "My Organization"] call forge_client_org_fnc_create;
|
||||
// Create a new organization
|
||||
[getPlayerUID player, "My Organization", 5000, 100] call forge_client_org_fnc_create;
|
||||
|
||||
// Create an organization with custom initial funds and reputation
|
||||
[getPlayerUID player, "Elite Squad", 5000, 100] call forge_client_org_fnc_create;
|
||||
```
|
||||
|
||||
### Managing Members
|
||||
|
||||
```sqf
|
||||
// Add a member to your organization
|
||||
// Add a member
|
||||
["76561198012345678", "John Doe"] call forge_client_org_fnc_addMember;
|
||||
|
||||
// Remove a member from your organization
|
||||
["76561198012345678"] call forge_client_org_fnc_removeMember;
|
||||
|
||||
// Leave an organization (for members)
|
||||
[] call forge_client_org_fnc_leave;
|
||||
```
|
||||
|
||||
### Managing Assets
|
||||
|
||||
```sqf
|
||||
// Add a vehicle to organization assets
|
||||
["vehicle", "B_MRAP_01_F"] call forge_client_org_fnc_addAsset;
|
||||
|
||||
// Add a vehicle with custom properties
|
||||
private _properties = createHashMap;
|
||||
_properties set ["color", "red"];
|
||||
_properties set ["plate", "ORG-001"];
|
||||
["vehicle", "B_MRAP_01_F", _properties] call forge_client_org_fnc_addAsset;
|
||||
|
||||
// Remove an asset from the organization
|
||||
["vehicle", "B_MRAP_01_F_1234567890"] call forge_client_org_fnc_removeAsset;
|
||||
```
|
||||
|
||||
### Financial Operations
|
||||
|
||||
```sqf
|
||||
// Add funds to organization account
|
||||
// Add funds
|
||||
[1000] call forge_client_org_fnc_addFunds;
|
||||
|
||||
// Remove funds from organization account
|
||||
[-500] call forge_client_org_fnc_addFunds;
|
||||
```
|
||||
|
||||
### Reputation Management
|
||||
|
||||
```sqf
|
||||
// Increase organization reputation
|
||||
// Add reputation
|
||||
[10] call forge_client_org_fnc_addReputation;
|
||||
|
||||
// Decrease organization reputation
|
||||
[-5] call forge_client_org_fnc_addReputation;
|
||||
// Add an asset
|
||||
["vehicle", "B_MRAP_01_F"] call forge_client_org_fnc_addAsset;
|
||||
```
|
||||
|
||||
### Disbanding an Organization
|
||||
## Integration
|
||||
The organization module integrates with other Forge client systems:
|
||||
1. **Bank System**
|
||||
- Organization accounts
|
||||
- Transaction processing
|
||||
- Balance management
|
||||
- Financial reporting
|
||||
|
||||
```sqf
|
||||
// Permanently delete the organization (owner only)
|
||||
[] call forge_client_org_fnc_disband;
|
||||
2. **Vehicle System**
|
||||
- Organization vehicles
|
||||
- Vehicle registration
|
||||
- Maintenance tracking
|
||||
- Usage logging
|
||||
|
||||
3. **Property System**
|
||||
- Organization properties
|
||||
- Property management
|
||||
- Value tracking
|
||||
- Usage rights
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Technical Architecture
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
The module is built around a central organization store interface that provides a clean API for all organization operations. This interface handles data validation, database persistence, and user feedback.
|
||||
|
||||
### Core Components
|
||||
|
||||
- **Organization Store**: Central interface for all organization operations
|
||||
- **Database Integration**: Persistent storage using ArmaDragonflyClient
|
||||
- **User Notifications**: Visual feedback system for all operations
|
||||
- **Data Validation**: Comprehensive input validation to ensure data integrity
|
||||
|
||||
### Data Structure
|
||||
|
||||
Organizations are stored as structured hashmaps with the following key components:
|
||||
|
||||
- **Basic Information**: ID, name, owner, creation date
|
||||
- **Members**: List of members with roles and join dates
|
||||
- **Assets**: Categorized inventory of organization-owned assets
|
||||
- **Finances**: Current funds and transaction history
|
||||
- **Reputation**: Current reputation score and history
|
||||
- **Logs**: Comprehensive activity logs for auditing
|
||||
|
||||
## Integration with Other Systems
|
||||
|
||||
The organization module is designed to integrate with other game systems:
|
||||
|
||||
- **Vehicle Garage**: Register organization-owned vehicles
|
||||
- **Property System**: Manage organization-owned buildings and territories
|
||||
- **Mission System**: Organization-specific missions and objectives
|
||||
- **Economy System**: Organization financial operations and investments
|
||||
|
||||
## Developer Notes
|
||||
|
||||
- All organization operations are performed through the organization store interface
|
||||
- The store is initialized automatically when needed via `verifyOrgStore`
|
||||
- Database operations are asynchronous and use callback functions
|
||||
- User feedback is provided through the notification system
|
||||
- Error handling is comprehensive with appropriate user feedback
|
||||
|
||||
---
|
||||
|
||||
*Developed by J. Schmidt*
|
||||
## Technical Details
|
||||
- Real-time data synchronization
|
||||
- Secure data management
|
||||
- Comprehensive validation
|
||||
- Error handling
|
||||
- User feedback
|
||||
- Cross-module integration
|
||||
- Event system integration
|
||||
- State management
|
||||
- Database persistence
|
||||
- Transaction logging
|
||||
- Asset tracking
|
||||
- Member management
|
@ -460,7 +460,7 @@ private _orgStoreInterface = createHashMapObject [[
|
||||
_self set ["currentOrganization", _orgData];
|
||||
_self call ["saveToDatabase", []];
|
||||
|
||||
_assetId // Return the generated ID
|
||||
true
|
||||
}],
|
||||
["getAssets", {
|
||||
/**
|
||||
|
140
addons/phone/README.md
Normal file
140
addons/phone/README.md
Normal file
@ -0,0 +1,140 @@
|
||||
# Forge Phone Module
|
||||
|
||||
## Overview
|
||||
The Phone module provides a comprehensive mobile phone system for the Forge client. It includes features for messaging, email, contacts management, and a modern user interface with various applications.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
### Communication
|
||||
1. **Messaging System**
|
||||
- Send and receive text messages
|
||||
- Message history
|
||||
- Offline message support
|
||||
- Message notifications
|
||||
- Contact-based messaging
|
||||
|
||||
2. **Email System**
|
||||
- Send and receive emails
|
||||
- Email history
|
||||
- Offline email support
|
||||
- Email notifications
|
||||
- Contact-based emailing
|
||||
|
||||
3. **Contact Management**
|
||||
- Add and remove contacts
|
||||
- Contact details (name, phone, email)
|
||||
- Contact list organization
|
||||
- Quick contact actions
|
||||
- Contact search
|
||||
|
||||
### User Interface
|
||||
1. **Phone Interface**
|
||||
- Modern mobile phone design
|
||||
- Home screen with app icons
|
||||
- App navigation
|
||||
- Status bar with time
|
||||
- Interactive controls
|
||||
|
||||
2. **Applications**
|
||||
- Messages app
|
||||
- Email app
|
||||
- Contacts app
|
||||
- Camera app
|
||||
- Photos app
|
||||
- Settings app
|
||||
- Safari browser
|
||||
|
||||
3. **Controls**
|
||||
- Touch-based interaction
|
||||
- Button feedback
|
||||
- Visual indicators
|
||||
- Smooth transitions
|
||||
- Intuitive navigation
|
||||
|
||||
### System Features
|
||||
1. **Phone Management**
|
||||
- Phone initialization
|
||||
- Action binding
|
||||
- Variable management
|
||||
- State persistence
|
||||
- Profile saving
|
||||
|
||||
2. **Data Management**
|
||||
- Contact storage
|
||||
- Message history
|
||||
- Email storage
|
||||
- Profile data
|
||||
- Settings persistence
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
|
||||
## Usage
|
||||
To use the phone module:
|
||||
```sqf
|
||||
// Initialize phone
|
||||
[] call forge_client_phone_fnc_initPhone;
|
||||
|
||||
// Add a contact
|
||||
[cursorObject] call forge_client_phone_fnc_addContact;
|
||||
|
||||
// Send a message
|
||||
["1234567890", "Hello World"] call forge_client_phone_fnc_sendMsg;
|
||||
|
||||
// Send an email
|
||||
["recipient@spearnet.mil", "Subject", "Message"] call forge_client_phone_fnc_sendEmail;
|
||||
```
|
||||
|
||||
## Integration
|
||||
The phone module integrates with other Forge client systems:
|
||||
1. **Player System**
|
||||
- Player identification
|
||||
- Phone number assignment
|
||||
- Email assignment
|
||||
- Profile management
|
||||
|
||||
2. **Database System**
|
||||
- Message storage
|
||||
- Contact persistence
|
||||
- Email storage
|
||||
- Profile data
|
||||
|
||||
3. **Notification System**
|
||||
- Message alerts
|
||||
- Email notifications
|
||||
- System notifications
|
||||
- Status updates
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Real-time messaging
|
||||
- Secure data management
|
||||
- Contact synchronization
|
||||
- Message persistence
|
||||
- Email handling
|
||||
- UI responsiveness
|
||||
- Cross-module integration
|
||||
- Event system integration
|
||||
- State management
|
||||
- Profile persistence
|
||||
- Notification system
|
||||
- Input validation
|
133
addons/player/README.md
Normal file
133
addons/player/README.md
Normal file
@ -0,0 +1,133 @@
|
||||
# Forge Player Module
|
||||
|
||||
## Overview
|
||||
The Player module provides a comprehensive system for managing player data, persistence, and state in the Forge client. It includes features for player initialization, data management, and integration with other systems.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
- ArmaDragonflyClient
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
### Player Management
|
||||
1. **Initialization**
|
||||
- First-time player setup
|
||||
- Data loading from database
|
||||
- Default values assignment
|
||||
- State initialization
|
||||
- Profile creation
|
||||
|
||||
2. **Data Persistence**
|
||||
- Automatic data saving
|
||||
- Periodic state synchronization
|
||||
- Position and direction tracking
|
||||
- Loadout persistence
|
||||
- Equipment state management
|
||||
|
||||
3. **State Management**
|
||||
- Player position tracking
|
||||
- Direction tracking
|
||||
- Stance management
|
||||
- Weapon holstering
|
||||
- Current weapon tracking
|
||||
|
||||
### Data Management
|
||||
1. **Player Data**
|
||||
- Armory unlocks
|
||||
- Garage unlocks
|
||||
- Locker contents
|
||||
- Vehicle inventory
|
||||
- Financial information
|
||||
- Contact details
|
||||
- Organization membership
|
||||
- Player statistics
|
||||
- Equipment loadouts
|
||||
- Position and state
|
||||
|
||||
2. **Profile Data**
|
||||
- Email address
|
||||
- Phone number
|
||||
- Paygrade
|
||||
- Organization
|
||||
- Reputation
|
||||
- Custom settings
|
||||
- Preferences
|
||||
|
||||
3. **Save System**
|
||||
- Automatic saving
|
||||
- Periodic backups
|
||||
- Data validation
|
||||
- Error recovery
|
||||
- State verification
|
||||
|
||||
### Integration
|
||||
1. **Database System**
|
||||
- Data persistence
|
||||
- State synchronization
|
||||
- Profile management
|
||||
- Error handling
|
||||
- Data validation
|
||||
|
||||
2. **Organization System**
|
||||
- Member management
|
||||
- Role assignment
|
||||
- Organization tracking
|
||||
- Asset management
|
||||
- Financial integration
|
||||
|
||||
3. **Financial System**
|
||||
- Cash management
|
||||
- Bank integration
|
||||
- Transaction tracking
|
||||
- Paygrade system
|
||||
- Financial persistence
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
|
||||
## Usage
|
||||
To use the player module:
|
||||
```sqf
|
||||
// Initialize player
|
||||
[] call forge_client_init_fnc_initPlayer;
|
||||
|
||||
// Load player data
|
||||
[] call forge_client_init_fnc_playerDBLoad;
|
||||
|
||||
// Save player data
|
||||
[] call forge_client_init_fnc_playerDBSave;
|
||||
|
||||
// Handle player load
|
||||
[_data] call forge_client_init_fnc_handlePlayerLoad;
|
||||
```
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Real-time data synchronization
|
||||
- Secure data management
|
||||
- Comprehensive validation
|
||||
- Error handling
|
||||
- State persistence
|
||||
- Profile management
|
||||
- Cross-module integration
|
||||
- Event system integration
|
||||
- Data versioning
|
||||
- Backup support
|
||||
- Transaction logging
|
||||
- Data integrity checks
|
@ -1,7 +1,7 @@
|
||||
# Forge Service Module
|
||||
|
||||
## Overview
|
||||
The Service module provides a comprehensive vehicle service system for the Forge client. It includes features for vehicle repair, refueling, rearming, and general maintenance.
|
||||
The Service module provides a comprehensive vehicle service system for the Forge client. It includes features for vehicle repair, refueling, rearming, and general maintenance, with integration into the organization system for cost management.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
@ -16,36 +16,116 @@ The Service module provides a comprehensive vehicle service system for the Forge
|
||||
### Service System
|
||||
1. **Service Initialization** (`fnc_initService.sqf`)
|
||||
- Initializes the service system
|
||||
- Sets up necessary configurations and service points
|
||||
- Sets up service points and triggers
|
||||
- Configures fuel pump locations
|
||||
- Manages service area detection
|
||||
|
||||
2. **Vehicle Maintenance**
|
||||
- **Repair** (`fnc_repair.sqf`)
|
||||
- Handles vehicle repair operations
|
||||
- Calculates repair costs based on damage
|
||||
- Manages labor hours and parts costs
|
||||
- Provides repair progress feedback
|
||||
- Integrates with organization funds
|
||||
|
||||
- **Refuel** (`fnc_refuel.sqf`)
|
||||
- Manages vehicle refueling
|
||||
- Calculates fuel costs
|
||||
- Provides real-time refueling progress
|
||||
- Handles fuel pump interactions
|
||||
- Integrates with organization funds
|
||||
|
||||
- **Rearm** (`fnc_rearm.sqf`)
|
||||
- Handles vehicle rearming
|
||||
- **Fuel** (`fnc_fuel.sqf`)
|
||||
- Manages fuel system operations
|
||||
- Manages magazine reloading
|
||||
- Processes turret systems
|
||||
- Calculates rearm costs
|
||||
- Integrates with organization funds
|
||||
|
||||
3. **Vehicle Service** (`fnc_vehicle.sqf`)
|
||||
- Comprehensive vehicle service management
|
||||
- Coordinates different service operations
|
||||
- Handles cost calculations
|
||||
- Manages service notifications
|
||||
- Integrates with organization system
|
||||
|
||||
### Cost Management
|
||||
1. **Cost Calculation**
|
||||
- Repair costs (labor and parts)
|
||||
- Fuel costs (based on amount needed)
|
||||
- Rearm costs (per magazine)
|
||||
- Total service costs
|
||||
- Organization fund integration
|
||||
|
||||
2. **Organization Integration**
|
||||
- Fund verification
|
||||
- Cost deduction
|
||||
- Transaction logging
|
||||
- Balance updates
|
||||
- Service authorization
|
||||
|
||||
### Service Points
|
||||
1. **Fuel Stations**
|
||||
- Automatic detection
|
||||
- Service area setup
|
||||
- Trigger management
|
||||
- Vehicle detection
|
||||
- Service activation
|
||||
|
||||
2. **Service Areas**
|
||||
- Area definition
|
||||
- Trigger configuration
|
||||
- Vehicle validation
|
||||
- Service coordination
|
||||
- Status monitoring
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
- `XEH_postInit_client.sqf`: Client-specific post-initialization
|
||||
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
|
||||
|
||||
## Usage
|
||||
To use the service module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Access service points through the provided functions
|
||||
3. Perform vehicle maintenance using the appropriate functions
|
||||
4. Monitor vehicle status and service operations
|
||||
```sqf
|
||||
// Initialize service system
|
||||
[] call forge_client_service_fnc_initService;
|
||||
|
||||
// Service a vehicle
|
||||
[vehicle, "LAND"] call forge_client_service_fnc_vehicle;
|
||||
|
||||
// Repair a vehicle
|
||||
[vehicle, "B_APC_Tracked_01_CRV_F"] call forge_client_service_fnc_repair;
|
||||
|
||||
// Refuel a vehicle
|
||||
[vehicle, "B_APC_Tracked_01_CRV_F"] call forge_client_service_fnc_refuel;
|
||||
|
||||
// Rearm a vehicle
|
||||
[vehicle, "B_APC_Tracked_01_CRV_F"] call forge_client_service_fnc_rearm;
|
||||
```
|
||||
|
||||
## Integration
|
||||
The service module integrates with other Forge client systems:
|
||||
1. **Organization System**
|
||||
- Fund management
|
||||
- Cost tracking
|
||||
- Transaction processing
|
||||
- Service authorization
|
||||
- Balance updates
|
||||
|
||||
2. **Vehicle System**
|
||||
- Vehicle state tracking
|
||||
- Damage monitoring
|
||||
- Fuel management
|
||||
- Armament status
|
||||
- Service history
|
||||
|
||||
3. **Notification System**
|
||||
- Service progress updates
|
||||
- Cost notifications
|
||||
- Status messages
|
||||
- Error reporting
|
||||
- Completion alerts
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
@ -55,3 +135,17 @@ Debug mode can be enabled by uncommenting the following in `script_component.hpp
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Real-time service processing
|
||||
- Cost calculation system
|
||||
- Organization fund integration
|
||||
- Service point management
|
||||
- Vehicle state tracking
|
||||
- Progress monitoring
|
||||
- Error handling
|
||||
- Transaction logging
|
||||
- Service validation
|
||||
- Resource management
|
||||
- Cross-module integration
|
||||
- Event system integration
|
@ -1,7 +1,7 @@
|
||||
# Forge Store Module
|
||||
|
||||
## Overview
|
||||
The Store module provides a comprehensive shopping system for the Forge client. It includes features for purchasing items, vehicles, and managing store operations.
|
||||
The Store module provides a comprehensive shopping system for the Forge client. It includes features for purchasing items, vehicles, and equipment, with support for multiple payment methods and integration with the organization system.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
@ -16,40 +16,146 @@ The Store module provides a comprehensive shopping system for the Forge client.
|
||||
### Store System
|
||||
1. **Store Initialization** (`fnc_initStore.sqf`)
|
||||
- Initializes the store system
|
||||
- Sets up necessary configurations and product catalog
|
||||
- Sets up store locations and configurations
|
||||
- Manages store types and categories
|
||||
- Configures payment methods
|
||||
- Handles product catalog
|
||||
|
||||
2. **Store Interface**
|
||||
- **Open Store** (`fnc_openStore.sqf`)
|
||||
- Opens the store user interface
|
||||
- Displays store name and categories
|
||||
- Manages payment method selection
|
||||
- Handles product filtering
|
||||
|
||||
- **Select Product** (`fnc_selectProduct.sqf`)
|
||||
- Handles product selection
|
||||
- Manages product categories
|
||||
- Processes product data
|
||||
- Coordinates purchase flow
|
||||
|
||||
- **Change Filter** (`fnc_changeFilter.sqf`)
|
||||
- Manages product filtering
|
||||
- Updates product display
|
||||
- Handles category switching
|
||||
- Maintains filter state
|
||||
|
||||
- **Change Payment** (`fnc_changePayment.sqf`)
|
||||
- Handles payment method selection
|
||||
- Manages payment options
|
||||
- Updates payment interface
|
||||
- Validates payment methods
|
||||
|
||||
3. **Purchase Management**
|
||||
- **Handle Purchase** (`fnc_handlePurchase.sqf`)
|
||||
- Processes purchase transactions
|
||||
- Validates payment methods
|
||||
- Manages organization funds
|
||||
- Handles transaction logging
|
||||
- Provides purchase feedback
|
||||
|
||||
- **Buy Item** (`fnc_buyItem.sqf`)
|
||||
- Handles item purchases
|
||||
- Manages locker integration
|
||||
- Processes item delivery
|
||||
- Updates inventory
|
||||
- Provides purchase confirmation
|
||||
|
||||
- **Buy Vehicle** (`fnc_buyVehicle.sqf`)
|
||||
- Manages vehicle purchases
|
||||
- Handles garage integration
|
||||
- Processes vehicle delivery
|
||||
- Updates garage inventory
|
||||
- Provides purchase confirmation
|
||||
|
||||
### Product Categories
|
||||
1. **Equipment**
|
||||
- Vests
|
||||
- Headwear
|
||||
- Facewear
|
||||
- HMD (Night Vision)
|
||||
- Backpacks
|
||||
- Uniforms
|
||||
|
||||
2. **Vehicles**
|
||||
- Wheeled vehicles
|
||||
- Tracked vehicles
|
||||
- Aircraft
|
||||
- Watercraft
|
||||
- Static weapons
|
||||
|
||||
3. **Supplies**
|
||||
- Medical supplies
|
||||
- Ammunition
|
||||
- Food rations
|
||||
- Repair kits
|
||||
- Other consumables
|
||||
|
||||
### Payment System
|
||||
1. **Payment Methods**
|
||||
- Personal funds
|
||||
- Organization funds
|
||||
- Mission funds
|
||||
- Custom payment types
|
||||
|
||||
2. **Transaction Management**
|
||||
- Payment validation
|
||||
- Fund verification
|
||||
- Balance updates
|
||||
- Transaction logging
|
||||
- Purchase confirmation
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
- `XEH_postInit_client.sqf`: Client-specific post-initialization
|
||||
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
|
||||
|
||||
## Usage
|
||||
To use the store module:
|
||||
1. Ensure the module is properly loaded in your mission
|
||||
2. Access the store through the provided UI
|
||||
3. Browse and filter products
|
||||
4. Make purchases using the appropriate functions
|
||||
```sqf
|
||||
// Initialize store system
|
||||
[] call forge_client_store_fnc_initStore;
|
||||
|
||||
// Open store interface
|
||||
[storeObject] call forge_client_store_fnc_openStore;
|
||||
|
||||
// Buy an item
|
||||
["arifle_MX_F", 1000, "weapon", "weapon"] call forge_client_store_fnc_buyItem;
|
||||
|
||||
// Buy a vehicle
|
||||
["B_APC_Tracked_01_rcws_F", 5000, "tank"] call forge_client_store_fnc_buyVehicle;
|
||||
```
|
||||
|
||||
## Integration
|
||||
The store module integrates with other Forge client systems:
|
||||
1. **Organization System**
|
||||
- Fund management
|
||||
- Purchase authorization
|
||||
- Transaction processing
|
||||
- Balance updates
|
||||
- Purchase history
|
||||
|
||||
2. **Locker System**
|
||||
- Item storage
|
||||
- Equipment management
|
||||
- Inventory updates
|
||||
- Item delivery
|
||||
- Storage validation
|
||||
|
||||
3. **Garage System**
|
||||
- Vehicle storage
|
||||
- Vehicle management
|
||||
- Purchase delivery
|
||||
- Inventory updates
|
||||
- Vehicle validation
|
||||
|
||||
4. **Notification System**
|
||||
- Purchase confirmations
|
||||
- Error messages
|
||||
- Transaction updates
|
||||
- Status notifications
|
||||
- System alerts
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
@ -59,3 +165,18 @@ Debug mode can be enabled by uncommenting the following in `script_component.hpp
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Real-time transaction processing
|
||||
- Multi-payment system support
|
||||
- Product catalog management
|
||||
- Category filtering system
|
||||
- Payment validation
|
||||
- Transaction logging
|
||||
- Purchase verification
|
||||
- Inventory management
|
||||
- Cross-module integration
|
||||
- Event system integration
|
||||
- UI state management
|
||||
- Error handling
|
||||
- Resource management
|
191
addons/task/CfgMissions.hpp
Normal file
191
addons/task/CfgMissions.hpp
Normal file
@ -0,0 +1,191 @@
|
||||
// TODO: Move to mission template and provide documentation
|
||||
class CfgMissions {
|
||||
// Global settings
|
||||
maxConcurrentMissions = 3;
|
||||
missionInterval = 300; // 5 minutes between mission generation
|
||||
|
||||
// Mission type weights
|
||||
class MissionWeights {
|
||||
attack = 0.2;
|
||||
defend = 0.2;
|
||||
hostage = 0.2;
|
||||
hvt = 0.15;
|
||||
defuse = 0.15;
|
||||
delivery = 0.1;
|
||||
};
|
||||
|
||||
// Mission locations
|
||||
class Locations {
|
||||
class CityOne {
|
||||
position[] = {1000, 1000, 0};
|
||||
type = "city";
|
||||
radius = 300;
|
||||
suitable[] = {"attack", "defend", "hostage"};
|
||||
};
|
||||
class MilitaryBase {
|
||||
position[] = {2000, 2000, 0};
|
||||
type = "military";
|
||||
radius = 500;
|
||||
suitable[] = {"hvt", "defend", "attack"};
|
||||
};
|
||||
class Industrial {
|
||||
position[] = {3000, 3000, 0};
|
||||
type = "industrial";
|
||||
radius = 200;
|
||||
suitable[] = {"delivery", "defuse"};
|
||||
};
|
||||
};
|
||||
|
||||
// AI Groups configuration
|
||||
class AIGroups {
|
||||
class Infantry {
|
||||
side = "EAST";
|
||||
class Units {
|
||||
class Unit0 {
|
||||
vehicle = "O_Soldier_TL_F";
|
||||
rank = "SERGEANT";
|
||||
position[] = {0, 0, 0};
|
||||
};
|
||||
class Unit1 {
|
||||
vehicle = "O_Soldier_AR_F";
|
||||
rank = "CORPORAL";
|
||||
position[] = {5, -5, 0};
|
||||
};
|
||||
class Unit2 {
|
||||
vehicle = "O_Soldier_LAT_F";
|
||||
rank = "PRIVATE";
|
||||
position[] = {-5, -5, 0};
|
||||
};
|
||||
};
|
||||
suitable[] = {"attack", "defend", "hostage"};
|
||||
};
|
||||
class SpecOps {
|
||||
side = "EAST";
|
||||
class Units {
|
||||
class Unit0 {
|
||||
vehicle = "O_recon_TL_F";
|
||||
rank = "SERGEANT";
|
||||
position[] = {0, 0, 0};
|
||||
};
|
||||
class Unit1 {
|
||||
vehicle = "O_recon_M_F";
|
||||
rank = "CORPORAL";
|
||||
position[] = {5, -5, 0};
|
||||
};
|
||||
};
|
||||
suitable[] = {"hvt", "hostage"};
|
||||
};
|
||||
};
|
||||
|
||||
// TODO: Continue to refine mission types and their specific settings
|
||||
// Mission type specific settings
|
||||
class MissionTypes {
|
||||
class Attack {
|
||||
minUnits = 4;
|
||||
maxUnits = 8;
|
||||
class Rewards {
|
||||
money[] = {500000, 1500000};
|
||||
reputation[] = {100, 500};
|
||||
equipment[] = {{"ItemGPS", 0.5}, {"ItemCompass", 0.3}};
|
||||
supplies[] = {{"FirstAidKit", 0.2}, {"Medikit", 0.1}};
|
||||
weapons[] = {{"arifle_MX_F", 0.3}, {"arifle_Katiba_F", 0.2}};
|
||||
vehicles[] = {{"B_MRAP_01_F", 0.1}, {"B_APC_Wheeled_01_cannon_F", 0.05}};
|
||||
special[] = {{"B_UAV_01_F", 0.05}, {"B_Heli_Light_01_F", 0.02}};
|
||||
};
|
||||
penalty[] = {-100, -25};
|
||||
timeLimit[] = {900, 1800}; // 15-30 minutes
|
||||
};
|
||||
|
||||
class Defend {
|
||||
minWaves = 3;
|
||||
maxWaves = 8;
|
||||
unitsPerWave[] = {4, 8};
|
||||
waveCooldown = 300;
|
||||
class Rewards {
|
||||
money[] = {750000, 2000000};
|
||||
reputation[] = {150, 600};
|
||||
equipment[] = {{"ItemGPS", 0.5}, {"ItemCompass", 0.3}};
|
||||
supplies[] = {{"FirstAidKit", 0.2}, {"Medikit", 0.1}};
|
||||
weapons[] = {{"arifle_MX_F", 0.3}, {"arifle_Katiba_F", 0.2}};
|
||||
vehicles[] = {{"B_MRAP_01_F", 0.1}, {"B_APC_Wheeled_01_cannon_F", 0.05}};
|
||||
special[] = {{"B_UAV_01_F", 0.05}, {"B_Heli_Light_01_F", 0.02}};
|
||||
};
|
||||
penalty[] = {-150, -50};
|
||||
timeLimit[] = {1800, 3600}; // 30-60 minutes
|
||||
};
|
||||
|
||||
class Hostage {
|
||||
class Hostages {
|
||||
civilian[] = {"C_man_1", "C_man_polo_1_F"};
|
||||
military[] = {"B_Pilot_F", "B_officer_F"};
|
||||
};
|
||||
class Rewards {
|
||||
money[] = {1000000, 2500000};
|
||||
reputation[] = {200, 700};
|
||||
equipment[] = {{"ItemGPS", 0.5}, {"ItemCompass", 0.3}};
|
||||
supplies[] = {{"FirstAidKit", 0.2}, {"Medikit", 0.1}};
|
||||
weapons[] = {{"arifle_MX_F", 0.3}, {"arifle_Katiba_F", 0.2}};
|
||||
vehicles[] = {{"B_MRAP_01_F", 0.1}, {"B_APC_Wheeled_01_cannon_F", 0.05}};
|
||||
special[] = {{"B_UAV_01_F", 0.05}, {"B_Heli_Light_01_F", 0.02}};
|
||||
};
|
||||
penalty[] = {-200, -75};
|
||||
timeLimit[] = {600, 900}; // 10-15 minutes
|
||||
};
|
||||
|
||||
class HVT {
|
||||
class Targets {
|
||||
officer[] = {"O_officer_F"};
|
||||
sniper[] = {"O_sniper_F"};
|
||||
};
|
||||
escorts = 4;
|
||||
class Rewards {
|
||||
money[] = {800000, 2000000};
|
||||
reputation[] = {175, 650};
|
||||
equipment[] = {{"ItemGPS", 0.5}, {"ItemCompass", 0.3}};
|
||||
supplies[] = {{"FirstAidKit", 0.2}, {"Medikit", 0.1}};
|
||||
weapons[] = {{"arifle_MX_F", 0.3}, {"arifle_Katiba_F", 0.2}};
|
||||
vehicles[] = {{"B_MRAP_01_F", 0.1}, {"B_APC_Wheeled_01_cannon_F", 0.05}};
|
||||
special[] = {{"B_UAV_01_F", 0.05}, {"B_Heli_Light_01_F", 0.02}};
|
||||
};
|
||||
penalty[] = {-175, -50};
|
||||
timeLimit[] = {900, 1800}; // 15-30 minutes
|
||||
};
|
||||
|
||||
class Defuse {
|
||||
class Devices {
|
||||
small[] = {"DemoCharge_Remote_Mag"};
|
||||
large[] = {"SatchelCharge_Remote_Mag"};
|
||||
};
|
||||
maxDevices = 3;
|
||||
class Rewards {
|
||||
money[] = {600000, 1500000};
|
||||
reputation[] = {125, 450};
|
||||
equipment[] = {{"ItemGPS", 0.5}, {"ItemCompass", 0.3}};
|
||||
supplies[] = {{"FirstAidKit", 0.2}, {"Medikit", 0.1}};
|
||||
weapons[] = {{"arifle_MX_F", 0.3}, {"arifle_Katiba_F", 0.2}};
|
||||
vehicles[] = {{"B_MRAP_01_F", 0.1}, {"B_APC_Wheeled_01_cannon_F", 0.05}};
|
||||
special[] = {{"B_UAV_01_F", 0.05}, {"B_Heli_Light_01_F", 0.02}};
|
||||
};
|
||||
penalty[] = {-125, -40};
|
||||
timeLimit[] = {600, 900}; // 10-15 minutes
|
||||
};
|
||||
|
||||
class Delivery {
|
||||
class Cargo {
|
||||
supplies[] = {"Land_CargoBox_V1_F"};
|
||||
vehicles[] = {"B_MRAP_01_F", "B_Truck_01_transport_F"};
|
||||
};
|
||||
class Rewards {
|
||||
money[] = {400000, 1200000};
|
||||
reputation[] = {75, 350};
|
||||
equipment[] = {{"ItemGPS", 0.5}, {"ItemCompass", 0.3}};
|
||||
supplies[] = {{"FirstAidKit", 0.2}, {"Medikit", 0.1}};
|
||||
weapons[] = {{"arifle_MX_F", 0.3}, {"arifle_Katiba_F", 0.2}};
|
||||
vehicles[] = {{"B_MRAP_01_F", 0.1}, {"B_APC_Wheeled_01_cannon_F", 0.05}};
|
||||
special[] = {{"B_UAV_01_F", 0.05}, {"B_Heli_Light_01_F", 0.02}};
|
||||
};
|
||||
penalty[] = {-75, -25};
|
||||
timeLimit[] = {900, 1800}; // 15-30 minutes
|
||||
};
|
||||
};
|
||||
};
|
186
addons/task/README.md
Normal file
186
addons/task/README.md
Normal file
@ -0,0 +1,186 @@
|
||||
# Forge Task Module
|
||||
|
||||
## Overview
|
||||
The Task module provides a comprehensive mission and objective system for the Forge client. It includes features for creating, managing, and tracking various types of tasks, with support for rewards, penalties, and mission completion conditions.
|
||||
|
||||
## Dependencies
|
||||
- forge_client_main
|
||||
|
||||
## Authors
|
||||
- J. Schmidt
|
||||
- Creedcoder
|
||||
- IDSolutions
|
||||
|
||||
## Features
|
||||
|
||||
### Task Types
|
||||
1. **Attack Tasks** (`fnc_attack.sqf`)
|
||||
- Eliminate specific targets
|
||||
- Time-based objectives
|
||||
- Target escape prevention
|
||||
- Success/failure conditions
|
||||
- Reward system integration
|
||||
|
||||
2. **Defend Tasks** (`fnc_defend.sqf`)
|
||||
- Hold designated zones
|
||||
- Wave-based enemy attacks
|
||||
- Minimum force requirements
|
||||
- Time-based objectives
|
||||
- Zone control monitoring
|
||||
|
||||
3. **Hostage Tasks** (`fnc_hostage.sqf`)
|
||||
- Rescue hostages
|
||||
- Extraction zone management
|
||||
- Hostage protection
|
||||
- Time-based objectives
|
||||
- CBRN zone support
|
||||
|
||||
4. **HVT Tasks** (`fnc_hvt.sqf`)
|
||||
- Capture or eliminate HVTs
|
||||
- Extraction requirements
|
||||
- Target tracking
|
||||
- Success/failure conditions
|
||||
- Reward system integration
|
||||
|
||||
5. **Defuse Tasks** (`fnc_defuse.sqf`)
|
||||
- Defuse explosive devices
|
||||
- Time-based objectives
|
||||
- Success/failure conditions
|
||||
- Reward system integration
|
||||
- Explosive entity management
|
||||
|
||||
6. **Delivery Tasks** (`fnc_delivery.sqf`)
|
||||
- Transport objectives
|
||||
- Route management
|
||||
- Time-based delivery
|
||||
- Success/failure conditions
|
||||
- Reward system integration
|
||||
|
||||
### Task Management
|
||||
1. **Task Configuration**
|
||||
- Unique task IDs
|
||||
- Success/failure limits
|
||||
- Time limits
|
||||
- Reward settings
|
||||
- Mission end conditions
|
||||
|
||||
2. **Reward System** (`fnc_handleTaskRewards.sqf`)
|
||||
- Company funds
|
||||
- Reputation points
|
||||
- Equipment rewards
|
||||
- Supply rewards
|
||||
- Weapon rewards
|
||||
- Vehicle rewards
|
||||
- Special rewards
|
||||
|
||||
3. **Task Tracking**
|
||||
- Progress monitoring
|
||||
- State management
|
||||
- Objective tracking
|
||||
- Time tracking
|
||||
- Success/failure detection
|
||||
|
||||
### Module System
|
||||
1. **Attack Module** (`fnc_attackModule.sqf`)
|
||||
- Target configuration
|
||||
- Success/failure settings
|
||||
- Reward configuration
|
||||
- Time limit settings
|
||||
- Mission end conditions
|
||||
|
||||
2. **Defend Module** (`fnc_defendModule.sqf`)
|
||||
- Zone configuration
|
||||
- Wave settings
|
||||
- Force requirements
|
||||
- Reward configuration
|
||||
- Mission end conditions
|
||||
|
||||
3. **Hostage Module** (`fnc_hostageModule.sqf`)
|
||||
- Hostage configuration
|
||||
- Extraction settings
|
||||
- Time limit settings
|
||||
- Reward configuration
|
||||
- Mission end conditions
|
||||
|
||||
4. **HVT Module** (`fnc_hvtModule.sqf`)
|
||||
- Target configuration
|
||||
- Extraction settings
|
||||
- Success/failure settings
|
||||
- Reward configuration
|
||||
- Mission end conditions
|
||||
|
||||
5. **Defuse Module** (`fnc_defuseModule.sqf`)
|
||||
- Explosive configuration
|
||||
- Time limit settings
|
||||
- Success/failure settings
|
||||
- Reward configuration
|
||||
- Mission end conditions
|
||||
|
||||
## Event Handlers
|
||||
The module uses several event handlers for initialization and execution:
|
||||
- `XEH_preInit.sqf`: Pre-initialization setup
|
||||
- `XEH_postInit.sqf`: Post-initialization tasks
|
||||
- `XEH_preStart.sqf`: Pre-start configuration
|
||||
|
||||
## Usage
|
||||
To use the task module:
|
||||
```sqf
|
||||
// Create an attack task
|
||||
["task_attack_1", 1, 2, 1500000, -75, 375, false, false] spawn forge_client_task_fnc_attack;
|
||||
|
||||
// Create a defend task
|
||||
["task_defend_1", "defend_marker", 900, 500000, -100, 400, false, false, 3, 300, 1] spawn forge_client_task_fnc_defend;
|
||||
|
||||
// Create a hostage task
|
||||
["task_hostage_1", 1, 2, "extract_marker", 1500000, -75, 500, [false, true], false, false] spawn forge_client_task_fnc_hostage;
|
||||
|
||||
// Create an HVT task
|
||||
["task_hvt_1", 1, 2, "extract_marker", 1500000, -75, 500, false, false] spawn forge_client_task_fnc_hvt;
|
||||
```
|
||||
|
||||
## Integration
|
||||
The task module integrates with other Forge client systems:
|
||||
1. **Organization System**
|
||||
- Fund management
|
||||
- Reputation tracking
|
||||
- Asset rewards
|
||||
- Transaction processing
|
||||
- Balance updates
|
||||
|
||||
2. **Notification System**
|
||||
- Task assignments
|
||||
- Progress updates
|
||||
- Success/failure alerts
|
||||
- Reward notifications
|
||||
- Mission end notifications
|
||||
|
||||
3. **Mission System**
|
||||
- Mission success/failure
|
||||
- End conditions
|
||||
- State management
|
||||
- Progress tracking
|
||||
- Objective management
|
||||
|
||||
## Debugging
|
||||
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
|
||||
```cpp
|
||||
#define DEBUG_MODE_FULL
|
||||
```
|
||||
|
||||
## Version Information
|
||||
Version information is managed through the main Forge client system configuration.
|
||||
|
||||
## Technical Details
|
||||
- Real-time task monitoring
|
||||
- Multi-objective support
|
||||
- Reward system integration
|
||||
- State management
|
||||
- Progress tracking
|
||||
- Time management
|
||||
- Cross-module integration
|
||||
- Event system integration
|
||||
- Notification handling
|
||||
- Error management
|
||||
- Resource management
|
||||
- Mission control
|
||||
- Objective validation
|
@ -1,22 +1,30 @@
|
||||
PREP(attack);
|
||||
PREP(attackModule);
|
||||
PREP(defend);
|
||||
PREP(defendModule);
|
||||
PREP(defuse);
|
||||
PREP(defuseModule);
|
||||
PREP(delivery);
|
||||
PREP(deliveryModule);
|
||||
PREP(destroy);
|
||||
PREP(destroyModule);
|
||||
PREP(explosivesModule);
|
||||
PREP(handler);
|
||||
PREP(handleTaskRewards);
|
||||
PREP(heartBeat);
|
||||
PREP(hostage);
|
||||
PREP(hostageModule);
|
||||
PREP(hostagesModule);
|
||||
PREP(hvt);
|
||||
PREP(hvtModule);
|
||||
PREP(makeCargo);
|
||||
PREP(makeHostage);
|
||||
PREP(makeHVT);
|
||||
PREP(makeIED);
|
||||
PREP(makeObject);
|
||||
PREP(makeShooter);
|
||||
PREP(makeTarget);
|
||||
PREP(missionManager);
|
||||
PREP(protectedModule);
|
||||
PREP(shootersModule);
|
||||
PREP(spawnEnemyWave);
|
@ -2,6 +2,9 @@
|
||||
|
||||
GVAR(defusedCount) = 0;
|
||||
|
||||
// TODO: Implement mission manager
|
||||
// if (isServer) then { [] call FUNC(missionManager); };
|
||||
|
||||
["ace_explosives_defuse", {
|
||||
GVAR(defusedCount) = GVAR(defusedCount) + 1;
|
||||
}] call CFUNC(addEventHandler);
|
@ -5,6 +5,7 @@ PREP_RECOMPILE_START;
|
||||
#include "XEH_PREP.hpp"
|
||||
PREP_RECOMPILE_END;
|
||||
|
||||
GVAR(allCargo) = [];
|
||||
GVAR(allHostages) = [];
|
||||
GVAR(allHVTs) = [];
|
||||
GVAR(allIEDs) = [];
|
||||
|
@ -16,3 +16,4 @@ class CfgPatches {
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgFactionClasses.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgMissions.hpp"
|
@ -13,7 +13,12 @@
|
||||
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
||||
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 8: Amount of time before target(s) escape <NUMBER> (default: nil)
|
||||
* 8: Amount of time before target(s) escape <NUMBER> (default: -1)
|
||||
* 9: Equipment rewards <ARRAY> (default: [])
|
||||
* 10: Supply rewards <ARRAY> (default: [])
|
||||
* 11: Weapon rewards <ARRAY> (default: [])
|
||||
* 12: Vehicle rewards <ARRAY> (default: [])
|
||||
* 13: Special rewards <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -25,7 +30,22 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false], "_time"];
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_limitFail", -1, [0]],
|
||||
["_limitSuccess", -1, [0]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_time", -1, [0]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
|
||||
private _result = 0;
|
||||
|
||||
@ -43,7 +63,7 @@ waitUntil {
|
||||
|
||||
private _targetsKilled = ({ !alive _x } count _targets);
|
||||
|
||||
if (!isNil "_time") then {
|
||||
if (_time isNotEqualTo -1) then {
|
||||
private _timeExpired = (floor time - _startTime >= _time);
|
||||
|
||||
if (_targetsKilled < _limitSuccess && _timeExpired) then { _result = 1; };
|
||||
@ -59,35 +79,39 @@ if (_result == 1) then {
|
||||
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
|
||||
sleep 1;
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _targets;
|
||||
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
|
||||
sleep 1;
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
};
|
129
addons/task/functions/fnc_defend.sqf
Normal file
129
addons/task/functions/fnc_defend.sqf
Normal file
@ -0,0 +1,129 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Registers a defend task where players must hold a zone marked by a marker
|
||||
*
|
||||
* Arguments:
|
||||
* 0: ID of the task <STRING>
|
||||
* 1: Defense zone marker name <STRING>
|
||||
* 2: Time to defend in seconds <NUMBER>
|
||||
* 3: Amount of funds the company receives if the task is successful <NUMBER> (default: 0)
|
||||
* 4: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
||||
* 5: Amount of rating the company and player receive if the task is successful <NUMBER> (default: 0)
|
||||
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 8: Enemy wave count <NUMBER> (default: 3)
|
||||
* 9: Time between waves in seconds <NUMBER> (default: 300)
|
||||
* 10: Minimum BLUFOR units required in zone <NUMBER> (default: 1)
|
||||
* 11: Equipment rewards <ARRAY> (default: [])
|
||||
* 12: Supply rewards <ARRAY> (default: [])
|
||||
* 13: Weapon rewards <ARRAY> (default: [])
|
||||
* 14: Vehicle rewards <ARRAY> (default: [])
|
||||
* 15: Special rewards <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["defend_zone_1", "defend_marker", 900, 500000, -100, 400, false, false, 3, 300, 1, ["ItemGPS"], ["FirstAidKit"], ["arifle_MX_F"], ["B_MRAP_01_F"], ["B_UAV_01_F"]] spawn forge_client_task_fnc_defend;
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_defenseZone", "", [""]],
|
||||
["_defendTime", 600, [0]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_waveCount", 3, [0]],
|
||||
["_waveCooldown", 300, [0]],
|
||||
["_minBlufor", 1, [0]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
|
||||
if (_defenseZone == "" || !(markerShape _defenseZone in ["RECTANGLE", "ELLIPSE"])) exitWith { diag_log format ["ERROR: Invalid defense zone marker: %1", _defenseZone]; };
|
||||
|
||||
private _result = 0;
|
||||
private _startTime = time;
|
||||
private _nextWaveTime = _startTime;
|
||||
private _currentWave = 0;
|
||||
private _zoneEmptyCounter = 0;
|
||||
private _warningIssued = false;
|
||||
|
||||
waitUntil {
|
||||
sleep 1;
|
||||
private _bluforInZone = count (allUnits select { _x isKindOf "CAManBase" && { side _x == west } && { alive _x }} inAreaArray _defenseZone);
|
||||
private _timeElapsed = time - _startTime;
|
||||
|
||||
if (_bluforInZone < _minBlufor) then {
|
||||
_zoneEmptyCounter = _zoneEmptyCounter + 1;
|
||||
|
||||
if (_zoneEmptyCounter == 15 && !_warningIssued) then {
|
||||
["Warning", ["Defense Zone Empty!", "Return to the defense zone immediately!"]] remoteExec ["BIS_fnc_showNotification", 0];
|
||||
_warningIssued = true;
|
||||
};
|
||||
} else {
|
||||
_zoneEmptyCounter = 0;
|
||||
_warningIssued = false;
|
||||
};
|
||||
|
||||
if (_currentWave < _waveCount && time >= _nextWaveTime) then {
|
||||
[_defenseZone, _taskID, _currentWave] call FUNC(spawnEnemyWave);
|
||||
|
||||
_currentWave = _currentWave + 1;
|
||||
_nextWaveTime = time + _waveCooldown;
|
||||
|
||||
["IncomingQRF", ["Enemy forces approaching!", format ["Wave %1 of %2", _currentWave, _waveCount]]] remoteExec ["BIS_fnc_showNotification", 0];
|
||||
};
|
||||
|
||||
if (_zoneEmptyCounter >= 30) then { _result = 1; };
|
||||
|
||||
(_result == 1) or ((_bluforInZone >= _minBlufor) && (_timeElapsed >= _defendTime) && (_currentWave >= _waveCount));
|
||||
};
|
||||
|
||||
if (_result == 1) then {
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
} else {
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
};
|
60
addons/task/functions/fnc_defendModule.sqf
Normal file
60
addons/task/functions/fnc_defendModule.sqf
Normal file
@ -0,0 +1,60 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Creates a defend task module
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call forge_client_task_fnc_defendModule;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
// Module category
|
||||
private _category = "Forge Tasks";
|
||||
private _subCategory = "Defense Tasks";
|
||||
|
||||
// Create the module
|
||||
private _module = createDialog "RscDisplayAttributes";
|
||||
_module setVariable ["category", _category];
|
||||
_module setVariable ["subcategory", _subCategory];
|
||||
_module setVariable ["description", "Configure a defend task"];
|
||||
|
||||
// Add fields for task configuration
|
||||
[_module, "Task ID", "taskID", "", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Defense Zone Marker", "defenseZone", "", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Defense Time (seconds)", "defendTime", "600", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Min BLUFOR in Zone", "minBlufor", "1", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Company Funds Reward", "companyFunds", "500000", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Rating Loss on Fail", "ratingFail", "-100", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Rating Gain on Success", "ratingSuccess", "400", true] call BIS_fnc_addAttribute;
|
||||
[_module, "End Mission on Success", "endSuccess", "false", false] call BIS_fnc_addAttribute;
|
||||
[_module, "End Mission on Fail", "endFail", "false", false] call BIS_fnc_addAttribute;
|
||||
[_module, "Enemy Wave Count", "waveCount", "3", false] call BIS_fnc_addAttribute;
|
||||
[_module, "Time Between Waves (seconds)", "waveCooldown", "300", false] call BIS_fnc_addAttribute;
|
||||
|
||||
// Add confirm button handler
|
||||
_module setVariable ["onConfirm", {
|
||||
params ["_module"];
|
||||
private _taskID = _module getVariable ["taskID", ""];
|
||||
private _defenseZone = _module getVariable ["defenseZone", ""];
|
||||
private _defendTime = parseNumber (_module getVariable ["defendTime", "600"]);
|
||||
private _companyFunds = parseNumber (_module getVariable ["companyFunds", "500000"]);
|
||||
private _ratingFail = parseNumber (_module getVariable ["ratingFail", "-100"]);
|
||||
private _ratingSuccess = parseNumber (_module getVariable ["ratingSuccess", "400"]);
|
||||
private _endSuccess = _module getVariable ["endSuccess", "false"] == "true";
|
||||
private _endFail = _module getVariable ["endFail", "false"] == "true";
|
||||
private _waveCount = parseNumber (_module getVariable ["waveCount", "3"]);
|
||||
private _waveCooldown = parseNumber (_module getVariable ["waveCooldown", "300"]);
|
||||
private _minBlufor = parseNumber (_module getVariable ["minBlufor", "1"]);
|
||||
|
||||
// Create the task
|
||||
private _params = [_taskID, _defenseZone, _defendTime, _companyFunds, _ratingFail, _ratingSuccess, _endSuccess, _endFail, _waveCount, _waveCooldown, _minBlufor];
|
||||
["defend", _params] remoteExec ["forge_client_task_fnc_handler", 2, false];
|
||||
}];
|
@ -13,6 +13,11 @@
|
||||
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
||||
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 8: Equipment rewards <ARRAY> (default: [])
|
||||
* 9: Supply rewards <ARRAY> (default: [])
|
||||
* 10: Weapon rewards <ARRAY> (default: [])
|
||||
* 11: Vehicle rewards <ARRAY> (default: [])
|
||||
* 12: Special rewards <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -23,7 +28,21 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false]];
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_limitFail", -1, [0]],
|
||||
["_limitSuccess", -1, [0]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
|
||||
private _result = 0;
|
||||
|
||||
@ -58,38 +77,42 @@ if (_result == 1) then {
|
||||
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
|
||||
sleep 1;
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _ieds;
|
||||
{ deleteVehicle _x } forEach _entities;
|
||||
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
|
||||
sleep 1;
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
};
|
||||
|
||||
GVAR(defusedCount) = 0;
|
121
addons/task/functions/fnc_delivery.sqf
Normal file
121
addons/task/functions/fnc_delivery.sqf
Normal file
@ -0,0 +1,121 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Registers a delivery task
|
||||
*
|
||||
* Arguments:
|
||||
* 0: ID of the task <STRING>
|
||||
* 1: Amount of damaged cargo to fail the task <NUMBER>
|
||||
* 2: Amount of cargo delivered to complete the task <NUMBER>
|
||||
* 3: Marker name for the delivery zone <STRING>
|
||||
* 4: Amount of funds the company receives if the task is successful <NUMBER> (default: 0)
|
||||
* 5: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
||||
* 6: Amount of rating the company and player receive if the task is successful <NUMBER> (default: 0)
|
||||
* 7: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 8: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 9: Amount of time to complete delivery <NUMBER> (default: -1)
|
||||
* 10: Equipment rewards <ARRAY> (default: [])
|
||||
* 11: Supply rewards <ARRAY> (default: [])
|
||||
* 12: Weapon rewards <ARRAY> (default: [])
|
||||
* 13: Vehicle rewards <ARRAY> (default: [])
|
||||
* 14: Special rewards <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["delivery_1", 1, 3, "delivery_zone", 250000, -75, 300, false, false] spawn forge_client_task_fnc_delivery;
|
||||
* ["delivery_1", 1, 3, "delivery_zone", 250000, -75, 300, false, false, 900] spawn forge_client_task_fnc_delivery;
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_limitFail", -1, [0]],
|
||||
["_limitSuccess", -1, [0]],
|
||||
["_deliveryZone", "", [""]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_time", -1, [0]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
|
||||
private _result = 0;
|
||||
|
||||
waitUntil {
|
||||
sleep 1;
|
||||
_cargo = GVAR(allCargo) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||
count _cargo > 0
|
||||
};
|
||||
|
||||
private _cargo = GVAR(allCargo) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||
private _startTime = if (_time isNotEqualTo -1) then { floor(time) } else { nil };
|
||||
|
||||
waitUntil {
|
||||
sleep 1;
|
||||
|
||||
private _cargoDelivered = ({ _x inArea _deliveryZone && (damage _x) < 0.7 } count _cargo);
|
||||
private _cargoDamaged = ({ damage _x >= 0.7 } count _cargo);
|
||||
|
||||
if (_time isNotEqualTo -1) then {
|
||||
private _timeExpired = (floor time - _startTime >= _time);
|
||||
|
||||
if (_cargoDamaged >= _limitFail) then { _result = 1; };
|
||||
if (_cargoDelivered < _limitSuccess && _timeExpired) then { _result = 1; };
|
||||
|
||||
(_result == 1) or ((_cargoDelivered >= _limitSuccess) && (_cargoDamaged < _limitFail))
|
||||
} else {
|
||||
if (_cargoDamaged >= _limitFail) then { _result = 1; };
|
||||
|
||||
(_result == 1) or ((_cargoDelivered >= _limitSuccess) && (_cargoDamaged < _limitFail))
|
||||
};
|
||||
};
|
||||
|
||||
if (_result == 1) then {
|
||||
{ deleteVehicle _x } forEach _cargo;
|
||||
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _cargo;
|
||||
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
};
|
66
addons/task/functions/fnc_deliveryModule.sqf
Normal file
66
addons/task/functions/fnc_deliveryModule.sqf
Normal file
@ -0,0 +1,66 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Creates a delivery task module
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call forge_client_task_fnc_deliveryModule;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
// Module category
|
||||
private _category = "Forge Tasks";
|
||||
private _subCategory = "Delivery Tasks";
|
||||
|
||||
// Create the module
|
||||
private _module = createDialog "RscDisplayAttributes";
|
||||
_module setVariable ["category", _category];
|
||||
_module setVariable ["subcategory", _subCategory];
|
||||
_module setVariable ["description", "Configure a delivery task"];
|
||||
|
||||
// Add fields for task configuration
|
||||
[_module, "Task ID", "taskID", "", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Fail Limit", "limitFail", "1", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Success Count", "limitSuccess", "3", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Delivery Zone", "deliveryZone", "", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Company Funds Reward", "companyFunds", "250000", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Rating Loss on Fail", "ratingFail", "-75", true] call BIS_fnc_addAttribute;
|
||||
[_module, "Rating Gain on Success", "ratingSuccess", "300", true] call BIS_fnc_addAttribute;
|
||||
[_module, "End Mission on Success", "endSuccess", "false", false] call BIS_fnc_addAttribute;
|
||||
[_module, "End Mission on Fail", "endFail", "false", false] call BIS_fnc_addAttribute;
|
||||
[_module, "Time Limit (seconds)", "timeLimit", "", false] call BIS_fnc_addAttribute;
|
||||
|
||||
// Add confirm button handler
|
||||
_module setVariable ["onConfirm", {
|
||||
params ["_module"];
|
||||
|
||||
private _taskID = _module getVariable ["taskID", ""];
|
||||
private _limitFail = parseNumber (_module getVariable ["limitFail", "1"]);
|
||||
private _limitSuccess = parseNumber (_module getVariable ["limitSuccess", "3"]);
|
||||
private _deliveryZone = _module getVariable ["deliveryZone", ""];
|
||||
private _companyFunds = parseNumber (_module getVariable ["companyFunds", "250000"]);
|
||||
private _ratingFail = parseNumber (_module getVariable ["ratingFail", "-75"]);
|
||||
private _ratingSuccess = parseNumber (_module getVariable ["ratingSuccess", "300"]);
|
||||
private _endSuccess = _module getVariable ["endSuccess", "false"] == "true";
|
||||
private _endFail = _module getVariable ["endFail", "false"] == "true";
|
||||
private _timeLimit = _module getVariable ["timeLimit", ""];
|
||||
|
||||
// Convert time limit to number or nil
|
||||
private _timeLimitNum = if (_timeLimit == "") then { nil } else { parseNumber _timeLimit };
|
||||
|
||||
// Create the task
|
||||
private _params = [_taskID, _limitFail, _limitSuccess, _deliveryZone, _companyFunds, _ratingFail, _ratingSuccess, _endSuccess, _endFail];
|
||||
if (!isNil "_timeLimitNum") then {
|
||||
_params pushBack _timeLimitNum;
|
||||
};
|
||||
|
||||
["delivery", _params] remoteExec ["forge_client_task_fnc_handler", 2, false];
|
||||
}];
|
@ -13,7 +13,12 @@
|
||||
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
||||
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 8: Amount of time before target(s) escape <NUMBER> (default: nil)
|
||||
* 8: Amount of time before target(s) escape <NUMBER> (default: -1)
|
||||
* 9: Equipment rewards <ARRAY> (default: [])
|
||||
* 10: Supply rewards <ARRAY> (default: [])
|
||||
* 11: Weapon rewards <ARRAY> (default: [])
|
||||
* 12: Vehicle rewards <ARRAY> (default: [])
|
||||
* 13: Special rewards <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -25,7 +30,22 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false], "_time"];
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_limitFail", -1, [0]],
|
||||
["_limitSuccess", -1, [0]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_time", -1, [0]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
|
||||
private _result = 0;
|
||||
|
||||
@ -57,37 +77,39 @@ waitUntil {
|
||||
if (_result == 1) then {
|
||||
{ deleteVehicle _x } forEach _targets;
|
||||
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
sleep 1;
|
||||
|
||||
sleep 1;
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _targets;
|
||||
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
|
||||
sleep 1;
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
};
|
118
addons/task/functions/fnc_handleTaskRewards.sqf
Normal file
118
addons/task/functions/fnc_handleTaskRewards.sqf
Normal file
@ -0,0 +1,118 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Handles task completion rewards for organizations
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Task ID <STRING>
|
||||
* 1: Reward Data <HASHMAP>
|
||||
* - funds: Amount of money to award <NUMBER>
|
||||
* - reputation: Amount of reputation to award <NUMBER>
|
||||
* - equipment: Array of equipment classnames to award <ARRAY>
|
||||
* - supplies: Array of supply classnames to award <ARRAY>
|
||||
* - weapons: Array of weapon classnames to award <ARRAY>
|
||||
* - vehicles: Array of vehicle classnames to award <ARRAY>
|
||||
* - special: Array of special item classnames to award <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* Success <BOOLEAN>
|
||||
*
|
||||
* Example:
|
||||
* private _rewards = createHashMapFromArray [
|
||||
* ["funds", 10000],
|
||||
* ["reputation", 50],
|
||||
* ["equipment", ["ItemGPS", "ItemCompass"]],
|
||||
* ["supplies", ["FirstAidKit", "Medikit"]],
|
||||
* ["weapons", ["arifle_MX_F"]],
|
||||
* ["vehicles", ["B_MRAP_01_F"]],
|
||||
* ["special", ["B_UAV_01_F"]]
|
||||
* ];
|
||||
* ["task_1", _rewards] call forge_client_task_fnc_handleTaskRewards;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params [["_taskID", ""], ["_rewards", createHashMap]];
|
||||
|
||||
if (_taskID == "") exitWith {
|
||||
diag_log "ERROR: No task ID provided for rewards";
|
||||
false
|
||||
};
|
||||
|
||||
private _store = call EFUNC(org,verifyOrgStore);
|
||||
if (isNil "_store") exitWith {
|
||||
["No organization found to receive rewards", "error", 5, "right"] call EFUNC(misc,notify);
|
||||
false
|
||||
};
|
||||
|
||||
private _success = true;
|
||||
private _funds = _rewards getOrDefault ["funds", 0];
|
||||
if (_funds > 0) then {
|
||||
if !([_funds] call EFUNC(org,addFunds)) then {
|
||||
diag_log format ["Failed to award funds %1 for task %2", _funds, _taskID];
|
||||
_success = false;
|
||||
};
|
||||
};
|
||||
|
||||
private _reputation = _rewards getOrDefault ["reputation", 0];
|
||||
if (_reputation > 0) then {
|
||||
if !([_reputation] call EFUNC(org,addReputation)) then {
|
||||
diag_log format ["Failed to award reputation %1 for task %2", _reputation, _taskID];
|
||||
_success = false;
|
||||
};
|
||||
};
|
||||
|
||||
private _fnc_addAssets = {
|
||||
params ["_type", "_items"];
|
||||
{
|
||||
private _properties = createHashMap;
|
||||
_properties set ["source", format ["Task Reward: %1", _taskID]];
|
||||
_properties set ["acquired", call EFUNC(misc,getSystemTime)];
|
||||
|
||||
if !([_type, _x, _properties] call EFUNC(org,addAsset)) then {
|
||||
diag_log format ["Failed to award %1 asset %2 for task %3", _type, _x, _taskID];
|
||||
_success = false;
|
||||
};
|
||||
} forEach _items;
|
||||
};
|
||||
|
||||
private _equipment = _rewards getOrDefault ["equipment", []];
|
||||
if (count _equipment > 0) then {
|
||||
["equipment", _equipment] call _fnc_addAssets;
|
||||
};
|
||||
|
||||
private _supplies = _rewards getOrDefault ["supplies", []];
|
||||
if (count _supplies > 0) then {
|
||||
["supply", _supplies] call _fnc_addAssets;
|
||||
};
|
||||
|
||||
private _weapons = _rewards getOrDefault ["weapons", []];
|
||||
if (count _weapons > 0) then {
|
||||
["weapon", _weapons] call _fnc_addAssets;
|
||||
};
|
||||
|
||||
private _vehicles = _rewards getOrDefault ["vehicles", []];
|
||||
if (count _vehicles > 0) then {
|
||||
["vehicle", _vehicles] call _fnc_addAssets;
|
||||
};
|
||||
|
||||
private _special = _rewards getOrDefault ["special", []];
|
||||
if (count _special > 0) then {
|
||||
["special", _special] call _fnc_addAssets;
|
||||
};
|
||||
|
||||
if (_success) then {
|
||||
private _rewardText = "Task Rewards:";
|
||||
if (_funds > 0) then { _rewardText = _rewardText + format ["\n- $%1", _funds call EFUNC(misc,formatNumber)]; };
|
||||
if (_reputation > 0) then { _rewardText = _rewardText + format ["\n- %1 Reputation", _reputation]; };
|
||||
if (count _equipment > 0) then { _rewardText = _rewardText + format ["\n- %1 Equipment Items", count _equipment]; };
|
||||
if (count _supplies > 0) then { _rewardText = _rewardText + format ["\n- %1 Supply Items", count _supplies]; };
|
||||
if (count _weapons > 0) then { _rewardText = _rewardText + format ["\n- %1 Weapons", count _weapons]; };
|
||||
if (count _vehicles > 0) then { _rewardText = _rewardText + format ["\n- %1 Vehicles", count _vehicles]; };
|
||||
if (count _special > 0) then { _rewardText = _rewardText + format ["\n- %1 Special Items", count _special]; };
|
||||
|
||||
[_rewardText, "success", 10, "right"] call EFUNC(misc,notify);
|
||||
};
|
||||
|
||||
_success
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Type of task <STRING>
|
||||
* 1: Params for task <ARRAY>
|
||||
* 1: Arguments for task <ARRAY>
|
||||
* 2: Minimum rating for task <NUMBER> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
@ -18,12 +18,13 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_taskType", "", [""]], ["_cntParams", [], [[]]], ["_minRating", 0, [0]]];
|
||||
params [["_taskType", "", [""]], ["_args", [], [[]]], ["_minRating", 0, [0]]];
|
||||
|
||||
private _thread = 0;
|
||||
|
||||
GVAR(acceptTask) = false;
|
||||
|
||||
// TODO: Use player organization rating instead of global company rating
|
||||
if (isNil "companyRating") then { companyRating = 0; };
|
||||
|
||||
private _companyRating = companyRating;
|
||||
@ -33,23 +34,31 @@ if (_companyRating < _minRating) exitWith {
|
||||
|
||||
switch (_taskType) do {
|
||||
case "attack": {
|
||||
private _thread = _cntParams spawn FUNC(attack);
|
||||
private _thread = _args spawn FUNC(attack);
|
||||
waitUntil { sleep 2; scriptDone _thread };
|
||||
};
|
||||
case "defuse": {
|
||||
private _thread = _cntParams spawn FUNC(defuse);
|
||||
private _thread = _args spawn FUNC(defuse);
|
||||
waitUntil { sleep 2; scriptDone _thread };
|
||||
};
|
||||
case "destroy": {
|
||||
private _thread = _cntParams spawn FUNC(destroy);
|
||||
private _thread = _args spawn FUNC(destroy);
|
||||
waitUntil { sleep 2; scriptDone _thread };
|
||||
};
|
||||
case "delivery": {
|
||||
private _thread = _args spawn FUNC(delivery);
|
||||
waitUntil { sleep 2; scriptDone _thread };
|
||||
};
|
||||
case "defend": {
|
||||
private _thread = _args spawn FUNC(defend);
|
||||
waitUntil { sleep 2; scriptDone _thread };
|
||||
};
|
||||
case "hostage": {
|
||||
private _thread = _cntParams spawn FUNC(hostage);
|
||||
private _thread = _args spawn FUNC(hostage);
|
||||
waitUntil { sleep 2; scriptDone _thread };
|
||||
};
|
||||
case "hvt": {
|
||||
private _thread = _cntParams spawn FUNC(hvt);
|
||||
private _thread = _args spawn FUNC(hvt);
|
||||
waitUntil { sleep 2; scriptDone _thread };
|
||||
};
|
||||
default {
|
||||
|
@ -15,8 +15,13 @@
|
||||
* 7: Subcategory of task <ARRAY> (default: [false, true])
|
||||
* 8: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 9: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 10: Amount of time before hostage(s) die <NUMBER> (default: nil)
|
||||
* 11: Marker name for the cbrn zone <STRING> (default: nil)
|
||||
* 10: Amount of time before hostage(s) die <NUMBER> (default: -1)
|
||||
* 11: Marker name for the cbrn zone <STRING> (default: "")
|
||||
* 12: Equipment rewards <ARRAY> (default: [])
|
||||
* 13: Supply rewards <ARRAY> (default: [])
|
||||
* 14: Weapon rewards <ARRAY> (default: [])
|
||||
* 15: Vehicle rewards <ARRAY> (default: [])
|
||||
* 16: Special rewards <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -29,7 +34,25 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_extZone", ""], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_type", [["_cbrn", false], ["_hostage", true]]], ["_endSuccess", false], ["_endFail", false], "_time", ["_cbrnZone", ""]];
|
||||
params [
|
||||
["_taskID", ""],
|
||||
["_limitFail", -1],
|
||||
["_limitSuccess", -1],
|
||||
["_extZone", ""],
|
||||
["_companyFunds", 0],
|
||||
["_ratingFail", 0],
|
||||
["_ratingSuccess", 0],
|
||||
["_type", [["_cbrn", false, [false]], ["_hostage", true, [false]]]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_time", -1, [0]],
|
||||
["_cbrnZone", "", [""]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
|
||||
private _cbrn = (_this select 7) select 0;
|
||||
private _hostage = (_this select 7) select 1;
|
||||
@ -49,7 +72,7 @@ waitUntil {
|
||||
|
||||
private _hostages = GVAR(allHostages) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||
private _shooters = GVAR(allShooters) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||
private _startTime = if (!isNil "_time") then { floor(time) } else { nil };
|
||||
private _startTime = if (_time isNotEqualTo -1) then { floor(time) } else { nil };
|
||||
|
||||
waitUntil {
|
||||
sleep 1;
|
||||
@ -59,7 +82,7 @@ waitUntil {
|
||||
private _hostagesKilled = ({ !alive _x } count _hostages);
|
||||
private _shootersAlive = ({ alive _x } count _shooters);
|
||||
|
||||
if (!isNil "_time") then {
|
||||
if (_time isNotEqualTo -1) then {
|
||||
private _timeExpired = (floor time - _startTime >= _time);
|
||||
|
||||
if (_hostagesFreed < _limitSuccess && _timeExpired) then { _result = 1; };
|
||||
@ -111,38 +134,40 @@ if (_result == 1) then {
|
||||
{ deleteVehicle _x } forEach _hostages;
|
||||
{ deleteVehicle _x } forEach _shooters;
|
||||
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
sleep 1;
|
||||
|
||||
sleep 1;
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _hostages;
|
||||
{ deleteVehicle _x } forEach _shooters;
|
||||
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
|
||||
sleep 1;
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
};
|
@ -15,7 +15,12 @@
|
||||
* 7: Subcategory of task <ARRAY> (default: [true, false])
|
||||
* 8: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 9: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 10: Amount of time before hvt(s) die <NUMBER> (default: nil)
|
||||
* 10: Amount of time before hvt(s) die <NUMBER> (default: -1)
|
||||
* 11: Equipment rewards <ARRAY> (default: [])
|
||||
* 12: Supply rewards <ARRAY> (default: [])
|
||||
* 13: Weapon rewards <ARRAY> (default: [])
|
||||
* 14: Vehicle rewards <ARRAY> (default: [])
|
||||
* 15: Special rewards <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -29,7 +34,24 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_extZone", ""], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_type", [["_capture", true], ["_eliminate", false]]], ["_endSuccess", false], ["_endFail", false], "_time"];
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_limitFail", -1, [0]],
|
||||
["_limitSuccess", -1, [0]],
|
||||
["_extZone", "", [""]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_type", [["_capture", true, [false]], ["_eliminate", false, [false]]]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_time", -1, [0]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
|
||||
private _capture = (_this select 7) select 0;
|
||||
private _eliminate = (_this select 7) select 1;
|
||||
@ -69,37 +91,39 @@ waitUntil {
|
||||
if (_result == 1) then {
|
||||
{ deleteVehicle _x } forEach _hvts;
|
||||
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
sleep 1;
|
||||
|
||||
sleep 1;
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _hvts;
|
||||
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task succeeded: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
|
||||
sleep 1;
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task succeeded: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
};
|
39
addons/task/functions/fnc_makeCargo.sqf
Normal file
39
addons/task/functions/fnc_makeCargo.sqf
Normal file
@ -0,0 +1,39 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Assigns cargo to a task for delivery
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object to convert to delivery cargo <OBJECT>
|
||||
* 1: Task ID to assign the cargo to <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [_cargoObject, "delivery_1"] call forge_client_task_fnc_makeCargo;
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_cargo", objNull, [objNull]], ["_taskID", "", [""]]];
|
||||
|
||||
diag_log format ["[FORGE] Make Cargo: %1", _this];
|
||||
|
||||
if (isNull _cargo) exitWith { diag_log "ERROR: Attempt to create cargo from null object"; };
|
||||
if (_taskID == "") exitWith { diag_log "ERROR: No task ID provided for cargo"; };
|
||||
|
||||
SETPVAR(_cargo,assignedTask,_taskID);
|
||||
GVAR(allCargo) pushBack _cargo;
|
||||
|
||||
_cargo addEventHandler ["Dammaged", {
|
||||
params ["_unit", "_hitSelection", "_damage", "_hitPartIndex", "_hitPoint", "_shooter", "_projectile"];
|
||||
|
||||
if (damage _unit >= 0.7) then {
|
||||
private _taskID = GETVAR(_unit,assignedTask,"");
|
||||
if (_taskID isNotEqualTo "") then {
|
||||
hint format ["Warning: Cargo severely dammaged! Task: %1", _taskID];
|
||||
};
|
||||
};
|
||||
}];
|
@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Registers an AI unit as a hvt
|
||||
* Assigns an AI unit to a task as a hvt
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The AI unit <OBJECT>
|
||||
@ -17,11 +17,14 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
|
||||
params [["_entity", objNull, [objNull, grpNull]], ["_taskID", "", [""]]];
|
||||
|
||||
if (isNull _entity) exitWith { diag_log "ERROR: Attempt to create entity from null object"; };
|
||||
if (_taskID == "") exitWith { diag_log "ERROR: No task ID provided for entity"; };
|
||||
|
||||
diag_log format ["[FORGE] Make HVT: %1", _this];
|
||||
|
||||
SETVAR(_entity,assignedTask,_taskID);
|
||||
GVAR(allHVTs) pushBackUnique _entity;
|
||||
|
||||
if (alive _entity) then {
|
||||
[_entity, "hvt"] spawn FUNC(heartBeat);
|
||||
};
|
||||
if (alive _entity) then { [_entity, "hvt"] spawn FUNC(heartBeat); };
|
@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Registers an AI unit as a hostage/POW
|
||||
* Assigns an AI unit to a task as a hostage
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The AI unit <OBJECT>
|
||||
@ -17,13 +17,14 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
|
||||
params [["_entity", objNull, [objNull, grpNull]], ["_taskID", "", [""]]];
|
||||
|
||||
if (isNull _entity) exitWith { diag_log "ERROR: Attempt to create entity from null object"; };
|
||||
if (_taskID == "") exitWith { diag_log "ERROR: No task ID provided for entity"; };
|
||||
|
||||
diag_log format ["[FORGE] Make Hostage: %1", _this];
|
||||
|
||||
SETVAR(_entity,assignedTask,_taskID);
|
||||
GVAR(allHostages) pushBackUnique _entity;
|
||||
|
||||
if (alive _entity) then {
|
||||
[_entity, "hostage"] spawn FUNC(heartBeat);
|
||||
};
|
||||
if (alive _entity) then { [_entity, "hostage"] spawn FUNC(heartBeat); };
|
@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Registers an IED and starts countdown timer
|
||||
* Assigns an IED to a task and starts countdown timer
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The object <OBJECT>
|
||||
@ -18,9 +18,15 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]], ["_time", 0, [0]]];
|
||||
params [["_entity", objNull, [objNull]], ["_taskID", "", [""]], ["_time", 0, [0]]];
|
||||
|
||||
if (isNull _entity) exitWith { diag_log "ERROR: Attempt to create entity from null object"; };
|
||||
if (_taskID == "") exitWith { diag_log "ERROR: No task ID provided for entity"; };
|
||||
if (_time < 0) exitWith { diag_log "ERROR: Invalid time provided for IED"; };
|
||||
|
||||
diag_log format ["[FORGE] Make IED: %1", _this];
|
||||
|
||||
SETVAR(_entity,assignedTask,_taskID);
|
||||
GVAR(allIEDs) pushBackUnique _entity;
|
||||
|
||||
[_entity, "ied", _time] spawn FUNC(heartBeat);
|
||||
if (alive _entity) then { [_entity, "ied", _time] spawn FUNC(heartBeat); };
|
@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Registers an object
|
||||
* Assigns an object to a task as a protected target
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The object <OBJECT>
|
||||
@ -17,7 +17,12 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
|
||||
params [["_entity", objNull, [objNull]], ["_taskID", "", [""]]];
|
||||
|
||||
SETVAR(_entity,assignedTask,_taskID);
|
||||
if (isNull _entity) exitWith { diag_log "ERROR: Attempt to create entity from null object"; };
|
||||
if (_taskID == "") exitWith { diag_log "ERROR: No task ID provided for entity"; };
|
||||
|
||||
diag_log format ["[FORGE] Make Object: %1", _this];
|
||||
|
||||
SETPVAR(_entity,assignedTask,_taskID);
|
||||
GVAR(allEntities) pushBackUnique _entity;
|
@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Registers an AI unit as a shooter
|
||||
* Assigns an AI unit to a task as a shooter
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The AI unit <OBJECT>
|
||||
@ -17,7 +17,10 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
|
||||
params [["_entity", objNull, [objNull, grpNull]], ["_taskID", "", [""]]];
|
||||
|
||||
if (isNull _entity) exitWith { diag_log "ERROR: Attempt to create entity from null object"; };
|
||||
if (_taskID == "") exitWith { diag_log "ERROR: No task ID provided for entity"; };
|
||||
|
||||
diag_log format ["[FORGE] Make Shooter: %1", _this];
|
||||
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Registers an AI unit as a target
|
||||
* Assigns an object to a task as a target
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The AI unit <OBJECT>
|
||||
* 0: The object <OBJECT>
|
||||
* 1: ID of the task <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
@ -17,7 +17,12 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
|
||||
params [["_entity", objNull, [objNull, grpNull]], ["_taskID", "", [""]]];
|
||||
|
||||
if (isNull _entity) exitWith { diag_log "ERROR: Attempt to create entity from null object"; };
|
||||
if (_taskID == "") exitWith { diag_log "ERROR: No task ID provided for entity"; };
|
||||
|
||||
diag_log format ["[FORGE] Make Target: %1", _this];
|
||||
|
||||
SETVAR(_entity,assignedTask,_taskID);
|
||||
GVAR(allTargets) pushBackUnique _entity;
|
212
addons/task/functions/fnc_missionManager.sqf
Normal file
212
addons/task/functions/fnc_missionManager.sqf
Normal file
@ -0,0 +1,212 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Manages the dynamic mission system
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call forge_client_task_fnc_missionManager
|
||||
*/
|
||||
|
||||
// Load mission configuration
|
||||
private _missionConfig = missionConfigFile >> "CfgMissions";
|
||||
private _weightsConfig = _missionConfig >> "MissionWeights";
|
||||
private _locationsConfig = _missionConfig >> "Locations";
|
||||
private _aiGroupsConfig = _missionConfig >> "AIGroups";
|
||||
private _missionTypesConfig = _missionConfig >> "MissionTypes";
|
||||
|
||||
// Get mission weights from config
|
||||
private _missionTypes = [];
|
||||
{
|
||||
private _weight = getNumber(_weightsConfig >> configName _x);
|
||||
_missionTypes pushBack [configName _x, _weight];
|
||||
} forEach "true" configClasses _weightsConfig;
|
||||
|
||||
// Function to get a suitable location for a mission type
|
||||
private _fnc_getMissionLocation = {
|
||||
params ["_type"];
|
||||
private _suitableLocations = [];
|
||||
|
||||
{
|
||||
private _suitable = getArray(_x >> "suitable");
|
||||
if (_type in _suitable) then {
|
||||
_suitableLocations pushBack _x;
|
||||
};
|
||||
} forEach "true" configClasses _locationsConfig;
|
||||
|
||||
selectRandom _suitableLocations
|
||||
};
|
||||
|
||||
// TODO: Implement a more sophisticated AI spawning system
|
||||
// Function to spawn AI group for mission
|
||||
private _fnc_spawnAIGroup = {
|
||||
params ["_type", "_pos"];
|
||||
private _suitableGroups = [];
|
||||
|
||||
{
|
||||
private _suitable = getArray(_x >> "suitable");
|
||||
if (_type in _suitable) then {
|
||||
_suitableGroups pushBack _x;
|
||||
};
|
||||
} forEach "true" configClasses _aiGroupsConfig;
|
||||
|
||||
private _groupConfig = selectRandom _suitableGroups;
|
||||
if (isNil "_groupConfig") exitWith { grpNull };
|
||||
|
||||
private _side = getText(_groupConfig >> "side");
|
||||
private _group = createGroup (call compile _side);
|
||||
|
||||
{
|
||||
private _unitClass = getText(_x >> "vehicle");
|
||||
private _unitPos = getArray(_x >> "position");
|
||||
private _unit = _group createUnit [_unitClass, _pos vectorAdd _unitPos, [], 0, "NONE"];
|
||||
_unit setRank getText(_x >> "rank");
|
||||
} forEach "true" configClasses (_groupConfig >> "Units");
|
||||
|
||||
_group
|
||||
};
|
||||
|
||||
// Generate a random mission based on weights
|
||||
private _fnc_getRandomMission = {
|
||||
private _rand = random 1;
|
||||
private _cumulative = 0;
|
||||
|
||||
{
|
||||
_x params ["_type", "_weight"];
|
||||
_cumulative = _cumulative + _weight;
|
||||
if (_rand <= _cumulative) exitWith { _type };
|
||||
} forEach _missionTypes;
|
||||
};
|
||||
|
||||
// TODO: Implement a more sophisticated mission selection algorithm
|
||||
// Generate mission parameters based on type
|
||||
private _fnc_generateMissionParams = {
|
||||
params ["_type"];
|
||||
|
||||
private _taskId = format ["task_%1_%2", _type, round(random 999999)];
|
||||
private _typeConfig = _missionTypesConfig >> (_type call CFUNC(capitalize));
|
||||
|
||||
// Get location for mission
|
||||
private _location = [_type] call _fnc_getMissionLocation;
|
||||
private _pos = getArray(_location >> "position");
|
||||
private _radius = getNumber(_location >> "radius");
|
||||
|
||||
// Generate rewards
|
||||
private _moneyRange = getArray(_typeConfig >> "Rewards" >> "money");
|
||||
private _repRange = getArray(_typeConfig >> "Rewards" >> "reputation");
|
||||
private _penaltyRange = getArray(_typeConfig >> "penalty");
|
||||
private _timeRange = getArray(_typeConfig >> "timeLimit");
|
||||
|
||||
private _reward = _moneyRange call BIS_fnc_randomNum;
|
||||
private _reputation = _repRange call BIS_fnc_randomNum;
|
||||
private _penalty = _penaltyRange call BIS_fnc_randomNum;
|
||||
private _timeLimit = _timeRange call BIS_fnc_randomNum;
|
||||
|
||||
// Generate random reward items
|
||||
private _equipmentRewards = [];
|
||||
private _supplyRewards = [];
|
||||
private _weaponRewards = [];
|
||||
private _vehicleRewards = [];
|
||||
private _specialRewards = [];
|
||||
|
||||
{
|
||||
private _category = _x;
|
||||
{
|
||||
_x params ["_item", "_chance"];
|
||||
if (random 1 < _chance) then {
|
||||
switch (_category) do {
|
||||
case "equipment": { _equipmentRewards pushBack _item };
|
||||
case "supplies": { _supplyRewards pushBack _item };
|
||||
case "weapons": { _weaponRewards pushBack _item };
|
||||
case "vehicles": { _vehicleRewards pushBack _item };
|
||||
case "special": { _specialRewards pushBack _item };
|
||||
};
|
||||
};
|
||||
} forEach (getArray(_typeConfig >> "Rewards" >> _category));
|
||||
} forEach ["equipment", "supplies", "weapons", "vehicles", "special"];
|
||||
|
||||
// TODO: Continue to refine mission types and their specific settings
|
||||
// Return parameters based on mission type
|
||||
switch (_type) do {
|
||||
case "attack": {
|
||||
private _group = [_type, _pos] call _fnc_spawnAIGroup;
|
||||
private _units = units _group;
|
||||
private _unitCount = count _units;
|
||||
[_taskId, _unitCount, _radius, _reward, _penalty, _reputation, false, false, _equipmentRewards, _supplyRewards, _weaponRewards, _vehicleRewards, _specialRewards]
|
||||
};
|
||||
case "defend": {
|
||||
private _minWaves = getNumber(_typeConfig >> "minWaves");
|
||||
private _maxWaves = getNumber(_typeConfig >> "maxWaves");
|
||||
private _waves = floor(random (_maxWaves - _minWaves + 1)) + _minWaves;
|
||||
private _waveCooldown = getNumber(_typeConfig >> "waveCooldown");
|
||||
[_taskId, _pos, _timeLimit, _reward, _penalty, _reputation, false, false, _waves, _waveCooldown, _radius, _equipmentRewards, _supplyRewards, _weaponRewards, _vehicleRewards, _specialRewards]
|
||||
};
|
||||
case "hostage": {
|
||||
private _hostages = getArray(_typeConfig >> "Hostages" >> "civilian");
|
||||
private _hostage = selectRandom _hostages;
|
||||
[_taskId, _hostage, _radius, _pos, _reward, _penalty, _reputation, [false, true], false, false, _equipmentRewards, _supplyRewards, _weaponRewards, _vehicleRewards, _specialRewards]
|
||||
};
|
||||
case "hvt": {
|
||||
private _targets = getArray(_typeConfig >> "Targets" >> "officer");
|
||||
private _target = selectRandom _targets;
|
||||
private _escorts = getNumber(_typeConfig >> "escorts");
|
||||
[_taskId, _target, _escorts, _pos, _reward, _penalty, _reputation, false, false, _equipmentRewards, _supplyRewards, _weaponRewards, _vehicleRewards, _specialRewards]
|
||||
};
|
||||
case "defuse": {
|
||||
private _devices = getArray(_typeConfig >> "Devices" >> "small");
|
||||
private _maxDevices = getNumber(_typeConfig >> "maxDevices");
|
||||
private _deviceCount = floor(random _maxDevices) + 1;
|
||||
[_taskId, _deviceCount, _timeLimit, _reward, _penalty, _reputation, false, false, _devices, _equipmentRewards, _supplyRewards, _weaponRewards, _vehicleRewards, _specialRewards]
|
||||
};
|
||||
case "delivery": {
|
||||
private _cargo = selectRandom (getArray(_typeConfig >> "Cargo" >> "supplies"));
|
||||
[_taskId, _pos, [_pos, _radius] call BIS_fnc_randomPos, _timeLimit, _reward, _penalty, _reputation, false, false, _cargo, _equipmentRewards, _supplyRewards, _weaponRewards, _vehicleRewards, _specialRewards]
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// Generate and start a random mission
|
||||
private _fnc_startRandomMission = {
|
||||
private _type = call _fnc_getRandomMission;
|
||||
private _params = [_type] call _fnc_generateMissionParams;
|
||||
|
||||
// Start the mission based on type
|
||||
switch (_type) do {
|
||||
case "attack": { _params spawn forge_client_task_fnc_attack };
|
||||
case "defend": { _params spawn forge_client_task_fnc_defend };
|
||||
case "hostage": { _params spawn forge_client_task_fnc_hostage };
|
||||
case "hvt": { _params spawn forge_client_task_fnc_hvt };
|
||||
case "defuse": { _params spawn forge_client_task_fnc_defuse };
|
||||
case "delivery": { _params spawn forge_client_task_fnc_delivery };
|
||||
};
|
||||
|
||||
// Return the task ID for tracking
|
||||
_params select 0
|
||||
};
|
||||
|
||||
// Mission queue management
|
||||
GVAR(missionQueue) = [];
|
||||
GVAR(activeMissions) = [];
|
||||
GVAR(maxConcurrentMissions) = getNumber(_missionConfig >> "maxConcurrentMissions");
|
||||
GVAR(missionInterval) = getNumber(_missionConfig >> "missionInterval");
|
||||
|
||||
// Main mission manager loop
|
||||
[{
|
||||
// Check if we can generate new missions
|
||||
if (count GVAR(activeMissions) < GVAR(maxConcurrentMissions)) then {
|
||||
private _taskId = call _fnc_startRandomMission;
|
||||
GVAR(activeMissions) pushBack _taskId;
|
||||
|
||||
// Clean up completed missions
|
||||
GVAR(activeMissions) = GVAR(activeMissions) select {
|
||||
!((missionNamespace getVariable [format ["FORGE_task_%1_completed", _x], false]) ||
|
||||
(missionNamespace getVariable [format ["FORGE_task_%1_failed", _x], false]))
|
||||
};
|
||||
};
|
||||
}, GVAR(missionInterval), []] call CFUNC(addPerFrameHandler);
|
83
addons/task/functions/fnc_spawnEnemyWave.sqf
Normal file
83
addons/task/functions/fnc_spawnEnemyWave.sqf
Normal file
@ -0,0 +1,83 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Spawns an enemy wave for a defense task
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Defense zone marker name <STRING>
|
||||
* 1: Task ID <STRING>
|
||||
* 2: Wave number (0-based) <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["defend_marker", "defend_1", 0] call forge_client_task_fnc_spawnEnemyWave;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params [["_defenseZone", "", [""]], ["_taskID", "", [""]], ["_waveNumber", 0, [0]]];
|
||||
|
||||
if (_defenseZone == "") exitWith { diag_log "ERROR: No defense zone provided for enemy wave spawn"; };
|
||||
|
||||
// TODO: Add unit types to mission config
|
||||
private _basicTypes = ["O_Soldier_F", "O_Soldier_AR_F", "O_Soldier_GL_F", "O_medic_F"];
|
||||
private _specialTypes = ["O_Soldier_LAT_F", "O_soldier_M_F", "O_Soldier_TL_F", "O_Soldier_SL_F"];
|
||||
private _eliteTypes = ["O_Soldier_HAT_F", "O_Soldier_AA_F", "O_engineer_F", "O_Sharpshooter_F"];
|
||||
|
||||
private _unitCount = 6 + (_waveNumber * 2); // TODO: Make this configurable in mission config
|
||||
private _specialChance = 0.2 + (_waveNumber * 0.1); // TODO: Make this configurable in mission config
|
||||
private _eliteChance = (_waveNumber * 0.05); // TODO: Make this configurable in mission config
|
||||
|
||||
private _center = getMarkerPos _defenseZone;
|
||||
private _radius = (getMarkerSize _defenseZone select 0) max (getMarkerSize _defenseZone select 1);
|
||||
private _spawnRadius = _radius + 150;
|
||||
private _spawnPositions = [];
|
||||
|
||||
for "_i" from 0 to 3 do {
|
||||
private _angle = _i * 90;
|
||||
private _variance = 45;
|
||||
private _spawnAngle = _angle + (random (_variance * 2) - _variance);
|
||||
private _spawnDist = _spawnRadius + (random 50 - 25);
|
||||
|
||||
private _spawnX = (_center select 0) + (_spawnDist * cos _spawnAngle);
|
||||
private _spawnY = (_center select 1) + (_spawnDist * sin _spawnAngle);
|
||||
private _spawnPos = [_spawnX, _spawnY, 0];
|
||||
|
||||
private _safePos = _spawnPos findEmptyPosition [0, 50, "O_Soldier_F"];
|
||||
if (count _safePos > 0) then {
|
||||
_spawnPositions pushBack _safePos;
|
||||
};
|
||||
};
|
||||
|
||||
private _groups = [];
|
||||
{
|
||||
private _groupSize = ceil(_unitCount / (count _spawnPositions));
|
||||
private _group = createGroup east;
|
||||
_groups pushBack _group;
|
||||
|
||||
for "_i" from 1 to _groupSize do {
|
||||
private _unitType = _basicTypes select (floor random count _basicTypes);
|
||||
private _roll = random 1;
|
||||
|
||||
if (_roll < _eliteChance) then {
|
||||
_unitType = _eliteTypes select (floor random count _eliteTypes);
|
||||
} else {
|
||||
if (_roll < _specialChance) then {
|
||||
_unitType = _specialTypes select (floor random count _specialTypes);
|
||||
};
|
||||
};
|
||||
|
||||
private _unit = _group createUnit [_unitType, _x, [], 0, "NONE"];
|
||||
_unit setVariable ["assignedTask", _taskID, true];
|
||||
_unit setBehaviour "AWARE";
|
||||
_unit setSpeedMode "NORMAL";
|
||||
_unit enableDynamicSimulation true;
|
||||
};
|
||||
|
||||
[_group, _center, _radius * 0.75] call CBA_fnc_taskDefend;
|
||||
} forEach _spawnPositions;
|
||||
|
||||
diag_log format ["Spawned defense wave %1 for task %2 with %3 units", _waveNumber + 1, _taskID, _unitCount];
|
Loading…
x
Reference in New Issue
Block a user