PDA

View Full Version : [COD2] Waypoints



snoopdoge90
13th April 2020, 11:43
Hi, I'm finishing up my mod and I had two little questions about the only part of it I don't understand the working mechanism. It's about waypoints.

1) Are there any limits on waypoint usage? In another example, there can only be 16 objectives on the mini map.
2) What does the archived property of a waypoint do? The scripting reference only mentions methods, not properties.

Thank you.

voron00
14th April 2020, 12:04
If you mean setWaypoint() function for a HUD-element then the limit is 32: https://github.com/voron00/libcod/blob/master/declarations.hpp#L883

An .archived=true field makes HUD-element to be stored in archived frames and it will be available durning killcam and spectator.

snoopdoge90
15th April 2020, 00:13
Thank you Voron for your effort to provide an definitive answer. Guess I was too lazy, I spawned up to 20 harcoded waypoints without a problem. Should have done more before asking here :p. Anyway I did some additional testing.

So like Voron said, you can spawn up to 32 HUD elements on the screen at the same time. Note that a few of this 32 total are used by the game itself. I don't think menu scripts are a part of this, as you can draw an additional 29 elements on the screen in DM. The game clock definitely takes up 1 of the 32 available HUD elements. Let's say there are a few unrendered elements left, like the respawn text, and consider other gametypes that uses additional HUD elements. A total of 20 free to use HUD elements would be a safe bet. Unlike objectives, the game doesn't crash if you try to draw more than 32 HUD elements on the screen. It rather just show 32 simultaneous elements and queues the excess elements. These excess elements will be shown if one or more of the visible HUD elements gets destroyed. However, you can't rely on this mechanism. It does behave like a queue most of the time, but sometimes a visible element will just disappear for an new excess element to be shown. Also critical game elements (like objectives) will also be queued in some scenarios if you draw too much elements on the screen.