CustomStatus #1543
Replies: 4 comments 3 replies
-
Are you using a custom status bar, or are you wanting to use a Custom Status Pane for this? EDIT To update the text in the custom status pane, I'm pretty sure you'd have to call So, if that is the only thing you are putting in that custom status pane, you could add a changed script to game.changedDateTime => {
JS.setCustomStatus("CLOCK: " + game.DateTime)
} If you are wanting a pane, the easiest thing would be adding a "DateTime" status attribute to the Note: if using game.clock rather than game.DateTime, name that status attribute 'clock'. It has to match the actual attribute name. That would add the pane and automatically update it. |
Beta Was this translation helpful? Give feedback.
-
This might be closer to what you want. (This actually uses ClockLib.) Note That "3th of February" text comes from that library, not me. 😇 <!--Saved by Quest 5.9.9166.36226-->
<asl version="580">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="ClockLib.aslx" />
<game name="Time (Is on My Side)">
<gameid>81468ce8-1982-408c-ad85-602a66086e79</gameid>
<version>1.0</version>
<firstpublished>2025</firstpublished>
<feature_advancedscripts />
<unresolvedcommandhandler type="script">
SuppressTurnscripts
msg (Template("UnrecognisedCommand"))
</unresolvedcommandhandler>
<statusattributes type="stringdictionary">
<item>
<key>clock</key>
<value>Time: !</value>
</item>
<item>
<key>date</key>
<value>Date: !</value>
</item>
</statusattributes>
<changedclock type="script">
game.date = Date()
</changedclock>
<start type="script">
game_clock.startyear = 2025
SetTime ("34:14:35")
game.clock = TimeAsString()
game.date = Date()
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl> If you're wanting this in the status bar instead of a status pane, you could easily change a little code to handle it that way instead of using the pane. |
Beta Was this translation helpful? Give feedback.
-
...and here is one way to add it to the status bar instead of using a pane. <!--Saved by Quest 5.9.9166.36226-->
<asl version="580">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="ClockLib.aslx" />
<game name="Time (Is on My Side)">
<gameid>3e17c2a5-962b-45b1-9e9c-58141e316a62</gameid>
<version>1.1</version>
<firstpublished>2025</firstpublished>
<feature_advancedscripts />
<unresolvedcommandhandler type="script">
SuppressTurnscripts
msg (Template("UnrecognisedCommand"))
</unresolvedcommandhandler>
<changedclock type="script">
game.date = Date()
</changedclock>
<inituserinterface type="script"><![CDATA[
// Only run if resuming a quest-save
if (game.timeelapsed > 0) {
UpdateDateTimeInLocationBar
}
]]></inituserinterface>
<start type="script">
game_clock.startyear = 2025
SetTime ("34:14:35")
game.clock = TimeAsString()
game.date = Date()
UpdateDateTimeInLocationBar
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<turnscript name="update_date_time_in_location_turnscript">
<enabled />
<script>
UpdateDateTimeInLocationBar
</script>
</turnscript>
<function name="UpdateDateTimeInLocationBar"><![CDATA[
JS.eval ("setTimeout(function(){if (typeof $('#date-time-status') !== 'undefined') {$('#date-time-status').remove();} $(\"#location\").html($(\"#location\").html() + '<span id=\"date-time-status\" style=\"float: right;\"> TIME: " + TimeAsString() + ", DATE: " + Date() + "</span>');},1);")
]]></function>
</asl> |
Beta Was this translation helpful? Give feedback.
-
Hi KV, This is the status box I wanted to use. Thanks for all your assistance so far. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
In my game I'd like both the Date and Time to be displayed in the custom status bar. Now I know that the clock can appear in a separate box, via the status attribute of the game.
Is there anyway it can appear and get updated with each move in the custom status box.
I'm using the Clock Library
I have the code as follows...
Any help is appreciated.
Beta Was this translation helpful? Give feedback.
All reactions