Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

A Password Script

18 years ago
I'm planning to have a password using letters and the $PAGETEXT variable. I'm planning to have all the different things on the same password code, making words. I want to make it go like this.

It'll have the page text here, and then below it, it'll have links for the password.

A
B
C
D
E
F
G

Etc.
If you're planning to make a code called PINECONE, every time you click on a link, it'll show up in the pagetext. For example, if you clicked on P and then I, it would show up on the page as:

Your password so far: PI

I understand you'd probably need hidden text for these. What I'm planning to do is if the password equals PINECONE, that the code is complete. If this is done through hidden text though, than it won't work as it'll be taking letters from all the different pagetexts, which are separated. So once you've written the password, it'd go like (in the link script):

IF $PAGETEXT = $PAGETEXT + "PINECONE"
THEN
SHOW LINK (I've forgotten what the script for showing links is).

How do I get it to show up with the word inputted by password, and then use that to enable links that can unlock parts of the game?

If anybody is wondering why I don't just do this with variables and use numbers instead, it's because the codes could get mixed up (I'm using the same password page for all the codes).

A Password Script

18 years ago
tsmpaul already did it :P

A Password Script

18 years ago
I know, I read it. He'll post how to when he's ready, although he probably used variables, not letters.

A Password Script

18 years ago

Probably.

 

1 MORE DANM POST TO 8000

A Password Script

18 years ago
LOL! I forgot about my password script system. The whole thing can be done on a single page. I'll go glance at it, and write a post on how to do it.

A Password Script

18 years ago
Wow am i ever observant.

A Password Script

18 years ago

Doh! I deleted it at some point. Anyhow, off the top of my head, this is basically how to do it:

STEP ONE

Create these variables:

%LETTER1, %LETTER2, %LETTER3, and however many letters long your password will be.
Set all of those letter variables to the number "0".

Also create a variable called %CURRENT which keeps track of how many letters they have entered for their password. Set it to "0".

STEP TWO

Create as many links as you want, having them point to this same page the links are on.
Links might be "A", "B", "C", "D", etc... You don't have to go all the way to "Z", but you can if you want to. A lot of password systems only use letters "A" through to "E".

When the link is clicked on, you create a script that moves to the next letter (changing %CURRENT) then assigns a numeric value for that password letter. The number you assign represents which letter they are typing. A = 1, B = 2, C = 3, D = 4, and so forth.

So, if you only have a three letter password, for the link "A" you might have a script that looks like this:

----------------------------------------------

%CURRENT := %CURRENT + 1

IF %CURRENT = 1 THEN
BEGIN
   %LETTER1 := 1
END

IF %CURRENT = 2 THEN
BEGIN
   %LETTER2 := 1
END

IF %CURRENT = 3 THEN
BEGIN
   %LETTER3 := 1
END

----------------------------------------------

STEP THREE

Now you need to create your page script to display what password letters have been selected. Basically, it runs through the letters the player is entering, checking their variables to see if they are above zero, "0". If they are above "0" then the player has clicked on a letter link, so you need to check which number value the letter has, and assign the letter for that number. So, the page script for a three letter password, using only the letters A and B to make your password:

----------------------------------------------------------------

$PAGETEXT := "Please enter your password: "

IF %LETTER1 > 0 THEN
BEGIN
   IF %LETTER1 = 1 THEN $PAGETEXT := $PAGETEXT + "A"
   IF %LETTER1 = 2 THEN $PAGETEXT := $PAGETEXT + "B"
END

IF %LETTER2 > 0 THEN
BEGIN
   IF %LETTER2 = 1 THEN $PAGETEXT := $PAGETEXT + "A"
   IF %LETTER2 = 2 THEN $PAGETEXT := $PAGETEXT + "B"
END

IF %LETTER3 > 0 THEN
BEGIN
   IF %LETTER3 = 1 THEN $PAGETEXT := $PAGETEXT + "A"
   IF %LETTER3 = 2 THEN $PAGETEXT := $PAGETEXT + "B"
END

--------------------------------------------------------------

STEP FOUR

Finally, you need to make the links that let the user try out the password and see if it works. It might be called "Try This Password" or something. It directs the user to a password failure page. However, the link's script changes the destination of the link to the successful password's page if the password is right.

If the password was a three letter password, using just A's and B's, for example ABA, and the destination page number for the correct password was 6, then the script would look like this:

-----------------------------------------

IF %LETTER1 = 1 THEN
BEGIN
    IF %LETTER2 = 2 THEN
    BEGIN
        IF %LETTER3 = 1 THEN
        BEGIN
             $DEST := @P6
        END
    END
END

---------------------------------------

You might also like to create another link that allows the user to erase the letters they have typed so far. Simply make that link set %CURRENT back to zero, and set all the %LETTER variables to zero.

Oh, and you might want to set a visible restriction on your Letter Links, so that they don't appear when %CURRENT passes the length of your password. Ie, if your password is 3 letters long, then make it so the links don't show if %CURRENT = 4.

I think that's about it. If I've made any mistakes, I'm sure other scripters can correct it in a reply post :)

A Password Script

18 years ago
Makes sense.

A Password Script

18 years ago
An alternative way of doing things. And probably the only way. I like it, thanks for that Paul.

A Password Script

18 years ago
Great job Paul, u should put this in a rticle, it is yours so you should also be the one to publish it...

A Password Script

18 years ago
I thought articles were made by mod people?

A Password Script

18 years ago
nope, they are open to all members!

A Password Script

18 years ago
Like Solo said, the articles are open to all members, but only the mods choose who gets in or not.

A Password Script

18 years ago
Meh, it needs to be really bad to be rejected, or uselss... but we mainly edit, i love to edit those things!

A Password Script

18 years ago

Moi aussie.

Also havvy has no article powers so its not strictly mods.