Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2011-01-13 16:50:31

lunarrush
Member
Registered: 2010-05-13
Posts: 278

Hud bug

Hello everyone,
I have recently written a lightweight hud for a mod I'm designing.  I've set it up to show the date and time on the user's system, however I ran into a problem.  I have posted my code below:

// -----------------------------------------------------
// hud.inc
// This is a hud script for Open Surge
// Made to provide a lightweight hud
// Originally designed for: Open Surge Lunar Mod
// Version 1.0
// Author: lunarrush
// -----------------------------------------------------
object ".lunar_startup.hud"
{
requires 0.2.0
detach_from_camera
always_active
state "main"
{
hide
set_animation "BLACK_B" 0
let "$zindex = infinity()"
let "$hour = date_hour()"
let "$minutes = date_min()"
let "$month = date_mon()+1"
let "$day = date_mday()"
let "$lives = lives()"
let "$rings = collectibles()"
set_absolute_position 5 5
set_zindex "$zindex"
textout "hud" 0 0 "<color=6d7dec>Time:</color>"
textout "hud" 0 10 "<color=6d7dec>Date:</color>"
textout "hud" 0 20 "<color=6d7dec>Rings:</color>"
textout "hud" 0 30 "<color=6d7dec>Lives:</color>"
textout "hud" 60 0 "$hour"
textout "hud" 76 0 ":"
textout "hud" 80 0 "$minutes"
textout "hud" 60 10 "$month"
textout "hud" 74 10 "/"
textout "hud" 80 10 "$day"
textout "hud" 60 20 "$rings"
textout "hud" 60 30 "$lives"
}
}

As you can see, I have it call the month, day, hour, and minute; but when I start the game all of them display the seconds after the minute.  I have two screenshots that were taken seconds apart posted here: https://sites.google.com/site/thereallunarrush/sc
s000.png
Screenshot 1: Taken 24 seconds into the minute.
s001.png
Screenshot 2: Taken 27 seconds into the minute.
Does anyone know why I've run into this problem?  If so, please post so that I can fix this bug.


If I knew then what I know now I'd tell you that the story's true.  Cause whatever you do, it comes back to you.  -Slaughter, Burning Bridges

Offline

#2 2011-01-13 21:28:46

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Hud bug

... hmm

sorry, it was my mistake, really. The calendar functions are not returning what they should. I'll fix it asap.

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org