Device hacking

OurJud
I have an electronic device (ePad) in my game that the player must hack into to gain some information. Having said that, it's not so much hacking, as I (hopefully subtlety) indicate the device's password which is disguised as a telephone number in an address book.

The problems I'm having are keeping the player 'logged in' on the device until he enters the correct password, but I can't do this is case he hasn't checked or noticed the password in the address book, and needs to call it up again.

I call an image for the address book and I'm trying to devise a script for the ePad use. It sounds simple enough, but what I want to do is exclude most of the default commands (or more to the point, change their response to "Wrong Password!") while still allowing the player a way out, in case he decides to return to the game's story and try getting into the ePad later.

Also, I need to loop the 'incorrect password' message, as at the moment, the game 'falls out' of the ePad use after the first incorrect input, meaning I get:

Enter password
>3432
Incorrect password!
>1298
I don't understand that command

So, how would I loop the password access, while allowing them to call the address book, or return to the game?

Can I create a 'log out' link? That would solve that, but I need to allow the player to call up the address book.

I tried adding the command #text# running a script which says "Wrong password", but default commands over ride this, it seems.

OurJud
I've managed to do it, but man is it convoluted! It should all give you a good laugh anyway.

I created the object: ePad

I then created four different rooms; lounge, login, wrongpassword, correctpassword.

Lounge is where the player and ePad are. When the payer uses the ePad I run the following script

msg ("Enter password")
get input {
if (result="1234") {
MoveObject (player, login)
}
else {
msg ("Incorrect password")
SetObjectFlagOn (player, "wrongpass")
MoveObject (player, correctpassword)
}
}

The room called 'login' will basically serve as the ePad interface when accessed with the correct password.

An incorrect password here sets the flag 'wrongpass' and moves the player to the room 'correctroom'

In the room 'correctroom' I run the following script

msg ("Enter password")
get input {
if (result="1234") {
MoveObject (player, login)
}
else if (GetBoolean(player, "wrongpass")) {
msg ("Incorrect password")
MoveObject (player, wrongpassword)
}
}


An incorrect password here sets the flag 'wrongpass' again, but this time moves the player to the room 'wrongpassword'

I then run the same script as in the lounge. This has the effect of bouncing the player between 'wrongpassword' and 'correctpassword' until they get the password correct.

All I have to do now is add a command for 'use address book' so that they can still call this if needs be, and also create a 'log out' link to return them to the game.

I've no idea how to do this last one (create a 'log out' link that returns them to the game) so if anyone can explain how, that would be appreciated.

OurJud
Oh boy, oh boy, oh boy! These inputs are causing all sorts of problems with the calling of the address book image.

Is there any way I can do this by setting the correct password as a command, while returning an 'incorrect password' for any other command?

If I can't exclude all commands other than the ones I specify, then can I at least return the player to the password input after each input that isn't the correct password?

Like this:

>get epad
You take the ePad

>use epad
Enter password

>34544
Incorrect password entered
Enter Password

>n
You can't go there
Enter password

>read address book
[displays address book image]
Enter password

>1234
Logging in, please wait...

As it stands, I get:

>get epad
You take the ePad

>use epad
Enter password

>34544
Incorrect password entered

>1234
I don't understand that command.

OurJud
I think I've got it. It's far less complicated and uses a set of commands, but I'm too tired to explain it now.

All I need now if for someone to explain how I create a 'log out' link.

OurJud
Wow! I got there all by myself!

You create the command 'log off' which runs a script to do whatever, then where ever you want the link to appear, use {command:Log off} to print it as a link which runs the script.

But then you all knew that anyway :)

HegemonKhan
HK *LOVES* convoluted! :D (now we're truly of the same mind, laughs. Methods of Madness!)

(excellent job getting it to work, doesn't it feel good after all that struggle that you got it to work hehe, who cares how convoluted it is, it works! And even better, you've already re-did it, making it better, less convoluted! Bravo! Just beware of the depression you feel after a good coder now comes along and does it in like 2 minutes and so concise too... laughs... I was so elated after I got my combat code to work, then Pertex was able to 'clean' it up in like 1 minute, and my mouth dropped at how much better it was than mine, laughs. I was still estatic though that I got it to work, even though I was also feeling dumb why I didn't code it better, like Pertex could, lol)

I'll let you work a bit more on it tomarow, after you got a good night's rest, if you still need help then with it.

OurJud
Thanks, HK :D

And yes, it does feel good, especially in that I got there all on my own. Like you say, it's probably not the cleanest, prettiest, or even the correct way to do it, but it works (I think). I'm sure with a clearer head and more thorough testing, some issues will crop up, but I'll jump off that bridge when I come to it.

I'll post my method too. Who knows, it might not be that messy afterall.

Tell you what, I'll post it now.

I managed to do it by creating a series of rooms that aren't actually rooms. The player isn't aware of them and can't access them anyway, unless I move them there, but here's what I did.

The rooms are 'lounge', 'wrongpassword', 'login', 'loggedout'.

Main room is 'lounge' - this is where the player and the ePad start. In this room I created the following, separate command scripts:

'1234' (correct password >> moves player to 'login' room - this room will act as the ePad itself)
'#text#' (incorrect password/any input >> moves player to 'wrongpassword')
'use address book' (calls the address book image)
'log off' (clears the screen and returns the player to the lounge - this is set as a hyperlink using {command:Log off})

I then had to add these same four commands to the 'wrongpassword' room, so that the game would recognise them when the player is moved there.

And that's it!

HegemonKhan
using rooms, is a good method for doing a lot of things. (and convoluted, really means being creative, as you don't know of all and~or the best methods of coding, so you got to improvise with what you can do~know how to do, as that's all you got to work with, whereas a good coder, has a lot more to work with)

bravo again on getting the last part figuring out of what you wanted to do, hehe.

OurJud
HegemonKhan wrote:using rooms, is a good method for doing a lot of things. (and convoluted, really means being creative, as you don't know of all and~or the best methods of coding, so you got to improvise with what you can do~know how to do, as that's all you got to work with, whereas a good coder, has a lot more to work with)

bravo again on getting the last part figuring out of what you wanted to do, hehe.

Thanks :)

Just a quickie; you see how I had to include those commands in each of the rooms, could I simply make 'game' the parent of those commands so that the ePad will work where ever the player is?

HegemonKhan
I'm not sure how to do it in the GUI~Editor (there is a default 'Commands' in the left side's 'tree of stuff', Game -> Commands, Verbs ), except by clicking on the most upper left Object 'Object' in the left side's tree of stuff, so it is highlighted, and then from the bar at the top of the screen, under 'add', choose 'Commands', and it'll be a global Command (it will work where ever the player is, though with that the case, you'll need additional logic scripting to deal with that, as well).

Silver
I find the GUI helpful as it teaches you to think in code logic without worrying about messing up the code. You can then switch to code view to see how it looks that way if you want.

HegemonKhan
that's what I did too when I started out, hehe.

(though my computer is old, and it takes awhile to load up the GUI~Editor~quest.exe, sighs)

(it's also a pain to try to learn~remember the conversion between how the GUI~Editor looks and does stuff vs how it looks and is done in code)

Marzipan
OurJud wrote:
Just a quickie; you see how I had to include those commands in each of the rooms, could I simply make 'game' the parent of those commands so that the ePad will work where ever the player is?


You probably figured this out already, but the answer is yes, just in case anyone else ever digs up this thread wondering the same thing.

Silver wrote:I find the GUI helpful as it teaches you to think in code logic without worrying about messing up the code. You can then switch to code view to see how it looks that way if you want.


Following along with code that someone else posted is pretty straightforward for me, so it's not the logic that gets me, it's trying to memorize things like 'okay this curly bracket goes here, and this over here has to be in quote marks, and these parenthesis have to go exactly like this or I break the whole thing...'

Maybe it takes slightly longer but give me the GUI any day.

Silver
Imagine working in only code.

Syntax error in line 3765345 lol

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums