Author Topic: Bad animated object  (Read 4058 times)

0 Members and 3 Guests are viewing this topic.

Offline Nick Sonneveld

Bad animated object
« on: March 04, 2002, 03:54:43 PM »
Quote
My interpreter is giving me a Bad anim.obj(x) error message every time I enter a particular room.  I've tried initializing the animation inside the if(new_room) { ... } scope as well as outside, yielding the same result.  No other animations have yielded this error message more than once or twice.  I'm initializing exactly as it is shown in the help file.  The object is defined in the object editor, and I'm using the correct object code (o19).  The view is defined.  All I want is an animation of a spinning eye ball, and yet, I am denied!!

Aaaaargh!

« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »


Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Nick Sonneveld

Re: Bad animated object
« Reply #1 on: March 04, 2002, 03:55:55 PM »
Can you paste the code that you used to animate this object?

If you're setting the loop or cel, make sure that it exists in the view resource.

- Nick
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Andrew_Baker

Re: Bad animated object
« Reply #2 on: March 04, 2002, 04:58:03 PM »
// ****************************************************************************
//
// Logic 81: Talking with Baron Samedi
//
// ****************************************************************************

#include "defines.txt"

if (new_room) {
 load.pic(room_no);
 draw.pic(room_no);
 discard.pic(room_no);
 set.horizon(37);

 // The next 6 lines need only be in the first room of the game
 /*if ((prev_room_no == 1 ||    // just come from intro screen
     prev_room_no == 0)) {    // or just started game
   position(ego,120,140);
   status.line.on();
   accept.input();
 }*/

// Check what room the player came from and position them on the
// screen accordingly here, e.g:
// if (prev_room_no == 5) {
//   position(ego,12,140);
// }
 position(ego,140,139);
 ego_dir=0;
 draw(ego);
 show.pic();
 animate.obj(o19); // <----I tried animating it here (in the new_room scope)
 load.view(19);
 set.view(o19,19);
 position(o19,74,60);
 draw(o19);

}

/*animate.obj(o19);//<-----I also tried initializing it here and left it as a comment field
 load.view(19);
 set.view(o19,19);
 position(o19,74,60);
 draw(o19);*/

if (said("look")) {
 print("The Baron looms tall above you.");
}


if (ego_edge_code == bottom_edge) {     // ego touching left edge of screen
 new.room(9);
}

return();

That's all of it.  I just double-checked, and the correct view resource is present and accounted-for.
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »
I hope you realize that one day I will devour the Earth.

Offline Nick Sonneveld

Re: Bad animated object
« Reply #3 on: March 04, 2002, 06:08:06 PM »
doI think I know what the problem is now.  AGI Studio supplies an object file with the template game.  The object file, for some strange reason, also defines the maximum number of animated objects.  I can't remember what the number is for the template game, but I think it's 16 (off the top of my head).

AGI Studio doesn't let you change this unfortunately!  but if you want to delve into a hex editor, I'll tell you which byte to change:

byte 2 - change to 20 (0-19 is twenty objects).  this is 0x14 in Hex.

If you need help on how to do this, I'll try and knock up a program to do it for you.  This is definately something to add to AGI Studio (Nailhead?)

Update: sorry, this is wrong.. the object file is encrypted as well.  .. you'll have to XOR the number with 0x69 (this is character 'i').  

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Nick Sonneveld

Re: Bad animated object
« Reply #4 on: March 04, 2002, 06:10:37 PM »
If you want to make the number bigger than that.. that's fine.  Gold Rush had a large number.  But it will take up important heap space which means you won't have as much room for loading other resources.   Don't worry about performace, I think today's computers can handle it. :)

Do you need 20 animated objects at a time?

- Nick
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Andrew_Baker

Re: Bad animated object
« Reply #5 on: March 05, 2002, 09:00:41 AM »
I feel like I'm missing something.  I don't need 16+ animations on the screen at once, just in the whole game.  Can I reinitialize animated objects with different views if they are in different rooms?
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »
I hope you realize that one day I will devour the Earth.

Offline Nick Sonneveld

Re: Bad animated object
« Reply #6 on: March 05, 2002, 10:45:56 AM »
The point I was making was that, in the tutorial game, you can only have 16 animated objects - o0 to o15.  So you might as well reuse them whenever you change into a new room.  The ego HAS to be o0 but it doesn't matter if another character uses o4 in one room and o5 in another (unless you've got another logic code that you're calling that refers to a certain object number)

- Nick
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Andrew_Baker

Re: Bad animated object
« Reply #7 on: March 05, 2002, 03:10:35 PM »
Well, that certainly clears up a lot of confusion.  Now, I can fix all the bugs in VG:QotD...  but give me a week or two, I've worked non-stop on that game for two weeks.
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »
I hope you realize that one day I will devour the Earth.

Offline Andrew_Baker

Re: Bad animated object
« Reply #8 on: March 06, 2002, 09:53:55 AM »
Okay, I went back and changed all the anim.obj numbers so they were less than 16.  Now all my anim.obj's work just fine.  Of course, now that I know how to do this, I'm going to have to do a complete rewrite of Voodoo Girl.
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »
I hope you realize that one day I will devour the Earth.

Offline Chris Cromer

Re: Bad animated object
« Reply #9 on: March 06, 2002, 10:38:06 AM »
Hey Nick what is the maximum number of animated objs that AGI can have on the screen at once? Maybe you could send me that hex utility and I could make my templates object file support more on screen animated objects. I don't beleive I would set it to the max but maybe to about 20 or so objects.
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.053 seconds with 21 queries.