Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Random on Thu 04/09/2008 22:30:05

Title: Problem with making the game whole :p!
Post by: Random on Thu 04/09/2008 22:30:05
(see last post)!  ???
Title: Re: Problem with combyning items.
Post by: TwinMoon on Fri 05/09/2008 00:45:19
Picking up item from floor with inventory item:

in the events tab for the object on the floor, click on "use inventory on object" and put:

if (player.ActiveInventory==iInvItem) { //checks which inventory item the player used
  oItemonFloor.Visible=false; //this removes the object from the room
  player.AddInventory(iPickedUp); //this gives the player an inventory item
}


(where iInvItem is the name of the inventory item, oItemonFloor is the name of the object in the room (not the description, but the name), and iPickedUp is the inventory item you want the player to acquire)

(The text starting with // is commentary btw. Everything behind // will be ignored by AGS)


Giving the player another inventory item:

in the events tab for the hotspot, doubleclick "use inventory on hotspot" and put:
if (player.ActiveInventory==iUsedItem) {
  player.LoseInventory(iUseditem); //take the used item away from the player
  player.AddInventory(iNewitem); //and give him/her another instead
}


(where iUsedItem is the one you want the player to lose and iNewitem the name of the item you want the player to gain)

With this information, you should be able to figure out the answer to your last question on your own.
Title: Re: Problem with combyning items.
Post by: Khris on Fri 05/09/2008 03:32:10
Just RTFM, fcs.
Title: Re: Problem with combyning items.
Post by: Random on Fri 05/09/2008 10:00:25
Thx for the reply, helped alot.  :)
I made the change room script like this:

function hHotspot2_UseInv()
{
  player.Walk(x, y,  eBlock);
if (player.ActiveInventory==iItem)
  player.LoseInventory(iItem);
  Display("text");
  dCharacterdialogbeforechangeingroom.Start ();
  player.ChangeRoom (x);
}

But after everything is played and he tryes to change the room I get an error and it closes. What did I done wrong here?

Also I would like to know how to make an intro from varius rooms. So that when the game starts first comes one room (black with writing on it) then when I click another one (like the one before) and then after that to put me actualy in the first room of the game?


Title: Re: Problem with combyning items.
Post by: Matti on Fri 05/09/2008 10:23:23
Quote from: Random on Fri 05/09/2008 10:00:25
But after everything is played and he tryes to change the room I get an error and it closes. What did I done wrong here?

What error message do you get?

Quote from: Random on Fri 05/09/2008 10:00:25
Also I would like to know how to make an intro from varius rooms. So that when the game starts first comes one room (black with writing on it) then when I click another one (like the one before) and then after that to put me actualy in the first room of the game?

Just make room-sized hotspots in the intro rooms and if they're clicked the player changes the room.
Title: Re: Problem with combyning items.
Post by: Random on Fri 05/09/2008 10:32:05
Quote from: matti on Fri 05/09/2008 10:23:23
Quote from: Random on Fri 05/09/2008 10:00:25
But after everything is played and he tryes to change the room I get an error and it closes. What did I done wrong here?

What error message do you get?

Quote from: Random on Fri 05/09/2008 10:00:25
Also I would like to know how to make an intro from varius rooms. So that when the game starts first comes one room (black with writing on it) then when I click another one (like the one before) and then after that to put me actualy in the first room of the game?

Just make room-sized hotspots in the intro rooms and if they're clicked the player changes the room.

Something -18 and that the game had to close because of the problem. Also it says that the problem is probably in the scrpting rather then the game. Thats it.

One more question, if the intro room are not first made, can I still make them to come first when the game starts?  :-[
Title: Re: Problem with combyning items.
Post by: Matti on Fri 05/09/2008 10:47:56
Quote from: Random on Fri 05/09/2008 10:32:05
One more question, if the intro room are not first made, can I still make them to come first when the game starts?  :-[

Of course, the player can start in any room. Just change the number..
Title: Re: Problem with combyning items.
Post by: Random on Fri 05/09/2008 10:58:30
Ah the game crashed because I left return on the conversation instead of stop  :P.

Ty for the answers. Now I'm gonna try to find out how to make a char aproach me and start the conversation as I eneter the room and afterwards to exit the game :).

You can leave this thread open if I have some questions later :p.
Title: Re: Problem with combyning items.
Post by: Random on Fri 05/09/2008 21:52:41
Quote from: matti on Fri 05/09/2008 10:23:23

Quote from: Random on Fri 05/09/2008 10:00:25
Also I would like to know how to make an intro from varius rooms. So that when the game starts first comes one room (black with writing on it) then when I click another one (like the one before) and then after that to put me actualy in the first room of the game?

Just make room-sized hotspots in the intro rooms and if they're clicked the player changes the room.

Hey I tryed just that, but I set my char to start at the room , lets say 4 of 4. And because of that the game automaticly starts forom room 4. What shoul I do to make the first 3 rooms apear first without my char beeing on them?
Title: Re: Problem with combyning items.
Post by: Makeout Patrol on Fri 05/09/2008 23:07:16
Quote from: Random on Fri 05/09/2008 21:52:41
Quote from: matti on Fri 05/09/2008 10:23:23

Quote from: Random on Fri 05/09/2008 10:00:25
Also I would like to know how to make an intro from varius rooms. So that when the game starts first comes one room (black with writing on it) then when I click another one (like the one before) and then after that to put me actualy in the first room of the game?

Just make room-sized hotspots in the intro rooms and if they're clicked the player changes the room.

Hey I tryed just that, but I set my char to start at the room , lets say 4 of 4. And because of that the game automaticly starts forom room 4. What shoul I do to make the first 3 rooms apear first without my char beeing on them?

Set up your character to start in room 1. In the Room 1 editor window, look at the options on the right; somewhere, there's a boolean setting that toggles whether or not the character is visible in that room. Repeat this for the next rooms. Set it up so that when the player clicks, the game runs a character.ChangeRoom() function to get to the next screen.
Title: Re: Problem with making the game whole :p!
Post by: Random on Tue 09/09/2008 22:18:45
Ok, last queston now!
I made the game, now how do I do so i can export it in a say cd/usb. I tryed like it is now (after compile into game) but it wont work on an another pc.

Help me!  ;D
Title: Re: Problem with making the game whole :p!
Post by: Khris on Tue 09/09/2008 22:38:24
Seriously, RTFM!

Build the game (using the menu or the toolbar button), then copy the compiled folder inside the game's folder to the USB Stick and rename the folder (to your game's name).
In there is [gamename].exe, winsetup.exe (used to change the configuration) and the config file. Make sure you use winsetup.exe to configure the game settings properly before publishing it.
There might also be more files in there such as music.vox, movies, etc.

In short, the contents of the compiled folder is all another person will need in order to play the game.

(Note that you have to build the game before copying it to another location because certain changes in the editor will cause the exe to be deleted even if the game is saved afterwards.)