How to quite a game after 5 years?

This forum is meant for sharing talents on common Adventure Maker projects. Feel free to present yourself and talk about your skills. Partnership proposals and job offers are also welcome.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

How to quite a game after 5 years?

Postby Sam » Fri Mar 31, 2006 4:32 pm

Hello!

Need help!

I want that the user only use my game in a period of 5 years. After 5 years the game would be quite (not available more).

The code that I have tried is:

Code: Select all
Quitedate = 2009-01-01
Nowdate = date
If Nowdate = Quitedate then Action.GoToFrame "quite"


But it does not working

Regards, Sam
:roll:
User avatar
Sam
Member
 
Posts: 36
Joined: Sat Jul 17, 2004 12:25 am

Postby ShadowHunter » Sat Apr 01, 2006 2:12 am

Hi,

1. Open your project
2. In the "Project Menu" click "VBS Procedures (advanced)"
3. Copy/Paste this code into the window

Code: Select all
Sub ExpiredCheck

Dim ExpireDate, CurrentDate

ExpireDate = CDate(01/01/2009)
CurrentDate = FormatDateTime(Date,2)

If ExpireDate <= CurrentDate Then   
   CreateTimedEvent 0.1, "Action.GoToFrame ""ExpiredFrame"""
End If

End Sub


4. Click "OK"
5. Right click on the initial frame (first frame when the game starts)
6. Select "Properties"
7. Select the "Advanced" tab
8. Tick the "Execute VBScript code immediately after the frame has appeared" checkbox
9. Copy/Paste this into the window

Code: Select all
ExpiredCheck


That should work regardsless of regional settings too :D

Better of course would be to look at the date the game was first ran or installed and add 5 years to it and provide a system time set back check.

You can learn this by downloading my "Trial and Registration script" from my website http://www.shadowhunter.co.uk, look under the VBScripts section.

Hope this get you started !

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Sam » Sat Apr 01, 2006 9:22 pm

Hi ShAdOwHuNtEr!

Thanks a lot, but the code does not working. I think the value of the CurrentDate and the ExpireDat is not the same format.
If I check the CurrentDate :
Code: Select all
Text(1)= FormatDateTime(Date,2)
gives 4/1/2006
If I check the ExpireDat:
Code: Select all
Text(1)= CDate(01/01/2009)
gives 00:00:43

Best regards, Sam
User avatar
Sam
Member
 
Posts: 36
Joined: Sat Jul 17, 2004 12:25 am

Postby Candle » Sat Apr 01, 2006 10:24 pm

I find it hard to believe a game would be on a computer that long.
Most computers have a reinstall of the OS long before that so it will be a new install of the game or left off and on to something new.
Think back five years and look on your computer , you won't find anything on there from that long ago.
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3055
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby ShadowHunter » Sun Apr 02, 2006 11:37 am

Hi,

The whole idea of the DateTimeFormat function is to get an universal date formating, 2 for being mm/dd/yyyy. You could try to remove the CDate function...

I would have used the Format(Now, "mm/dd/yyyy") function but AM seems not to accept this. Maybe GM has an explanation for this.

Though it works fine on my computer because, it might be regional settings related.

What settings do you use in Windows ?

We will find a solution because there are more ways to store a date :wink:

Unfortunally I agree with Candle... 5 years is an eternity in computer terms. I wouldn't worry to much about it.

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Sam » Sun Apr 02, 2006 10:16 pm

Hi!

When I reform your code as below, it works on my computer perfectly, but I want that the code should work on all type of settings that the Windows use.
I don?t know how to check a computer setting to know what settings do I use in my Windows ?

Code: Select all
Sub ExpiredCheck
Dim ExpireDate, CurrentDate
ExpireDate = CDate("4/2/09")
CurrentDate = CDate(FormatDateTime(Date,2))
If ExpireDate <= CurrentDate Then
CreateTimedEvent 0.1, "Action.GoToFrame ""ExpiredFrame"""
End If
End Sub


Best Regards, Sam
Last edited by Sam on Mon Apr 03, 2006 9:48 pm, edited 2 times in total.
User avatar
Sam
Member
 
Posts: 36
Joined: Sat Jul 17, 2004 12:25 am

Postby ShadowHunter » Mon Apr 03, 2006 4:23 pm

Hi Sam,

I don't think the code works since you use the wrong variable... You have created "EDate" but are using "ExpireDate" to make a comparison...

Anyway, try to store the date as a long variable then you have a number instead of a formated date. That should be the same regardless of the regional settings.

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Sam » Mon Apr 03, 2006 9:53 pm

Hi!

I don't know, it works on my PC, I will try it on onther PC too.
I remove the variable EDate. I t still working as well as before.

Code: Select all
Sub ExpiredCheck
Dim ExpireDate, CurrentDate
ExpireDate = CDate("4/2/09")
CurrentDate = CDate(FormatDateTime(Date,2))
If ExpireDate <= CurrentDate Then
CreateTimedEvent 0.1, "Action.GoToFrame ""ExpiredFrame"""
End If
End Sub

Best Regards,
sam
User avatar
Sam
Member
 
Posts: 36
Joined: Sat Jul 17, 2004 12:25 am


Return to Working Together

Who is online

Users browsing this forum: No registered users and 2 guests

cron