Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Topics - Mr Games

Pages: [1]
Sorry this is a super-beginner question,

Every time I've created a new variable I've made it a Global Variable, because I was thinking that if I created an int or bool at the top a room script, it would return to that value every time that room is entered.

For example, if I stated at the top of a room:
Code: Adventure Game Studio
  1. PineapplePizzaIsTasty = true;
and an event in that same room caused that value to become false, but I left the room and came back, would it not read the original statement and make it true again?

I'm just trying to get my head around how this works.

Hi everyone

I've started a mini "boss fight" where clicking on the Succubus causes her to "teleport" (with object.SetPosition) but for every instance there is a timer. If any of these timers expire the player is sent to room 38 (game over.)

I'm stumped because the first timer is working, but after the initial click (which I intended to stop the first timer and start the second) nothing happens. Here is my code:

Code: Adventure Game Studio
  1. // room script file
  4. Timer *succubTimer0;
  5. Timer *succubTimer1;
  6. Timer *succubTimer2;
  9. int showdown = 0;
  12. function room_AfterFadeIn()
  13. {
  14.   succubTimer0 = Timer.StartRT(3.0);
  15. }
  18. function room_RepExec()
  19. {
  20.   if (Timer.IsExpired(succubTimer0)) {
  21.   cSmileyface.ChangeRoom(38);}
  22.   if (Timer.IsExpired(succubTimer1)) {
  23.   cSmileyface.ChangeRoom(38);}
  24. }
  27. function oSuccubus_AnyClick()
  28. {
  29.   if (showdown == 0) {
  30.   Timer.Stop(succubTimer0);
  31.   oSuccubus.SetPosition(1528, 407);
  32.   showdown += 1;
  33.   succubTimer1 = Timer.StartRT(2.0);}
  34.   if (showdown == 1) {
  35.   Timer.Stop(succubTimer1);}
  36. }

Apologies in advance for being a total noob. I'm learning all the time!

Hi guys :grin:

I initially couldn't get the timer to work and found a thread where another user had the same issue.
Here I discovered Crimson Wizard's Timer Module and imported the script. But my timer still isn't working.

Code: Adventure Game Studio
  1. Timer *chickenTimer;
  3. function room_AfterFadeIn()
  4. {
  5.   chickenTimer = Timer.StartRT(5.0);
  6.   if (Timer.IsExpired(chickenTimer)) {
  7.   cSmileyface.ChangeRoom(15);
  8.   }
  9. }

I want to change room when the timer expires, but as far as I can tell there's nothing wrong with my code. Am I missing something?

Hi all,

I'm already aware that text overlays are removed when the player changes room:
...except that with this command the text stays on the screen until either you remove it with the Remove command, or the player goes to a different room, in which case it is automatically removed.

When I first read this I mistakenly assumed it just meant remove from sight. Now I see that returning to a room I cannot get that text to reappear.

Just to clarify, is it possible to recreate the overlay (via whatever triggers it) every time that room is revisited? Or is this counter-intuitive?

I have made a serious effort to solve this problem by myself.

I've created a custom inventory that appears when a button is clicked, and the item is showing up correctly after acquisition.
However, clicking on the item does not change the pointer to its cursor sprite.

For the inventory GUI I'm just using the code from the DemoQuest template

Code: Adventure Game Studio
  1.    function ShowInventoryWindow() {
  2. //
  3. // This function opens the inventory selection GUI.
  4. //-------------------------------------------------------------------
  5.         mouse.Visible = true;
  6.         gGui1.Visible = true;                                           // Show custom inventory window
  7.         mouse.Mode = eModeInteract;                     // switch to the Use cursor (to select items with)
  8.   mouse.UseModeGraphic(eModePointer);   // But, override the appearance to look like the arrow

From the item itself (iRatSkull) I created an event linked to this function

Code: Adventure Game Studio
  1. function iRatSkull_Interact()
  2. {
  3.   cSmileyface.ActiveInventory = iRatSkull;
  4. }

Is there something obviously wrong here? :(

Hi all,

So I'm shelving my cycle-through-item cursors-without-GUI idea, only because I don't have enough experience to script it properly.

I created a GUI for an item inventory and made a button with a cross to close it. However, it won't disappear for some reason.

My script (located in Global script)

Code: Adventure Game Studio
  1. function CloseInv_Click(GUIControl *control, MouseButton button) {
  3.   gGui1.Visible = false;
  4. }

CloseInv is the name I gave to the button for closing the window.

Since it won't disappear, I'm wondering if there's a clash with the button I used to make it visible in the first place?

Code: Adventure Game Studio
  1. function OpenInventory_AnyClick()
  2. {
  3.   gGui1.Visible = true;
  4. }

Hi everyone,

I am making a game that initially has 2 mouse modes active (interact and look)

I would like to make it so that item cursors will be added to the cycle of available cursors, once said item has been added to the player's inventory, bypassing the need for a GUI inventory.

I have tried to piece together how to do this on my own but I am not good at scripting and would be grateful for any pointers (no pun intended) on how to approach this.

Pages: [1]