intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Sep 22, 2017 7:01 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Sep 04, 2017 3:53 am 
Offline

Joined: Sat Aug 25, 2012 4:17 am
Posts: 257
Hey there! I'm using Real Date and Time by Ron Newcomb to create events that only happen once a day, in real time, so that the player can't abuse a powerful healing feature that would otherwise let them cheat. I've managed to store the day and year as numbers, but I can't work out how to store the month. I tried duplicating the value directly from 'Real Date and Time' with a slightly different name, but I get that annoying 'Like saying a door is 20' error. Can anyone help?

This is the value I need to clone (I also need to be able to set the clone from the real time version, if anyone can help with that?):

Code:
A month is a kind of value. The months are January, February, March, April, May, June, July, August, September, October, November, December.


Top
 Profile Send private message  
 
PostPosted: Mon Sep 04, 2017 6:57 am 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5001
Location: Burlington, VT
I think you just need to create a month variable:

Code:
The stored month is a month that varies.


and then copy the player's month inside your rule:

Code:
now the stored month is the player's month.


For example:

Code:
Include Real Date and Time by Ron Newcomb.

Lab is a room.

The stored year is a number that varies. The stored day is a number that varies. The stored month is a month that varies.

Before jumping:
	now the stored year is the player's year;
	now the stored day is the player's day;
	now the stored month is the player's month.
	

Every turn:
	say "[Stored year]-[Stored Month]-[Stored day]."


(The in-IDE interpreter doesn't seem to support the date/time feature; I had to release this and run it in Gargoyle to make sure it was working.)


Top
 Profile Send private message  
 
PostPosted: Mon Sep 04, 2017 10:11 am 
Offline

Joined: Sat Aug 25, 2012 4:17 am
Posts: 257
Oh, thank you! And thanks for checking it worked too. :D That's much easier than what I had.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group