Problem with making the game whole :p!

Started by Random, Thu 04/09/2008 22:30:05

Previous topic - Next topic

Random

(see last post)!  ???

TwinMoon

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:

Code: ags
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:
Code: ags
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.

Khris


Random

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?



Matti

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.

Random

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?  :-[

Matti

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..

Random

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.

Random

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?

Makeout Patrol

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.

Random

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

Khris

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.)

SMF spam blocked by CleanTalk