Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sat 17/01/2004 00:34:04

Title: Same click with different answers and other questions
Post by: on Sat 17/01/2004 00:34:04
I wanna know how to make the same click show a diferent answer in each click.

And, I someone can help me with some other things (im not going to start another topic for this ok):

1- Can i make 1st person game?

2 - Is it possible to make negative conditionals like: If player is not carrying an object,etc.

3-  I want to make a game where you shoot. Like you click (with the correct mouse pointer only) and it shoots and it causes damage. And how to make life points? (I know this is a difficult thing so i dont mind if u dont answer this one)
Title: Re:Same click with different answers and other questions
Post by: Reno Caspain on Sat 17/01/2004 01:07:51
If you want different answers from same clicks, you need to runa script. It should look like this:

(in room script, outside any functions)

int answer;

(in interaction you want the answers at)

if (answer==0)
{
[insert your answer's script here]
answer++
}
if (answer==1)
{
[second answer here]
answer++;
}

and in the final answer replace the answer++ with answer=0 if you want to diaplay the fisrt answer again after the last one.

And other questions:

1. You can make it by selecting Hide player character in every room. That way the player character wont be shown in any screens.

2. I'm not sure, but I haven't figured out how to.

3. I think the easiest way to make shooting is to make a bullet character move from shooter to the target with MoveCharacterDirect command. To find out whether or not the bullet hit the target, use the AreCharactersColliding command, and make the damage code there. For example:

enemyname=enemyname-damage;
if (enemyname<0)
{
[dying code here]
}

I hope you're familiar with scripting, this seems to need a lot of it.
Title: Re:Same click with different answers and other questions
Post by: Dorcan on Sat 17/01/2004 01:13:19
Hum, if you don't add else, all the different answers will be displayed at once.

if (answer==0)
{
[insert your answer's script here]
answer++
} else
if (answer==1)
{
[second answer here]
answer++;
} else
...
Title: Re:Same click with different answers and other questions
Post by: Scummbuddy on Sat 17/01/2004 07:19:47
for number 2

just have a global int keeping track of wheter or not you have an object or none at all. Then refer to the global int to see what you want
Title: Re:Same click with different answers and other questions
Post by: Scorpiorus on Sat 17/01/2004 15:49:15
Regarding the second question, I'd use scripting instead of interaction editor, in run script:

// if EGO doesn't have inventory item number 5:
if (character[EGO].inv[5] == 0) {

// code here

}