Question & Answer Session

Welcome to the ADRIFT Questions and Answers session, here we try to answer some of those questions that have been bugging you and those that have you stumped on how to do them.

Please note that I have not personally answered any of these questions, they were answered by various members of the ADRIFT Forum.

---

Q: How can I have multiple descriptions for a character? For example, suppose I have character "Bob" -- I type in "x Bob" and I see his initial description. Then I type in task "punch Bob." Now when I type "x Bob" I see a new description such as "Bob has a black eye." Now suppose I type in task "throw paint on Bob" -- here is my question -- how can I make a THIRD description so that when I type "x Bob" it says "Bob has a black eye and is covered in red paint"?
A:

You probably need to use the ALR (ADRIFT Language Resource) File, which is a text file that you import into your game. Used in conjunction with one or more variables this will allow for plenty of variety. Here you could have a variable for punched and another for painted, set to 0 when you set them up, when the action occurs use a task action to change the variable to one. Where you want the character description put something like

[BOB%punch%%paint%]

Now go to a simple text editor like notepad and create your ALR, which would then look something like:

[BOB00]|Bob looks fine
[BOB10]|Bob has a really painful black eye
[BOB01]|Bob is covered in red paint
[BOB11]|Bob has a black eye and is covered in red paint

Now save the file under a suitable name (game.alr) and import it in via the file-import-ADRIFT language resource option and after saving your game it should (hopefully) work as you want.

---oOo---

Q: How do you go about pushing say a heavy chest from one room to another? On on hand it's dynamic because it can be moved, on the other it's static because it can't be picked up?
A: You could use a dynamic object, tasks to push/pull it, and a task so you couldn't pick it up- with the action to move the object to the same room as the player- display message- it's too heavy or something like that.

---oOo---

Q:

Is there a way to have a player's input transferred to..., let's say, an object??

For example: #task1 asks the player "What is your favorite color?"

Player answers: "green"

Then upon examination of a particular 'object' the description would read, "Yadda, yadda, yadda...... and how about that?! It's green!!, your favorite color!!"

A:

Create a variable called colour;

Change the variable to referenced text.

In the box, "The object is %colour%"

Something like that.

---oOo---

Q:

For the first time I'm planning to use an expression in a game but I'm coming unstuck with it. What I have is:

Two variables: "diceroll" which is changed from anything between 1 and 20; and "level" which begins at 1 but can increase all the way to 20. What I need is an expression that can increase the value of "diceroll" by the value of "level", bearing in mind that both can alter from one use of the expression to the next.

I tried to set the expression to diceroll=(diceroll+level) but it didn't work. I tried enclosing the variables in %% but that didn't work either. I just get error messages telling me "bad expression" or something similar. How do I do this?

A:

You need something like this:

Type of Action: Change Variable
Change: level To expression: %level%+%dice%

---oOo---

Q:

For the life of me, I can't figure out why my character walk won't start. It did have a blank walk before it, but I've deleted it, (known bug-removing the blank walk usually takes care of it).

My walk is set to start after a certain task is completed. The task executes, but the NPC just stands around. :( Any ideas.

A:

I had this once before whereby the character walk worked fine, but then I changed something (corrected a spelling or something minor like that) and the walk just stopped. In the end I created an identical second character with the same walk and this one worked fine. I think once a walk breaks, it's broken for good and can't be fixed.

---oOo---

Q:

The goal here is to have the user input text into a specialized "loop" that handles the user input in a specific way depending upon the current task.

So, we have a "Password" Task. After typing "Password" the user gets a "Please enter password" message. So far so good.

Here's the part I can't figure out. The user types in some text that they think the password is. If it is correct, the system displays "Correct Password" and sets a variable, if incorrect displays an "incorrect password" message. Whatever the user types would only have the password trigger during this task (or event).

A:

Try this:

Have a variable GettingPassword. When it is equal to 0, the player isn't using the computer; when 1, the player is entering a password; when 2, the player is logged on.

Task 1:
Command: %text%
Restrictions
- Variable GettingPassword must be equal to 1
- %text% equals exact value secret
Action
- Print "Password Correct!"
and
- Set Variable GettingPassword to exact value 2

Task 2:
Command: *
Restriction
- Variable GettingPassword has exact value 1
Action
- Print "Incorrect Password"
- Set Variable GettingPassword to exact value 0

Next, have commands for all the actions the player can do while logged on; all of them must have restriction GettingPassword is 2. After all of those, put in a final command with action "*", and restriction GettingPassword == 2, which just prints a "command not understood" message.