getting startet with a default game / different questions

Started by nuncio, Tue 04/09/2012 11:56:54

Previous topic - Next topic

nuncio

hi!
i'm new here and i'm trying to create a very small test-game, just to get startet with AGS.
i've been reading in this forum for two days now and i already found some answers to my questions. i also watched the complete video tutorial on youtube and read the tutorials on the AGS page.
i still have a problem with a few things and i hope someone here can help me.
first of all sorry, i'm not very familiar with posting into forums so i hope i didn't violate the forum rules. and i'm sorry if my english is not always perfect.

PROBLEM:
1:
i have a room where my player must put a cassette into a cassette player and i want a midi sound to play after he did it.
i already found out how to play a midi file (the tutorial seems to be older, the command for playing midis seems to have changed) and when the player puts the cassette in the midi file comes. this happens in room 4. but when i start the game in room 1 the midi file is running all the time from the beginning of the game as well.
2:
when the player puts the cassette into the player the inventory item "okassette" ist still there but i would like the cassette to disappear into the player, away from my inventory.
3:
i couldn't find out how to end the game. the aim of the game is to put on the cassette player. this is just a test game but i don't know how to make the game end at this point.

i hope you can help me and my questions aren't too stupid :D

Andail

Hello, Nuncio, yes your questions are very basic, and are all covered in the manual, but here are some tips:
1. You can tell the game to play a sound file at any moment, not only when the game starts, or the room loads. I guess you have a function for interacting with the casette recorder? Place the "play" command there!
For instance:
Code: ags

function oCasetterecorder_Interact()
{
aCasettemusic.Play ();
}



2. To remove an inventory item you use
cEgo.LoseInventory (iInventoryitem);

3. To end the game, look up the function QuitGame ();


Khris

Regarding 1., I remember having read that if you use the filename music0.mid, the file is going to play automatically from the beginning, even if you don't start the playback yourself. I don't know if that' still true for the current version of AGS though, with the sound system having been overhauled and all.

Also, it is recommended to put an "i" at the start of inventory items as opposed to "o" for room objects, so the name of the inventory item should be "iKassette", but that's of course up to you. It does help with not mixing up stuff though.

nuncio

Quote from: Andail on Tue 04/09/2012 13:38:33
2. To remove an inventory item you use
cEgo.LoseInventory (iInventoryitem);
ah, now it works!
Quote from: Khris on Tue 04/09/2012 14:08:30
Regarding 1., I remember having read that if you use the filename music0.mid, the file is going to play automatically from the beginning, even if you don't start the playback yourself. I don't know if that' still true for the current version of AGS though, with the sound system having been overhauled and all.
oh, that was the problem! i changed it into "music1" and now it works.
Quote from: Khris on Tue 04/09/2012 14:08:30
Also, it is recommended to put an "i" at the start of inventory items as opposed to "o" for room objects, so the name of the inventory item should be "iKassette", but that's of course up to you. It does help with not mixing up stuff though.
oh yes, i mixed it up. when i pick up the cassette as an Object it's "okassette" and when i use it as an Item it's "ikassette", sorry.

thank you for your fast help, now i'll try to make the game end after the music starts.

edit:
ah! "quitgame" works! now my testgame is finished! thank you very much!
--> i'm shure i'll have more questions for the next one, so i will post it into this thread here..

SMF spam blocked by CleanTalk