Hello, I'll bring this problem again back as it seems it is still happening.
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 MenuQuote from: Crimson Wizard on Wed 07/06/2023 20:54:38Which exact behavior do you want to get?I want my character to have the standard view while he speaks, but without movement.
Quote from: Crimson Wizard on Wed 07/06/2023 20:54:38If you want to have no speech animation at all, then set SpeechView to 0.I have just tried and I get this error: SetCharacterView: invalid view number
Quote from: Khris on Sat 28/01/2023 13:28:42The propagandaPlay function will call .Play() two times if the channel pointer is null.Thank you, but I'm afraid I have already tried that before. If I do that then the second time I visit the room the audio is not being played.
Also, if the 2nd play command fails and the pointer ends up being null, you're calling SetRoomLocation on null, again causing a null pointer error.
I'd do this:Code: ags function propagandaPlay() { if(acPropaganda == null) acPropaganda = aSpeech_close.Play(); if(acPropaganda != null) acPropaganda.SetRoomLocation(866, 252); SetTimer(1, 1200); }
Quote from: Crimson Wizard on Mon 23/01/2023 23:29:58Is the question currently why do you need to check for null at all, or why Play returns null in that particular case?I was checking for null just for debugging, as I was getting a NullPointerException I just wanted to know if the AudioChannel is null before playing it.
Quote from: Crimson Wizard on Mon 23/01/2023 23:29:58I answered the first question, but I cannot answer the second without knowing more details about your game's audio, and particular circumstances.
AudioChannel *acPropaganda;
function propagandaPlay() {
if(acPropaganda == null) {
Display("Is null");
acPropaganda = aSpeech_close.Play();
}
if(acPropaganda != null) {
Display("Is not null");
acPropaganda = aSpeech_close.Play();
acPropaganda.SetRoomLocation(866, 252);
}
SetTimer(1, 1200);
}
function room_AfterFadeIn(){
propagandaPlay();
}
function room_RepExec() {
if(IsTimerExpired(1)) { //SPEECH
if(!acPropaganda.IsPlaying) {
propagandaPlay();
}
SetTimer(1, 1200);
}
}
function room_Leave(){
if(acPropaganda.IsPlaying && acPropaganda != null) {
acPropaganda.Stop();
}
}
Quote from: Crimson Wizard on Mon 23/01/2023 11:45:17- sound driver is not initialized;The rest of the room sounds are there being played.
Quote from: Crimson Wizard on Mon 23/01/2023 11:45:17- sound is stored in audio.vox, and audio.vox is missing;The audio clip is being played the first time the character enters in the room.
- engine failed to start the playback, because of unsupported format or another problem;
Quote from: Crimson Wizard on Mon 23/01/2023 11:45:17- could not find a spare audio channel, and other running sounds have higher priority.There are the same number of audio files played than the first time the character visits the room.
AudioChannel *acPropaganda;
function room_Load() {
acPropaganda = aSpeech_close.Play();
acPropaganda.SetRoomLocation(866, 252);
}
function room_Leave(){//Always exit from Station Out
if(acPropaganda.IsPlaying) {
acPropaganda.Stop();
}
}
function room_Load() {
acPropaganda = aSpeech_close.Play();
if (acPropaganda == null)
acPropaganda.SetRoomLocation(866, 252);
}
Quote from: Cassiebsg on Wed 11/01/2023 21:12:11Can you post the entire code in that function?Thank you. It seems to work with every view instead this one, and the sprites are fine. I'll try to create the complete view again to see if this solves the problem.
Maybe you changing it back in another function, or before the function ends?
Are you sure that you have the correct sprites assigned to the view?
I know, stupid question, but happened to me once that my character wasn't changing it's view, and after a long time trying to debug it, I found out that it was changing, there was just a wrong sprite in the view, and it was (by "luck") showing that exact sprite.
Another test you can do, is select another view that is completely different (any view, even if you transform Isaac into a blue cup - just make sure all loops are there and have at least 1 sprite.
Also, are you sure you are are looking at Isaac and not another character that looks exactly like him? (seen that happen as well)
(and now I can't stop thinking about The Love Boat...)![]()
![]()
Quote from: Crimson Wizard on Wed 11/01/2023 16:15:06Yes, the 583 exits. I tried to change the number of view and it works with any number, with the 100, 500, 582, even the 584. I'm going to delete the view and create it again to see if it is solved.Quote from: nightmarer on Wed 11/01/2023 16:03:45I am wondering if the engine gives some troubles when having more than x views in the game.
Does it work with any random view, like view 1, 2 etc?
Is it absolutely certain that view 583 does exist?
Sorry for stupid questions, I had to be sure.Code: ags Isaac.ChangeView(PLAYERVIEW);
Quote from: Crimson Wizard on Wed 11/01/2023 16:15:06Oh! I didn't know that. Intead of that I was written myself constants with it. Thank you!Quote from: nightmarer on Wed 11/01/2023 16:03:45I am wondering if the engine gives some troubles when having more than x views in the game.
BTW, I just wanted to mention, that you don't have to use raw numbers. For each View AGS generates a constant, which name corresponds to view's name in capital letters. For example, if your view is called PlayerView, then it will be PLAYERVIEW, and you can do:Code: ags Isaac.ChangeView(PLAYERVIEW);
Quote from: Crimson Wizard on Wed 11/01/2023 00:54:15Please tell, in which situation do you call this? What function; and are there any other view-related commands around these lines?Hello Crimson Wizard.
What happens if you use same command elsewhere, for instance, in game_start, or when starting some room which is easy to test, in "before fade-in" event?
Quote from: Khris on Wed 11/01/2023 07:31:17Yeah, in case you animated the character beforehand, don't forget to unlock the view again.Hello Khris.Code: ags Isaac.UnlockView();
Isaac.ChangeView(583);
Display("%d", Isaac.View);
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.066 seconds with 15 queries.