Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: spook1 on Thu 24/04/2003 21:54:40

Title: use inventory, but not on anything? (candle)
Post by: spook1 on Thu 24/04/2003 21:54:40
Two simple questions:


1st:

Is there a way to prevent all interactions from happening?
I want the player to enter a room that is totally dark. The player must not be able to do anything (walk, look, interact with hotspots etc.) until he is using a candle and light is there to see.
Howe can I turn off all (inter) actions except for the "Use Inventory" action?


2nd:
How can I get the room to change (in this case, turn on the light using flashlight plugin) by using an inventory (flashlight).
I cannot define to use the inventory on something, I need to use it "on the world". The repeatedly exccute seems to work but is there a simpler solution?

Any simple suggestions?

Kind regards

Martijn
Title: Re:use inventory, but not on anything? (candle)
Post by: Proskrito on Fri 25/04/2003 12:51:45
to the 2nd question: i think you want the same i posted here: http://www.agsforums.com/yabb/index.php?board=6;action=display;threadid=5211 (http://www.agsforums.com/yabb/index.php?board=6;action=display;threadid=5211).
i managed to do it, but in a very ugly way. if nobody tell you better way, i could post here what i did, but i'm sure it's not the best sollution.
Title: Re:use inventory, but not on anything? (candle)
Post by: spook1 on Fri 25/04/2003 21:46:28
Please.e what your scrappy way is.

mabe we should post this question in the technical forum ?

greetings

Martijn
Title: Re:use inventory, but not on anything? (candle)
Post by: RickJ on Fri 25/04/2003 22:06:33
QuoteHow can I get the room to change (in this case, turn on the light using flashlight plugin) by using an inventory (flashlight).
You can do something like this:  Make hotspot 1 cover the whole room.  Create an interaction for the hotspot "use inventory" and put the following doe into that interaction.

int room_is_dark;

function room_xx() {
  // Use inventory on hotspot #1, covers whole room
  if character[GetPlayerCharacter()].activeinv == FLASHLIGHT) {
     TintScreen(0, 0, 0);
     RestoreWalkableArea(1);
     room_is_dark=0;
  }
}

Create "player enters before fade-in interaction" interaction with the followin code.

function room_xx() {
  // Player enters screen before fade-in
     TintScreen(95, 95, 95);      //  Make room dark
     RemoveWalkableArea(1);   // Don't allow player to move
     room_is_dark=1;
}

Now for all other interactions in the room, code them something like this.

function room_xx() {
  // Any room interaction
  if (room_is_dark) {
     DisplaySpeech(GetPlayerCharacter(), "I would but I can't see a damm thing!");
  }
  else {
      // what ever you would do when the light is on
      // goes here
  }
}
Title: Re:use inventory, but not on anything? (candle)
Post by: Proskrito on Sat 26/04/2003 15:46:33
Quote from: spook1 on Fri 25/04/2003 21:46:28
Please.e what your scrappy way is.

i posted it here:http://www.agsforums.com/yabb/index.php?board=6;action=display;threadid=5211 (http://www.agsforums.com/yabb/index.php?board=6;action=display;threadid=5211)
i told you it was crappy ;) but it works for me.