QUESTION - I am having difficulties with certain aspects of my game. Ie. doors

Started by adamgrabsch1, Mon 09/03/2009 05:58:15

Previous topic - Next topic

adamgrabsch1

My name is Adam and I'm new and the stuff I'm asking, might seem a little simple to you, but please help me if you could.

My issues are:

1. I've created a hotspot over a background picture of a door, but  you can open it with a rock, a key or whatever you want. How do I script it so that it only opens with a specific object?

2. The door doesn't really unlock, once you use the object on it you change to another room, but if you were to interact with it again, it would still be locked. How do I make it so that it just unlocks for good after the key is used

3. I do not know how to do cutscenes or opening/end credits. How do I do so?

4. My last question. Pretend I want my character to get stabbed if he is reached by a knife wielding maniac how do I do the animation. Just in views? This goes for any animation other than walking... and once I've made the animation how do i script it into the game.

Sorry if any of these questions have been asked before, but I did look through the forums first and could not find an answer to my problems...




Trent R

Welcome to the forums man. I'll remind you to read through the tutorial and manual. Also, there's a few guides and tutorials, including some video tutorials by densming.


1) You need to check which inventory item you're currently using.
Code: ags
// Inside hotspot interaction
if (player.ActiveInventory==iDoorKey) {
  unlockeddoor=true; //This is for the next question
  player.ChangeRoom(8); //Or whatever you want to happen when the door unlocks.
}


2) Use variables. If it's only used in that single room (like a door unlocking) you only have to declare it in the room script. If it's something that needs to be used in multiple rooms, use the Global Variables pane.
Code: ags
//This line goes outside of any function, usually at the top of the script (keeps it organized and clean)

bool unlockeddoor=false; //Read more about dif. types of variables in the manual.
(Note-Your terminology when asking this was 'wrong'. You meant a InventoryItem, whereas Objects are used in rooms.)

3) Cutscenes are the same as normal scripting. Use commands like Walk, Say, Animate, and anything else. You can disable player control, or use entirely blocking commands. Also, read the entries on StartCutscene and EndCutscene (they aren't required, but it'll make your game more playable)

4) Yeah you do it in the views, then call the scripting command depending on what type you are trying to animate. You can animate Buttons, Characters, and Objects (and also mouse cursors). Read the entries in the manual.



~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune


SMF spam blocked by CleanTalk