Allow player to do stuff while Wait is going, and custom inventory

Started by , Fri 04/06/2004 05:32:18

Previous topic - Next topic

PLZ HELP!

Is there a way to make it so the player enters the screen, and is able to walk around, look at things, etc. and then after a certain number of loops something happens? There are no commands like this in the manual. They all stop the game and set the cursor to a clock.

Another question:
I want to add an interact button to my inventory screen. I made a new button on the inventory GUI with a hand icon. In the window that pops up I specified for it to set cursor mode to 2. However, now if I test the game, that button is not included in the inventory window? Are there different inventory GUI's for different sizes of the inventory screen or something?
Please help if you can.

Barbarian

In regards to your "certain number of loops" question, this is probably what you're looking for:

"SetTimer
SetTimer (int timer_id, int timeout)

Starts timer TIMER_ID ticking - it will tick once every game loop (normally 40 times per second), until TIMEOUT loops, after which it will stop. You can check whether the timer has finished by calling the IsTimerExpired function.
Pass TIMEOUT as 0 to disable a currently running timer.

There are 20 available timers, with TIMER_IDs from 1 to 20.

Example:

SetTimer(1,1000);

will set the timer 1 to expire after 1000 game cycles"

...and:

"IsTimerExpired
IsTimerExpired (int timer_id)


Checks whether the timer TIMER_ID has expired. If the timeout set with SetTimer has elapsed, returns 1. Otherwise, returns 0.
Note that this function will only return 1 once - after that, the timer is placed into an OFF state where it will always return 0 until restarted.

Example:

If (IsTimerExpired(1)==1)
    {code here}

will execute the code if the timer 1 expires."



   For your GUI question, probably better to get advice from a more experienced AGSer than me (I'm still a bit of a "newbie" with scripts and GUI's and such).
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

Ashen

About the GUI thing: make sure AGS is set to actually use your GUI. By default, it uses a different, built in inventory window. You need to go into the global script, and change the stuff under 'function show_inventory_window ()'. Delete a few lines untill it looks like this:

function show_inventory_window () {
  // This demonstrates both types of inventory window - the first part is how to
  // show the built-in inventory window, the second part uses the custom one.
  // Un-comment one section or the other below.
 
  // ** CUSTOM INVENTORY WINDOW
  GUIOn (INVENTORY); 
  // switch to the Use cursor (to select items with)
  SetCursorMode (MODE_USE);
  // But, override the appearance to look like the arrow
  SetMouseCursor (6);
}

and hopefully it'll work.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk