Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - xerca

#21
At first I thought I solved but today when I tried it with rooms with different musics it didn't work. I tampered with audiochannel functions so I found things that would work. I put them all in a "if" so that it works now!

So, when I want the "aBlueStone_Cave" music to play but if it was playing before, not to restart; I write this in the room_load function:
Code: ags

if(music==null || !music.IsPlaying || music.PlayingClip != aBlueStone_Cave){
music=aBlueStone_Cave.Play();}


Just write what music you want instead of BlueStone_Cave and paste it in the room_load function. Or you can write another function for it, which won't be hard.
#22
--- alright I don't know how but I managed to solve it... after a minute I wrote this. And I had tried to solve this for days before posting..... I also can't see any delete button so this post will stay here aimlessly ---


Hi everyone.
I want to play a music in some rooms but if the music is playing before getting in the room, I don't want it to start over; instead I want it to keep playing. In the last version of AGS we were able to select room musics and it used to automaticly play room music if it wasn't playing and continue playing if it was playing. Now we don't have that property so I tried to write "xx.play();" in the room's load function, however, it played from start either if it was playing or not.

After that I tried coding, but I couldn't make it. I tried things like using if with "null" or "false", vs.

For now I use this as a workaraound but it is not perfect really:
Code: ags

function room_Load()
{
  bluestone=aBlueStone_Cave.Play();
}

This is in the room which player starts.

Code: ags

function room_Load()
{
    if(bluestone.IsPlaying==false){ 
    bluestone=aBlueStone_Cave.Play();}
}

And this is in the other rooms with the same music. This works for now except when I go back to that first room, the music starts from beginning as expected. Also I didn't try to use another music in the game yet, so I don't know if it would cause any touble.


I beleive the problem has a simple solution because this is a basic need of a game. So I post this in the beginners forum. By the way, I read everything in the manual that is about audios, musics and sounds. I'm not saying I understood them all, though...
#23
Quote from: monkey_05_06 on Wed 06/10/2010 01:42:07
Is there a reason you would even need to use Move in BeforeFadeIn? Character.x and Character.y are writable as long as Character.Moving is false.
oh.. well. I didn't know that. they sound like very read-only to me. If I can do it, I'll write "solved" right away.

edit: Alright I did it. Thanks to anybody who have bothered reading my messages and answering them.
#24
Quote from: Gilbet V7000a on Tue 05/10/2010 04:35:04
I don't know what your "changing room in a more realistic way function" is about, but can you work around this by using on_event() with the event eEventEnterRoomBeforeFadein? Is this absolute necessary to have the dimension of another room known before changing to it?

I thought about using "player.move" in BeforeFadein but I don't know if it would work nice... Though I don't remember why I didn't try it.
#25
I don't know if I can explain it properly but it's a simple function:
Code: ags

function odadegis(int gidilen, int yon)
{
if(yon==1){
  player.Walk(player.x, 0, eBlock);
  player.ChangeRoom(gidilen, player.x, Room.Height);
}
if(yon==2){
  player.Walk(Room.Width, player.y, eBlock);
  player.ChangeRoom(gidilen, 0, player.y);
}
if(yon==3){
  player.Walk(player.x, Room.Height, eBlock);
  player.ChangeRoom(gidilen, player.x, 0);
}
if(yon==4){
  player.Walk(0, player.y, eBlock);
  player.ChangeRoom(gidilen, Room.Width, player.y);
}

So, what it does is; for example you have room1 and room2 which are next to each other. You write odadegis(2,2) at room_LeaveLeft() (2 for the room number and 2 for the direction 1-up, 2-left, etc.). If player walks off the left edge, this makes the player walk to room.width and then change the room to room2, x=0 y=player.y. There is no problem for this but when it comes to use room.width or room.height in player.ChangeRoom, I can't do it because I need the other room's values.

I wrote this code in a short time before going to bed so I didn't think if it was really correct or not but when I tested it while it worked in rooms with same width/height it didn't work with different widths/heights. At first I didn't use any function but when I added more and more rooms to the game I felt that I need a function.

By the way, I have another function which works well. I just write odayagir(); at room_AfterFadeIn() and it makes the player walk to mmm... I'll just paste it.

Code: ags

function odayagir()
{
if(player.x==0){ player.Walk(50, player.y, eBlock, eAnywhere);}
else if(player.y==0){ player.Walk(player.x, 110, eBlock, eAnywhere);}
else if(player.x==Room.Width){ player.Walk(Room.Width-50, player.y, eBlock, eAnywhere);}
else if(player.y==Room.Height){ player.Walk(player.x, Room.Height-50, eBlock, eAnywhere);}
}


So, those two functions were meant to work together to walk the player from room to room and not to just teleport him.

I'm sure a workaround could be found by thinking on it a little bit. I can of course add two more int variables to the function for width and height value of the next room so I can write them manually.. but it is not much easier than just copying or writing a normal code for that.

I'm not very good at programming... But I like to learn new things at it. Those are my second and third functions. The first one was another simple function and worked flawlessly :).

Sorry if I couldn't explain it properly because when I try to write in English it always gets longer and longer than it needs to be.
#26
:(. then my "changing room in a more realistic way function" will not work
#27
Hi. I tried anything I could to get the width and height of a room which is not the "current room"(so this means the player is not in that room), but I couldn't. Isn't there a way?

"room[1]" or "room(1)" doesn't work and I don't know what else I can do.
#28
The same thing started happenning to me after I upgraded to Windows 7.
#29
Quote from: SSH on Fri 10/09/2010 06:52:39
Quote from: xerca on Tue 07/09/2010 12:13:15
Yes I made three games using them. And thank you for your help with music.. CJ.

For further reading: http://americangirlscouts.org/agswiki/Chris_Jones
http://americangirlscouts.org/agswiki/Quentin
http://americangirlscouts.org/agswiki/Onion_Rings

Chris Jones, yeah. This name is really familiar. I knew this name. I think I'm just bad with abbreviations...
#30
I wish to use both lip sync and looped speech views at the same game for different characters.
#31
Quote from: CRxTRDude on Tue 07/09/2010 06:45:38
I think I just answered my question:

i made an if/then condition:

Code: ags

function cLuna_Look(){
   if (player.ID == cEgo.ID){
      cEgo.Say ("You're beautiful, Luna.)
   }
}


Is there no alternative code for this?
The main idea is this, yes. But you can make it a little bit more simple.
Code: ags

function cLuna_Look(){
   if (player == cEgo){
      cEgo.Say ("You're beautiful, Luna.")
   }
}


This will also work.. i think. I'm not sure if this reply was necessary... (by the way you were missing a ").
#32
Quote from: Gilbet V7000a on Sun 05/09/2010 10:27:32
Quote from: xerca on Sat 04/09/2010 22:24:56
I really wonder why everyone always call you CJ?

Awwww. Well...
Click his profile and see his log-in handle (not his nick) and...
Spoiler
CJ is the initial to his real name. You SHOULD have known this as you'll see it many times in the programme itself.
[close]
:P

I had looked at his profile before and didn't see that. Even after you said this it took a few minutes for me to see that "CJ"... I feel stupid.

But this actually explains everything :):
Quote from: Dualnames on Sun 05/09/2010 13:28:34
Gilbet, don't lie! ;)

CJ is an incantation of Satan. If we all type it more than 1.000.000 times, HE will come.

That's what m0ds told me. And that is I believe the truth.

Quote from: Pumaman on Sun 05/09/2010 14:39:02
Quote from: xerca on Sat 04/09/2010 22:24:56
By the way; I downloaded the program, installed it and uninstalled the old one. Then I tried opening one of my game projects and it gave an error because of some names like "view names" included letters like "ö, ğ, ı, ü, ç", etc. (I used that characters in names with no problems with the old version.) It didn't even give me a chance to change the names so I had to download ags 3.1 which I uninstalled 2 minutes ago... I installed it and changed these names in my games. There were hundreds of them so that I was becoming really mad because of clicking, checking for little letters in lots of names and changing them.

Hmm, these were working ok for you in 3.1.2? The reason this restriction was added to 3.2 was because people were having problems where the game wouldn't compile properly in that scenario.

Quoteedit: I deleted a music that I used for a room before and I imported another one to use. but as it writes at the first message, there is no room music thing anymore. So I called it from the after fade-in script. But now it says "Unable to find aMusic1 which was set as tihs room's start music".
How can it be set? There is no setting as room start music! So I can't change it either.

The music file must be there when you open the room for the first time in 3.2. So, put the Music1 file back, then do a Rebuild All Files. The editor will then automatically add a "aMusic1.Play()" line of script to the room script, which you can then remove/change/etc afterwards and you won't get the error any more.

This is because the Room Start Music setting has been removed, and now you can just add a line of script to do it instead.


Yes I made three games using them. And thank you for your help with music.. CJ.
#33
I really wonder why everyone always call you CJ? The only CJ I know is the one in GTA San Andreas...

By the way; I downloaded the program, installed it and uninstalled the old one. Then I tried opening one of my game projects and it gave an error because of some names like "view names" included letters like "ö, ğ, ı, ü, ç", etc. (I used that characters in names with no problems with the old version.) It didn't even give me a chance to change the names so I had to download ags 3.1 which I uninstalled 2 minutes ago... I installed it and changed these names in my games. There were hundreds of them so that I was becoming really mad because of clicking, checking for little letters in lots of names and changing them.

I can now finI really wonder why everyone always call you CJ? The only CJ I know is the one in GTA San Andreas...

By the way; I downloaded the program, installed it and uninstalled the old one. Then I tried opening one of my game projects and it gave an error because of some names like "view names" included letters like "ö, ğ, ı, ü, ç", etc. (I used that characters in names with no problems with the old version.) It didn't even give me a chance to change the names so I had to download ags 3.1 which I uninstalled 2 minutes ago... I installed it and changed these names in my games. There were hundreds of them so that I was becoming really mad because of clicking, checking for little letters in lots of names and changing them.

I can now finally try the new AGS.

edit: I deleted a music that I used for a room before and I imported another one to use. but as it writes at the first message, there is no room music thing anymore. So I called it from the after fade-in script. But now it says "Unable to find aMusic1 which was set as tihs room's start music".
How can it be set? There is no setting as room start music! So I can't change it either.

While writing this I tried again and it worked...

edit2: It works yes... But when I say rebuild all files, the same error occurs again.
#34
Thanks, I'm going to try it. It seems nice.
edit:Yeah it worked great! Thank you and thank Abstauber :).
#35
Well I'm not a really beginner in AGS but I think this could be kind of a beginner's question. If it's not, I'm sorry :-\.

I wanted to use a custom gui for displaying dialog options and created a gui. I drew a background image for it and tried it. The dialog options were at the right place but there was something like this:

And then when I go over that "second" or "upper" gui with mouse, it disappears like this:


Then I thought I should use text window GUI for it and tried that. It was nice with the borders and all but there was just no way to put that text window gui to another place from the middle of the screen. After that I searched about this in the forum(also I searched the manual before, too) but all I read was the similar things that is not about my problem. So I opened this topic. Please help me if you can.

Also I think that something should be done with the borders of the gui because it works much different with text window gui(which you have to set the images of all the corners and sides one by one). In normal gui, there is nothing like that so I just use a background image and it is normal not to work properly because the dialog option gui can't have a proper width and height. The manual doesn't explain how to make the gui, if it has to be a special way.

I read there are some ways to make a custom dialog options thing but I'm not good enough at programming to understand and make it  :-[
#36
I don't think I really understood what you are saying with my low english but I think I won't be able to do it.
#37
I wish I'm writing to the right forum because this is kind of a problem that I couldn't solve myself(I usually solve these kind of issues easily) but maybe for someone it's only a beginner's problem.

I want to use lip sync for one character in my game (which is my head in fact) but not the others. However when I use lip-sync it tries to use for every character and they look strange while speaking because I made the sprites like they should be looped in order. So can I make only one character use lip-sync while others use normal loops? And if yes, how?
#38
I created a new default game and exported it's gpanel gui to my game and deleted my game's original gpanel. It now works. I will re-edit it like the old one but I will check in every step so if the same error occurs i will be able to find out why. So, the problem is kind of solved.

By the way, thank all of you who helped me.
#39
I wonder if there could be any problems if I changed the texts of buttons and things?
#40
Quote from: Dualnames on Sun 17/01/2010 16:40:41
Try and open the gPanel GUI somewhere else, to see if it's something to dowith the GUI or just with the GUI coming up at that point.
Code: ags

if (keycode==eKeySpace) gPanel.Visible=true;

The same error occurs.
SMF spam blocked by CleanTalk