Author Topic: Briefly showing a full-screen picture?  (Read 6056 times)

0 Members and 1 Guest are viewing this topic.

Offline NTNgear

Briefly showing a full-screen picture?
« on: January 27, 2015, 08:04:58 PM »
Hey, I want to be able to briefly show a fullscreen picture during a cutscene without having to have it as the background of a separate room, so I figured I would show it as an animated object instead (loading a view, selecting a loop, etc). So I created a view with a cel large enough to fit the screen, but when I try to create an object with that cel the game will freeze. I've also tried separating the image into four smaller cels and creating four objects to sort of piece them together, but the positioning doesn't seem to be working right (at 0,0 it seems to appear towards the centre of the screen but not quite?) and yet again it sometimes freezes.

So yeah, i'm at a loss right now. How would you recommend briefly showing a full-screen image during a cutscene? I'm using AGI Studio and i'm a newbie (sort of learning as I go really).



Offline sact

Re: Briefly showing a full-screen picture?
« Reply #1 on: January 28, 2015, 06:14:50 PM »
You might want try following command, instead of using animated object to display static image

Code: [Select]
add.to.pic(VIEWNO,LOOPNO,CELNO,X,Y,PRI,MARGIN)
say

Code: [Select]
if (cutscene_block) {
  load.view(your_view);
  add.to.pic(your_view, 0, 0, 0, 0, 0, 0);
  discard.view(your_view);

 // code, print? or wait for player input
}

Though the following code could cause problems should you use it repeatedly when it might lead into issues with script buffer. To avoid that utilize f7 which prevents the interpreter from writing to the script buffer.

Code: [Select]
if (cutscene_block) {
  set(f7);
  load.view(your_view);
  add.to.pic(your_view, 0, 0, 0, 0, 0, 0);
  discard.view(your_view);
  reset(f7);
 
  // code, print? or wait for player input
}

Should you wish to restore the original picture in the background without new.room:
Code: [Select]
if (cutscene_block) {
  set(f7);
  load.view(your_view);
  add.to.pic(your_view, 0, 0, 0, 0, 0, 0);
  discard.view(your_view);
  reset(f7);
 
 // code, print? or wait for player input
 
  set(f7);
  load.pic(v0);
  draw.pic(v0);
  discard.pic(v0); 
  show.pic(v0);
  reset(f7);
}

More information:
http://wiki.scummvm.org/index.php/AGIWiki/Memory_and_Script#Script_Buffer

The issues with using multiple animated objects might be due to collisions with each other, horizon or possible blocks, and priorityscreen with priority 0 ( black) and 1 (dark blue) -  if you still want to pursue with multiple animated objects, make sure you utilize commands such as ignore.objs, ignore.horizon, ignore.blocks.
« Last Edit: January 28, 2015, 07:34:14 PM by sact »

Offline NTNgear

Re: Briefly showing a full-screen picture?
« Reply #2 on: January 28, 2015, 07:24:50 PM »
Hey sact, thanks for the advice.

I tried the add.to.pic command, which works nicely for showing the image, but unfortunately I don't think it's what i'm looking for. It seems to permanently replace the room until it's reloaded again, whereas I only want the picture to be shown briefly (as in, show the picture, display a few messages, then get rid of the picture again).

I tried going back to multiple animated objects, this time using the ignore commands. The results were much more predictable, but unfortunately the game the game stopped after the second object, throwing up a message saying "No memory. Want 260, have 225." Just so you know, when i'm trying this method I have the picture split into four blocks, each one 80x84 in size. I guess it's too much for AGI to handle?

Offline sact

Re: Briefly showing a full-screen picture?
« Reply #3 on: January 28, 2015, 07:54:31 PM »
Sorry, I updated examples in the my first post while you replied, you can redraw the original room with load.pic, draw.pic, discard.pic, possibly with script buffer blocked (f7).

Animated objects - Do you use single view that has all the parts of the picture for those animated objects? If so, it still requires plenty of memory. Try to split different parts of picture into own, separate views so you each animated object won't have to use so much memory.
« Last Edit: January 28, 2015, 07:56:36 PM by sact »

Offline NTNgear

Re: Briefly showing a full-screen picture?
« Reply #4 on: January 28, 2015, 09:23:18 PM »
Wow, thank you! That updated example worked perfectly, even without splitting the image into smaller cels!


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

Page created in 0.069 seconds with 22 queries.