OCAP icon indicating copy to clipboard operation
OCAP copied to clipboard

Custom Score/Ticket Counter

Open fank opened this issue 4 years ago • 3 comments

In OPT we are playing some kind of capture the flag system with points, i would like to show the progress like we have in our ingame UI:

image

fank avatar Jul 14 '21 10:07 fank

I think we should handle this as some kind of custom event. #7

  • CounterIncrease, side, number
  • CounterDecrease, side, number
  • CounterSet, side, number If not set initially, they are not shown.

So like WEST and EAST side exists, call CountSet, WEST, 0 and CountSet, EAST, 0. To show WEST 0:0 EAST or something

fank avatar Jul 14 '21 13:07 fank

Support for BIS_fnc_respawnTickets would be good to have. FNF uses this system (and it's native GUI element BIS_fnc_showMissionStatus) to manage points in sector control missions.

For other custom implementations, it would be good in case the above is actually used for respawn purposes -- and handled separately means the two won't undergo unintentional conflicts.

// respawn tickets
["Init", "Global"] call ocap_fnc_respawnTickets;
["Init", side] call ocap_fnc_respawnTickets;
["Init", group/player] call ocap_fnc_respawnTickets; // fetch ocap_id or group name in function
// after call, capture loop will also gather the ticket count for any of the specified items using [BIS_fnc_respawnTickets](https://community.bistudio.com/wiki/BIS_fnc_respawnTickets)

// custom counter/score
["Init", [array of participating sides], startNumber] call ocap_fnc_counterEvent;

// better for doing the math on SQF side and simply sending resulting number
["Set", side, newNumber] call ocap_fnc_counterEvent;

Web implementation would then be easier because we know from the Init event how many sides are involved.

indig0fox avatar Jul 14 '21 14:07 indig0fox

Custom counter + BIS_fnc_respawnTicket tracking implemented in pre-release 2.0 addon - web implementation needed

indig0fox avatar Oct 09 '22 20:10 indig0fox