Some Questions dealing with music and gui [Solved]

Started by Lionheart, Tue 14/06/2005 18:33:55

Previous topic - Next topic

Lionheart

I looked around but couldn't find any answers to these questions, not to mention I have no scripting knowledge what so ever.

Ok so the first question i had was how can i  put 2 screens in the game, as an introduction? I want the first screen  to appear and say the name of the team that makes it, then fade and then another screen appears and it shows the title of the game, and then fades to the main title screen where you can Start Game and Load Game.

How can i do that? I tried making them as rooms with the character invisible and then i tested the game and the gui bar was there and sort of messed it up, not mention i wasn't sure how to automaticaly fade into the next screen.

and Question #2 was, how do i add a sound effect/music into a room, is there a script i have to know and put it in somehow? because i am totally clueless.

Sorry for these newbish questions but i am sure i'll get the hang of it eventually..

Thanks in advance.

Akumayo

Answer 1:  I did something similar to this when I entered last year's july mags.  I used objects rather than new rooms, (btw, change your GUI to a popup-modal and turn it off when the game starts).  Anyway, make objects that are your game's resolution, then show them one at a time with simple Object On and Object Off commands.  Then, when they are all off, your main menu (the actual room background) will be visable.  (At this point turn the GUI back on)

Answer 2:  I think there's a child function for play music, stop music, etc.  But I'm not good with music so someone else would be a better answerer to this one.
"Power is not a means - it is an end."

Lionheart

Ok i sort of see what your saying, but how do i turn the GUI off momentarily, and how do i do the object on and off commands?


Akumayo

The only way I know how to do it is with a TINY bit of scripting so bear with me and at least try this okay?

First!  Make your title screen a room,
Second! make object 1 a picture of the game title and set it so that it lays on top of the room, make object 0 a picture of the team that makes it and set it so that it lays on top of the room, and change the name of your GUI to INTRO. 
Third!  In the GUI editor, go to where it says "popup-modal, popup-y-pos, constant, etc" on your INTRO GUI and set it to popup-modal.
FOURTH!:  Under First time player enteres screen, go to Run Scipt at the very top of the function list, a window will open, insert the following:


ObjectOff(0);
ObjectOff(1);
GUIOff(INTRO);
ObjectOn(0);
Wait(200);
ObjectOff(0);
ObjectOn(1);
Wait(200);
ObjectOff(1);
GUIOn(INTRO);



The code above will display your Team object for 5 seconds, then your Game Title object for 5 seconds, then will show the main menu and the INTRO GUI.

"Power is not a means - it is an end."

Lionheart

#4
Thanks, i'll have to try that..

Another Problem i am having now is with the GUI, i can't seem to get the talk box to fit correctly, there are always blue lines on the top, and its the same size as the other default ones. I measured it at 32/27.

http://www.2dadventure.com/ags/Grr.JPG

Akumayo

Simply move the button up one pixel, that should eleminate the blue line (btw), next time add a link to a screen image this large to avoid taking up forum space.
"Power is not a means - it is an end."

strazer

QuoteAnother Problem i am having now is with the GUI, i can't seem to get the talk box to fit correctly, there are always blue lines on the top, and its the same size as the other default ones. I measured it at 32/27.

It looks like your new icon has a transparent background, showing the GUI beneath. And since the GUI has the border color set to blue, you see the blue lines.
Set the GUI's border color (/foreground color) to 0 to remove the blue border.

Lionheart

#7
wow thanks strazer, its fixed.

and i couldn't find where you were talking about with the room script, so i went under room and went to edit room script, and copied and pasted it and it said there was a problem with it

it said error 2: parse error object 2 or something like that.

strazer

You can't just put the script somewhere into the room script. It has to be inserted into a function:

Quote
FOURTH!:  Under First time player enteres screen, go to Run Scipt at the very top of the function list, a window will open, insert the following:

Room Editor / Settings -> "i" button -> Right-click "First time player enters screen" -> "New action..." (or double-click if it's the first action you add) -> "Run script" -> "Edit script..." -> NOW paste the code -> Ok ok ok ok etc.

Press the room script button ("{}") again and you will see that a function named room_a or something has been created by the interaction editor and your code is contained in there.

Lionheart

#9
http://www.2dadventure.com/ags/Error.PNG

Thats what the screen says, when it gave me an error, and i did what you guys said.

The Objects are on top of the title and the script  is on the new player thing.

Heres what it says:
// room script file

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
  // script for Room: First time player enters screen
ObjectOff(0);
ObjectOff(1);
GUIOff(INTRO);
ObjectOn(0);
Wait(200);
ObjectOff(0);
ObjectOn(1);
Wait(200);
ObjectOff(1);
GUIOn(INTRO);
}
#sectionend room_a  // DO NOT EDIT OR REMOVE THIS LINE

strazer

If you're using AGS v2.7 and have "Enforce object-based scripting" checked in the General settings, you won't be able to use old-style functions.
So either use
  object[0].Visible = false;
instead of ObjectOff(0);
or uncheck "Enforce object-based scripting" in the General settings.
Using new-style coding is recommended though. You can enter old function names in the search box in the help file, it redirects you to the new commands.

Lionheart

Alright it works,

now i just have to try and figure out how sound and music can be added?

do you know how to add that in?

Thanks to both of you for your help by the way.

strazer

#12
No prob. :)

Check the BFAQ for all your newbie needs: AGS Beginners FAQ

manny.p

1. is there anyway to ignore a function just for one room?
    (like the gui that appears at the bottom of the MI2 template)

2. How can i make my character invisble in the starting room?

strazer

1. Do you mean you want the GUI at the bottom not to show in a specific room?
If so, just turn it off when entering the room ("Player enters screen (before fadein)" interaction) and on when leaving the room ("Player leaves screen" interaction).

2. Have you tried the "Hide player character" checkbox in the room settings?

manny.p

Found it

Lionheart

Ok so i am trying to add music into my game now and i followed the instructions to the best of my ability..

i put the midi file into the game folder

then i renamed it MUSIC1.MID

then i went into interaction editor, and then went to play music when player first enters screen and put in 1 for the number.

i started up the game, and i hear nothing..




Gilbert

Is it possible that explorer of your computer was lamely set up to 'hide known file extensions' (yes I know it's probably the default setting, but it surely is lame)? if that's the case it's possible that you had actually named your file:
MUSIC1.MID.MID

Lionheart

Quote from: Gilbot V7000a on Thu 16/06/2005 02:45:24
Is it possible that explorer of your computer was lamely set up to 'hide known file extensions' (yes I know it's probably the default setting, but it surely is lame)? if that's the case it's possible that you had actually named your file:
MUSIC1.MID.MID

WOW!!!! It Works!!! Thank you so much i am in your debt..

i have tried for hours to get it to work and now it does, that relieves a lot of stress..

Thanks to everyone who has helped me, now i can work on my game some more.

manny.p

Got 2 questions.

1. How do i make a gui non default?
Because if i create a new room my main menu gui pops up, when i only want it to pop up when i tell it to ie. my intro

2. How do i change room, without taking that room settings with it?
I change from room 1 to room 2 still having the gui[5].Visible = false; function activated, i just want to stop all commads given up to room 1 when entering room 2.

SMF spam blocked by CleanTalk