SetObjectView error

Started by Kinoko, Thu 18/03/2004 13:24:17

Previous topic - Next topic

Kinoko

I have an object in a room that I want to animate. The object in this room is 0 and the view I want to give it is 101, so I have

SetObjectView (0, 101);

in the room's "before fadein" interaction editor.

This worked FINE when I tested the room on it's own but when I go through the game normally and get to the room, it crashes before the room loads with an error: SetObjectView - Invalid view number used.

I just can't make any sense of it, the view isn't used -anywhere- else in the game until this point.

SSH

You really have 101 views? Wow! Or do you mean sprite number in which case you want SetObjectGraphic instead!

How did you test the room on its own, btw? Do you mean jumping to it with a debug key (CTRL-X is teleport, isn't it?)

Also, in the latest version of AGS yopu can give views names: maybe you could use the view name to make sure you get the correct number.
12

Darth Mandarb

Did you use the same spacing in the script as well?

Maybe try to remove the spaces:
SetObjectView(0,101);

Not sure though.

~ d

Ghormak

Spacing shouldn't make any difference at all, so that can't be it.

I have no idea what the problem could be. I think it's one Pumaman himself would have to take a look at.
Achtung Franz! The comic

Kinoko

Yep, I have a bit more than 101 views so far. Like Ghormak said, the spacing shouldn't make any difference however I -did- try it out of desperation anyway, and it did nothing.

By testing the room on it's own I mean making that room's number the starting room for my main character.

... I still have no idea what could be wrong so it's hard to know what more information I could give.

Baron

Question: Are you using the new AGS version 2.6?

Because I was having trouble with View 11 on my new game.  I fiddled with it a bit -changed the View to a number under 10, saved it, tested it, and then changed it back to 11 and it worked... :-\
    I never experienced this problem with the old version, but just this evening the same thing happened with View 12.  The only significance of the number 10 I can find in the whole game is that it is the possible score -I don't suppose your game is out of 100?  I have ABSOLUTELY no idea how the two could possibly be connected, but it's my only idea so far.

Gilbert

Hmmm did you try changing that 101 to something else and retest and see if there's still a crash?

Judging from the discussions, I think it's quite possibly a bug, but maybe we can do some more testings on it.

Kinoko

#7
I'm using v2.6. I tried changing the view to something else and I got the same error with view 103.

I just tried starting in that room (as I did before, and it works fine) but then leaving the room, then re-entering ... it works fine. So it's not just the act of entering this room that's causing the error. It's something to do with playing the game normally up to this point that's causing some conflict. I can't think what, and the fact that view 103 causes the error too just gives me even less of an idea.

The problem with this is that this is one of the last rooms you enter in the whole game @_@ So it makes trying to find some sort of conflict -extremely- difficult.

EDIT: I just tried something else. I set the object view to 97 and loaded a saved game that cuts out a lot of the initial game, but is still way before this particular room is playable. This time when I entered the room, the room loaded (which was amazing in itself) and seemed to be working fine. After about 2 or 3 seconds, it quit and gave me a new error:
SetObjectView: You said 102, max is 99.

This is weird because I didn't say 102, I told it 97 (though I suspect that it was using a saved game that screwed that up), and also because the max number of views as far as I know it is 400! I'm starting to suspect that this is indeed a bug.

Gilbert

Hmmm what I meaned is, try testing with a lower view number, I guess it's possibly caused by some bugs or memory management thingies that somehow it couldn't recognize views > 100

Hopefully it's not something which cj forgot to fix when increasing the engine view limit.

Kinoko

Is it looking like I may have to transfer my entire game over to a newer version? *death*

Gilbert

#10
Changing it to a new version may not help, you can try though.
Just BACKUP the game, and try to recompile the game with a newer AGS version, and if the error's still there, you can safely use the backuped files and use the former ags version if you like.

--EDIT--
I just noticed that starting from V2.6 you can assign script names to views, try assigning the view with a name, and use that script name in your code and see if it makes any difference (though I think not...)

Baron

OK, I'm at school now, but from memory this sounds very familiar, only it happened with views over 10 using Version 2.6.  I tried using View 11 something like this:

SetCharacterView (ASM, 11);

and that crashed the game with a message that the system only supported 10 views, which I knew wasn't true because my first game had over 30 (but on the old version).  I was just on the verge of reporting the error to the forums when I decided to fiddle (just in case it was MY fault I wanted to make sure).  So I changed the character view to something less than 10 (thinking it would be supported):

SetCharacterView (ASM, 2);

Saved the room & the game, tested it, and it worked fine (except ASM looked a bit funny!).  "Got it!" I thought.  But then just to get the exact error message I changed the view back:

SetCharacterView (ASM, 11);

Saved the room and the game, tested it, and would you believe it?  It worked!  So I blinked twice, thought I was too tired, and made a mental note to check the technical forum regularly to see if anything like this turned up.

Now, as I said the problem recurred with View 12 last night, but I got a different error message, more similar to yours, making me think that it was a different problem thus requiring more fiddling...

Hope this detail helps!

Pumaman

This problem has been reported before, on and off.

The first thing to do is delete your game's Compiled folder, then load your game into the editor and save it. This should re-create the Compiled folder with a completely fresh build of the game.

If that doesn't help, would it be possible to upload a version of the game that is experiencing this problem?

Baron

#13
Deleting the compiled folder and resaving the game seems to have worked.  Thanks a whole bunch: it would have to have been a much shorter game otherwise!

Kinoko

Yep, it worked for me, too! Thanks a lot ^_^

SMF spam blocked by CleanTalk