Problems with Title Screen and Inventory Cursors.

Started by , Wed 04/01/2006 09:35:05

Previous topic - Next topic

smorad

Hi
I've got two problems...

1.- I want to make a title screen at the beginning of the game but I dont know how to make the GUI invisible in that room (The title screen would be room 0 and my character starts in room 1).

2.- I need to know how can i change the cursor when you pick up an item of you inventory.
I already disabled the "dont use inventory graphics as cursors" in the General Settings, and in the Inventory Items section I tried "use sprite slot" but that option sets a single cursor for all the items in the inventory.
I want each item in my inventory to have its own cursor when it's selected, like what happened with the inventory in Space Quest 4 and King's Quest 6 (if I remember well).

I hope anyone can help me.  ;)

Ashen

1.
GUI.Visible property.
Turn them off in Player enters screen (before fadein) and on again in Player leaves screen.

For GUIs that popup on a keypress or mouse click (like a verbcoin), you'll need to disable them for that room. Either add on_key_press and on_mouse_click functions to the room to override the global ones or - much easier - add an if (player.Room != 0) check to the commands to turn them on, e.g.:
Code: ags

if (keycode==9 && player.Room != 0)   show_inventory_window();  // Tab, show inventory, but not in Room 0


2.
Huh? You want to have a different cursor for each item, but you've disabled using the item graphics? By default, AGS uses the grahics - if that box is checked, you're telling it to use a single graphic for all items. Was it already checked for some reason (e.g. you're using a template)?
Could you be a bit clearer about what you've done, and what you're trying to do (like, do you just want the cursor to look like the item does in the inventory, or is there a second 'cursor image' sprite for each item)?
I know what you're thinking ... Don't think that.

ManicMatt

I think they want to do what I've already done for my game, but they are trying to do it the complicated way. (If there even IS a way)

Quite simply, I drew a marker and paste that onto every item like this:



The reason for this was to have an exact cursor. Is this what you wanted?

smorad

thanks alot Ashen for the first one.

seems like i couldn't explain my problem with the cursors... what i'm trying to do is to have a second image sprite for each item, to use it for the cursor. That's why I disabled using the inventory graphics (and didn't work out)

strazer

That's not directly possible at the moment although like most things it can possibly be worked around with some effort, using a custom inventory window or whatever.

But it's on the Bug & Suggestion tracker, so be sure to add your comment.

Ashen

The work around is probably quite simple. (NOTE: This is off the top of my head, and untested.)

In repeatedly_execute, add a condition to change eModeUseinv's cursor graphics, depending on the ActiveInventory:
Code: ags

if (player.ActiveInventory == iKey) mouse.ChangeModeGraphic(eModeUseinv, 60);
else if (player.ActiveInventory == iCup) mouse.ChangeModeGraphic(eModeUseinv, 61);
// ... etc


Now, if you've got a lot of items, that could get pretty bogged down. You could use Custom Properties to set the 'cursor graphic' for each item, and use something like:
Code: ags

// Again, in rep_ex
if (player.ActiveInventory != null) {
  mouse.ChangeModeGraphic(eModeUseinv, player.ActiveInventory.GetProperty("Cursor")); // Or whatever you named the property
}


EDIT: Leave the Inventory graphics disabled, or it won't work. Otherwise, I tested it (briefly) and it seems to work OK.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk