Problem with AGS 2.7 function archives

Started by , Thu 19/05/2005 13:54:28

Previous topic - Next topic

Ollyrich

Hi there!

I am trying to save a game position with SaveGameSlot:

function SaveOption4_Click(GUIControl *control, MouseButton button) {
Ã, 
Ã, Mysavegui.Visible = false;
Ã, theSlot=100;
Ã, StrCopy(input, "file1");
Ã, SaveGameSlot(theSlot, input);

}

I also want to recreate the image of this game position on a button:

buttonSprite[0]=DynamicSprite.CreateFromSaveGame Ã, (100,50,50);


However, the image created is not of the game but of the Save GUI ( Mysavegui). I think this may be because Ã,  "Mysavegui.Visible = false"
doesn't actually switch the GUI off (although it is no longer visible).
Is this the case? Another problem is that AGS 2.7 don't appear to support
GUIOn and GUIOff. Is there anything I have to do to change this.

Thanks.

Ashen

GUIOn and GUIOff have been replaced by the GUI.Visible property, so you shouldn't need to be able to use them - why do you want to?
However - and I can't say for certain in the most recent ones - the earlier versions of 2.7 would allow you to use the 'old' script commands as long as you haven't checked the 'Enforce object-based scripting' box on the General window.

For your main question, though - try adding a Wait(1); after Mysavegui.Visible = false;. I had a similar problem in 2.62, and that cleared it up.
I know what you're thinking ... Don't think that.

Ollyrich

Thanks alot Ashen, that worked! It had been bugging me for a while, so cheers.


Pumaman

Yes, this is because although setting Visible to False does switch the GUI off, the screen is not actually repainted until the next game loop.

If you save the game in the meantime, the screen won't have been refreshed without the GUI, so you'll get a copy of the save GUI in your saved image.

SMF spam blocked by CleanTalk