Skip to content

Conversation

@PiG13BR
Copy link

@PiG13BR PiG13BR commented Nov 24, 2024

Q A
Bug fix? no
New feature? yes
Needs wipe? no

Description:

  • These additions manage the placed objects near sectors in editor by despawning in the game start and only spawning them when the sector activates. Of course, they will also despawn once deactivated.
  • Once the sector is activated, a function will search for buildings that are compatible to spawn static weapons (preset configuration, see example in custom.sqf). Those buildings can be put in the KPLIB_staticsConfigs.sqf file (more information in that file).
  • The placed objects have the option to not be managed by putting them in a blacklist by a function. The buildings in the blacklist will retain its attributes from the editor and will not be removed in the game start. Also, you can disable the spawning of static weapon in associated structures, this will affect only the object and not the entire class (more info in the fn_sectorObjectBlacklist.sqf file).

UPDATE 2025/04/09

  • More focus on objects itself. Now it works more like a whitelist. You can add objects in the sector and register it to spawn it when the sector activates.
  • For static weapons, you have to register the building to accept static weapon. The classname of this structure must be on KPLIB_staticsConfigs.sqf file.
  • No blacklist. If you don't register the object that you've added, it will act like a normal one in the map: it will stay there (no despawning nor spawning).
  • To register a structure in the map, you must put in its init this line: [this] call KPLIB_fnc_registerSectorObject
  • Only objects close enough to sectors will be registered (KPLIB_objectsGrabber_radius). If the object isn't near any sectors, it will not be registered, and it will be deleted from the map.
  • Objects classnames under KPLIB_staticsConfigs.sqf have an option to disable static weapons from spawning it. Example:
    [this, false] call KPLIB_fnc_registerSectorObject
  • The registered object can be deleted or not in the beginning of the mission. In this case, a different variable will manage those objects. This is crucial to be able to spawn static weapon in those buildings once the sectors activates. Example:
    [this, true, false] call KPLIB_fnc_registerSectorObject
  • For default, map objects classnames that matches those in KPLIB_staticsConfigs.sqf will NOT spawn any static weapon. In theory, you can call the function in those map structures by getting the object data type by using Game Logic and the command nearObjects/nearObject.

Content:

  • fn_registerSectorObjects.sqf (DELETED)
  • fn_sectorObjectBlacklist.sqf (DELETED)
  • fn_registerSectorObject.sqf (New file - UPDATED 2025/04/09)
  • fn_createSectorObjects.sqf (UPDATED 2025/04/09)
  • fn_createStaticWeapons.sqf (UPDATED 2025/04/09)
  • fn_spawnStaticWeapon.sqf (UPDATED 2025/04/09)
  • KPLIB_staticsConfigs.sqf (New file)
  • Edited CfgFunctions.hpp (New functions)
  • Edited manage_one_sector.sqf (call the new functions and management the spawned objects)
  • New variables in all presets (community colaboration)
  • Updated maps (community colaboration)

Successfully tested on:

  • Local MP
  • Dedicated MP

@KiwiTwitches
Copy link

I'd love to see this added in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants