Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added options for conversion from game turns to real-time and commands for manipulation of timers. #1163

Merged
merged 29 commits into from Oct 27, 2021

Conversation

AdamPlenty
Copy link
Contributor

@AdamPlenty AdamPlenty commented Oct 20, 2021

BONUS_LEVEL_TIME now has an optional parameter for whether to display a real time.

New commands:

DISPLAY_TIMER([player], [timer], [real])
DISPLAY_COUNTDOWN([player], [timer], [turns], [real])
ADD_TO_TIMER([player], [timer], [turns]) - you can use a negative value to deduct time
DISPLAY_VARIABLE([player], [variable], [target], [target_type])
ADD_BONUS_TIME([turns]) - you can use a negative value to deduct time

You can also query the remaining bonus time directly with the BONUS_TIME variable.

EDIT by @Loobinex :
HIDE_TIMER - Hides the DISPLAY_TIMER
HIDE_VARIABLE - Hides the DISPLAY_VARIABLE

DISPLAY_TIMER([player], [timer], [limit], [real])

For use with a level script timer, as opposed to the bonus timer.
@AdamPlenty AdamPlenty marked this pull request as draft October 21, 2021 02:14
ADD_TO_TIMER([player],[timer],[turns])
ADD_BONUS_TIME([turns])
Hopefully, this'll negate the need to use a script timer.
@AdamPlenty AdamPlenty changed the title Added optional parameter to BONUS_LEVEL_TIME for converting to real time Added options for conversion from game turns to real-time and commands for manipulation of timers. Oct 21, 2021
@AdamPlenty AdamPlenty marked this pull request as ready for review October 21, 2021 04:30
src/engine_redraw.h Outdated Show resolved Hide resolved
src/lvl_script.c Outdated Show resolved Hide resolved
src/engine_redraw.h Outdated Show resolved Hide resolved
src/lvl_script.c Outdated Show resolved Hide resolved
@Loobinex
Copy link
Member

Would it be possible to give DISPLAY_VARIABLE an optional [target] param like DISPLAY_TIMER has?

Positive number for an upward target, negative number for a downward target.
@AdamPlenty
Copy link
Contributor Author

AdamPlenty commented Oct 25, 2021

Would it be possible to give DISPLAY_VARIABLE an optional [target] param like DISPLAY_TIMER has?

I've done upward and downward targets, but I'm not sure if it's possible to have an absolute target.

Edit: Actually, it might be possible......

0 is upward.
1 is downward.
2 is absolute.
@SimLV
Copy link
Contributor

SimLV commented Oct 26, 2021

GF2_PERSISTENT means ALL persistent flags. But they are persistent in different meaning.
It is persistent between different maps in one session (i.e. for something like latency graph)
But game_flags2 are not saved into savefile so you have to keep your timer somewhere else.

@Loobinex Loobinex merged commit 70e26d5 into dkfans:master Oct 27, 2021
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.

None yet

3 participants