forums

TNT Basic Forums > Programming Q&A
Shareware registration
< Last Thread     Next Thread >
Author
Thread        Post A Reply

01-24-2004 17:46

Posted by:
EvolPenguin

Location:
Chicago

Click Here to Email EvolPenguin   Find more posts by EvolPenguin

How would you make a registration app in tnt, so that when they put in a number it unlocks the rest of the game? I have no idea, and I want to make a shareware game.

Alex

01-24-2004 21:56

Posted by:
madscientist

Location:
n.ireland

Click Here to Email madscientist   Find more posts by madscientist

if you wanted to have a demo game with only the first 3 levels playable, put a check at the start of each level load sequence
if registered=true then loadlevel(4)
else print "sorry please register"

have a button on the main menu that makes someone put in a string and checks it against some kind of algorithm and then sets register=true.

just use the same algorithm on their name or something to generate it on your computer once theyve sent you the money.

you might want to look at the getchar() command in help to make the algorithm.

01-25-2004 01:00

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

First you need to make your game create a preferences file for the game.

if (not file exists ("YourGamePrefs"))
id=create file ("YourGamePrefs","text")
end if

in this file you will have to write the code the user provides when registering (if the code is correct).
Every time the game is launched you must verify if the code written in the prefs file is correct, if so then "registered=true"...

01-25-2004 10:04

Posted by:
kemalyun

Location:
Frankfurt/Germany

Find more posts by kemalyun

Missing features?

I also encountered that problem, but in another way. I want to make a small app that creates the registration-code for me from the data the customer gives me. But it seems there is no way to either

a) insert the contents of the clipboard (text) into the stringeditor

b) run tnt in textmode and clear the textscreen

c) open and read from a simpletext-file containing the user-data

At least one of those would be needed in order to take the email from the customer and encrypt the information into a registration-code. I don't want to print out the email and then type the whole stuff again.

Any ideas of how to accomplish either a), b) or c)?

01-25-2004 18:56

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

a) No clue
b) Enter a bunch of Print "" lines. But how would textmode help you input the data from the clipboard?
c) You can read a simple text file by telling the Ask Open File command its creator code(ttxt), type(TEXT), and data format(text). I tested it right now, and it works.

01-25-2004 18:59

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

Here's the code I used:

quote:

print "READ FILE"
print ""
print ""
int theFile=Ask open file(false,"TEXT","text")
print ""
print ""
print ""
Print "UP: read int"
print "LEFT: read str"
print "DOWN: read float"
print "Click to finish"
repeat
if up
int theInt=file read int(theFile)
print "Int:",as str(theInt)
repeat
until not up
end if
if left
str theStr=file read string(theFile)
print "String:",theStr
repeat
until not left
end if
if down
float theFloat=file read float(thefile)
print "Float:",as str(theFloat)
repeat
until not down
end if
until mouse button
print "done"

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.