problem with cursor and inventory bar not responding after loading saved game

Started by Grim, Tue 23/09/2008 23:52:46

Previous topic - Next topic

Grim

2 problems I have just encountered with AGS 2.72. Maybe someone knows a solution to these?


1. During a battle with an enemy character's inv item which is used as weapon gets knocked out of his hands every so loops number. In between the idea is that this item is used on enemy before he has a chance to attack. The problem is that if it's currently selected inv (and cursor changed to this inv graphic) character keeps that item and everything goes t*** up! What code should I put in rep_execute to prevent that from happening?

2. I'm using (see, I'm not completely sure here) either broken sword or left right click template. It's got this inventory bar on top with 2 blue arrows on each side for scrolling . The problem appears when game is loaded and moving cursor over those items in inv does nothing- doesn't display their names and doesn't react to clicking on them.  Clicking on the scrolling arrow brings everything back to normal and items work again, but I'd like to avoid player's confusion with that. It doesn't look very professional either. What should I do?

This game is nearly finished.... I desperately need your help, guys!

HammerBlade

Quote from: Grim Reaper on Tue 23/09/2008 23:52:46
1. During a battle with an enemy character's inv item which is used as weapon gets knocked out of his hands every so loops number. In between the idea is that this item is used on enemy before he has a chance to attack. The problem is that if it's currently selected inv (and cursor changed to this inv graphic) character keeps that item and everything goes t*** up! What code should I put in rep_execute to prevent that from happening?

Um...what?  ???

"During a battle with an enemy character's inv item"...It sounds like you're saying you use your item to click on an enemy's item (such as clicking on an image of your opponents sword with your own sword)?  I'd like to help, but you'll need to explain how your battle system works in more detail. 

Also, what do you mean by "everything"?  By "goes up", do you mean values of variables are increasing, or images on the screen are moving upwards?

Khris

"During a battle with an enemy, the character's inv item [...] and everything goes tits up" = doesn't work as intended.

Having settled that, in the timed event's code, check if the player's .ActiveInventory == item, then set mouse.Mode to eModeInteract or whatever before calling .LoseInventory(item);
That should fix that.

The second problem sounds like a bug, but could be sloppy scripting.
Without knowing which template/module exactly you're using, I can only suggest to try to out stuff in on_event(eEventRestoreGame), like dis- and reenabling the inv window or something similar to "reset" the behavior to normal.

Grim

Thanks. The first one I figured out myself last night and changing the cursor mode does the trick and everything works fine now.

I'll have a a look now at on_event(eEventRestoreGame) and try to experiment. But the major problem is solved. Thanks!

Dualnames

As for the 2 something seems to do this:
yourinventorywindow.Clickable=false;

and your arrows make it clickable again.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk