If player did particular thing then...

Hello Guys, I'm looking for a way to develop story by making a player do specific things before moving on. Let me say what I exactly mean on a particular example. So I need a player to talk to the NPC and get the key from him, but only if the had tried to open the particular door before. If he didn't then I want to play different scenario and make player check the door first. I know that I should use 'if' but I don't exactly know how.


If you're on the desktop version and you're creating a text adventure, I'd set a flag on the player object.

In the start script you can set a flag nodooror whatever and in the script where the player tries to open the door you remove the flag.
In the conversation with the NPC check for the flag. If it's there, the player still needs to try the door, if it's not there, the NPC will give the player the key.

Setting the flag: SetObjectFlagOn (player, "nodoor")
Removing the flag: SetObjectFlagOff (player, "nodoor")
Checking for the flag

if (GetBoolean(player, "nodoor")) {
// Script whatever needs to be scripted here.
}
else {
// Script the NPC giving the player the key here
}

I'm working on the online version actually. I believe you can set flags here to but I'm not sure how. I made an exit and locked it. And here I don't really know how to set a flag to it and then remove it.


I see. I've never tried the online version. I downloaded the desktop version first thing.
This means I can't help you. Sorry about that.
Someone else with knowledge concerning the online tool will have to tell you now it’s done.
(or, download the desktop version, I recommend it :))


Hello.

The flags and attributes work the same online as they do in the offline editor.


I would highly recommend following the tutorial before attempting to create a game.
http://docs.textadventures.co.uk/quest/tutorial/creating_a_simple_game.html


Then, if you still need assistance, this should help you with locked exits:
http://docs.textadventures.co.uk/quest/exits.html#attributes


Note that creating lockable doors is sort of a pain, even for experienced Quest authors, but here's the most basic way to handle them:
http://docs.textadventures.co.uk/quest/setting_up_door.html


Okay so basically you made me download the desktop version :D I set the flag to the player and it works, but there is a problem with removing the flag. You see, I have an exit marked as locked. And I cannot figure out how to set (remove) flag to the 'trying the exit'. I'm not sure if I'm making myself clear enough xd
Could you help me with that?


Okay Guys, I've made it. Finally I realised that I shouldn't lock the door so I could use them. You've been both a great help!
Thank you!!!


Jolly good =)


Log in to post a reply.

Support

Forums