Animate Inventory item

Started by Candle, Sun 02/10/2005 05:35:32

Previous topic - Next topic

Candle

Can you Animate Inventory item?
I have a torch that would look better if I could.

strazer

#1

Candle

What do I do with the file in the zip? I'm not sure how this works.

Ashen

Just import it into 'Module Manager' (on the 'Script' menu) and you should be good to go - assuming you've got 2.7 or later.

strazer, one thing:
Code: ags
if (IsGamePaused() == true) return 0; // if game is paused, quit function (no animation)

Wouldn't this mean the module won't work if the Inventory GUI is popup modal?
I know what you're thinking ... Don't think that.

Candle

#4
Thanks for clearing that up for me .
Edit
Where do I can the script part to use it? I can't seem to find any info on how to use it in the help file or I'm over looking it .

TheMagician

QuoteCode:
if (IsGamePaused() == true) return 0; // if game is paused, quit function (no animation)
Wouldn't this mean the module won't work if the Inventory GUI is popup modal?

I just tested the module and indeed it only works with the standard inventory GUI if this line is removed.

Apart from that you've created a very nice and useful module, Strazer!

I love the whole module-business with AGS!  :D

strazer

Quote from: Ashen on Sun 02/10/2005 22:51:40Wouldn't this mean the module won't work if the Inventory GUI is popup modal?

You're absolutely right. Thanks for the hint. I use it in my own game which has a non-modal inventory GUI, that's why I haven't noticed it.
Fixed version 0.90b is now up (just commented out that line).

Quote from: Candle on Sun 02/10/2005 22:56:08Where do I can the script part to use it? I can't seem to find any info on how to use it in the help file or I'm over looking it.

This module provides script functions written by me. Such script module functions are not built into AGS itself, therefore cannot be found in the manual.

To use the script module, import it into your game, as Ashen said, via menu "Script" -> "Module manager...". Then you have access to the functions detailed above.
Where you have to put the functions depends on when you want the animation to start/stop. If you want the torch to be animated right from the beginning of the game, put InvItemAnimation.Start in your game_start function. You could also, for example, start the animation only if the torch has been lit first (using lighter on torch or whatever).

Candle

Thank you strazer for all the help .

Ashen

Quote from: strazerFixed version 0.90b is now up (just commented out that line).

Perhaps you could replace it with something like if (gInventory.Visible != true) return 0; instead, although that might mean the user would have to edit the line, to point to whatever they called their Inventory GUI. It just seems a bit of a waste of time to be processing the animations, when you can't see the Inventory anyway.
I know what you're thinking ... Don't think that.

Candle

#9
EDIT I got it , it was a small t and not T
Works perfect thanks guys.



strazer

Quote from: Ashen on Mon 03/10/2005 00:21:08
It just seems a bit of a waste of time to be processing the animations, when you can't see the Inventory anyway.

Problem is, any character could have the item in his inventory and for all I know the user could have this character's inventory displayed on any GUI. It seems quite messy to automatically check all GUIs for an InvWindow containing the item. On the other hand I don't want the user to have to edit the module or specify what InvWindows to check or something.
So I think for simplicity's sake I'll leave it the way it is. I don't think the animation routines use that many resources anyway. If you disagree, feel free to modify the module to your needs.

SMF spam blocked by CleanTalk