A few questions

Started by , Thu 28/08/2003 23:34:13

Previous topic - Next topic

phubans

Hi, I've been working on a first-person horror game using AGS for about a week now, I'd say that I'm about 25% through it. I've read through the tutorial and I think it's safe to say I have a good understanding of the program, however, there are a few things I would like to incorporate into my game and I'm not exactly sure where to begin with them, if they are even possible of the program.

1) I'd like to set up puzzles that trigger an event when they are completed correctly. For example, I would make a room that is a close-up of some keys on a piano, with each one being a hotspot... Each key would play a different sound (note) when clicked on, but would do nothing but that unless the correct combination (say keys D,E,A,D) of keys were pressed. Another example would be a numerical keypad which is used to say, unlock a door when the correct combination of numbers is input. It's like I need to set up a conditional for a string of events, how would I do this? Is it possible?

2) I would like to feature a character who is a killer that chases your character. He would appear at random and "chase" your character (appear in each room) until a certain condition is met (escaping to the right room). Would I create this kind of entity as a character, or as something else?

I hope these questions are descriptive enough and I hope that they can be done, because I really need them for my game to be fully effective. Thanks for reading.

-Paul

dtm1980

2) There is a function called FollowCharacterEx
It goes like this:
FollowCharacterEx (CHARID, int chartofollow, int dist, int eagerness)
CHARID is the killer
chartofollow is your player character
dist is how many pixels the killer stays behind the player
eagerness sets how long the killer stands around before he checks to move on.
Read the help file... It tells you how to chase someone.

Phubans

Okay, thanks... I remember trying something like that, but for some reason it didn't work... Will it still work even if the player character is hidden in every room? (It's a first person POV game)

Is there a command that makes the killer appear at random?

And about those puzzles with sequence combinations... I checked out the keypad in the demo game, but unfortunately that didn't seem to help me much... I noticed each button runs script when interacted with, they were running numbers 260, 261, 262, and so forth. Are these numbers global commands? And how do you set it up so that the correct combination of them equals a new event, such as a door opening?

Scummbuddy

haha, no its not going to work if the main character is hidden.. not well, at least.  but you will probably have to run a random timer or some fixed timer to have it when to make the other character come from a doorway and scare the ba-jesus out of you.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

phubans

Well yeah, that's what I'm hoping to do... Have the killer appear like right in your face as soon as you enter a room or open a door, and it (hopefully) would scare the crap out of the player, not only because he's appearing by surprise, but because he's a knife-wielding maniac covered in blood and wearing a creepy theater mask!

If anyone is interested, I can send you the zip of what I've done so far... Which is 16 rooms, but there are only 6 rooms to explore. The reason there are 16 rooms is because I've done the 6 rooms from different angle views and close-ups. My rooms were originally modeled in 3D Studio Max and use textures I created in Photoshop, so needless to say I've spent a lot of hard work and time on this game, and I'd really like for it to feature such elements as the ones I mentioned in my questions.

Anyways, if you'd like to try out my game and get an idea of how it's set up and exactly what I'm trying to achieve, feel free to email me or let me know on here. I can try to send you the zip (which is under 3 MB), but I'll probably have to use AIM since Hotmail doesn't let you add attachments that large. You'll have to email me with your AIM SN so I can add you, since I have AIM set up to block users who aren't on my buddy list.

Phubans

I recently posted this question a while ago, but I don't it got many views because the subject was too vague. Anyways, I need to create some kind of entity, be it an object or a character, that will appear in my game at random and be able to be interacted with.

My game: A first person point & click game where the player character is hidden, much like the NES games, Shadowgate, Deja Vu, and Uninvited. The theme of my game is horror, you are trapped inside a killer's house which is also haunted, making it a very dangerous place.

What I'm trying to do: Make the killer appear at random, as a still image appearing on your screen before you, accompanied by a shrill sound effect and some upbeat music. The killer will continue to appear on your screen as you move to other rooms, eventually killing you if you come to a room with no exits, losing track of you if you chose the right sequence of rooms to run through, or being killed by you if you use the right sequence of items necessary to defeat him.

I'm sure this is going to require a lot of scripting and maybe not all of it will be possible for me to do, but if any of this sounds familiar to you, could you please let me know the easiest way to go about doing it? Thanks.

Scummbuddy

#6
Random
Random (int max);

Returns a random number between 0 and MAX. This could be useful to do various effects in your game.
NOTE: The range returned is inclusive - ie. if you do Random(3); then it can return 0, 1, 2 or 3.

Example:

int ran=Random(2);
if (ran==0) NewRoom(1);
else if (ran==1) NewRoom(2);
else NewRoom(3);

will change the current room to room 1,2 or 3 depending on a random result.
------------------------------
use that with an if statement and do repeated calls.
-----------------

you could the have the original background, and the new background, and use the setbackgroundframe code instead of the NewRoom above.


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

Oh, and dont start new topics to say the same thing, just continue from now on in the same posts.... i merged the topics.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

alex

I have had some similar problems too. I'm creating a Planet of the Apes game and I've had a problem with the rooms. You see, when I come from one room to the othger sometimes I appear in middair or some other such unwalkable placeThis is annoything seeing as the game was progressing great until this bug occured. I've tried to start the character off at different coordinates but it just makes the problem worse.
If anyone has a solution please tell me.

Scummbuddy

what did you use to make the character appear on certain coordinates.  This is the appropriate code.
----------------
NewRoomEx
NewRoomEx (int room_number, int x, int y);

Identical to NewRoom, except that the player character is placed at co-ordinates (X,Y) in the new room.
Example:

NewRoomEx(4,100,50);

will move the player character to room 4 and also place him at coordinates 100,50.
------------------------------

Are you sure you are doing your braces correctly as well?
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

SMF spam blocked by CleanTalk