Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Creator

#61
Or if the changing room fade is too fast, you can use FadeOut() (Look in manual, as fadeout has a parameter) in the credits room, then change to starting room, then FadeIn() (again, look in manual due to parameters).
#62
There's no problems I can see there, but maybe you have code in your room scripts or repeatedly_execute that block the game when the mouse is clicked on something, or just clicked in general?
By the watch cursor, do you mean wait mode (the one that resembles the little watch/clock)?
#63
As Crimson Wizard said: It's unused space. Unused space cannot have a coordinate since it's not part of the room. Everyone has this when importing a room. It's normal.
#64
I knew about extender functions, but I didn't know you couldn't do the same for variables (I thought you could do something like "extender variables" I guess :P). Thanks Crimson.
#65
I want to make my character have a boolean called IsInventoryFull (as I want him to only carry one item), and I want to be able to use it like this.

Code: ags

player.IsInventoryFull = false;

if (player.IsInventoryFull == true)
{
  //do stuff...
}


I tried (in the GlobalScript header)
Code: ags

bool IsInventoryFull(Character*);


But it expects curley braces. How do I do it?
#66
Whenever eBlock is used, it blocks every other scripts (except those is repeatedly_execute_always) until that line of code is finished. In this case, the region codes will not run until the character reaches their destination.

What exactly happened when you used Khris's code, and where did you put it?
#67
General Discussion / Re: YAY RAIN!
Mon 31/05/2010 13:46:39
I also live in South-East Australia, but what is this unknown substance called "rain" you speak of?
#68
Quote from: Gilbet V7000a on Tue 25/05/2010 09:21:53
I meant their Y coordinates

Oh yes, of course. Both portals are at the same Y co-ord. I'll just have to copy-paste the X co-ord from the code for the indicator, as that contains it. Thanks again Gilbert.
#69
No. Blue and orange are on the opposite sides of the screen. I'm going to try my best to make sure the portals never overlap.
#70
Yeah, another problem now.  >:(

I'm making a Portal-type game, but the character won't transport from the blue portal to the orange, only the orange to blue.
I've marked part of the code below that doesn't work:

Code: ags

//Code is in on_key_press
  if (keycode == eKeyT)
  {
    if (cIndicator.Loop == 3) //indicator is green
    {
      FadeCharacterOut_NoBlock(player, 100, -2); //Fading things non-blocking module related
      Wait(80);
      if (player.Loop == 0)
      {
        player.Loop = 3;
      }
      else if (player.Loop == 3)
      {
        player.Loop = 0;
      }
      if ((player.y >= cOrange.y) && (player.y < cOrange.y + 30)) //This always runs
      {
        player.x = cBlue.x;
        player.y = cBlue.y+1;
      }
      else if ((player.y >= cBlue.y) && (player.y < cBlue.y + 30)) //This never runs
      {
        player.x = cOrange.x;
        player.y = cOrange.y+1;
      }
      FadeCharacterIn_NoBlock(player, 0, -2);
      Wait(40);
    }
  }


When you're standing next to the blue portal and press T, it doesnt transport you anywhere. You fade back in at the blue portal.
#71
Thanks Gilbert, that worked.
I was thinking GetViewPort, but forgot and didn't try it.
I also thought about using a GUI right after submitting the post. I'll experiment with both for while and see which works better.
#72
I'm trying to lock a character to a certain point on the screen as a indicator. It changes colour in certain conditions so the player knows they can do something. The best example I can think of is the question mark in Trilby's Notes. It's always at the top left (or top right) of the screen, even in scrolling rooms (which my first room is).

I tried this:
Code: ags

cIndicator.x = System.ScreenWidth - (System.ScreenWidth - 20);
cIndicator.y = 50;


But that put him at the actual rooms 20, 50.
#73
Quote from: Ryan Timothy on Fri 30/04/2010 20:57:06
There's a bad error report when you miss the double equals sign with Random, like so:
Code: ags

if (Random(3)=1) {
}


It results in the error message:
Quoteexpected semicolon after ')'


I'm pretty sure you can only use random with a variable.
EG.

Code: ags

int ran1 = Random(3);

if (ran1 == 1)
{
}



May be wrong, so if I am disregard my message.


Never mind. Misread your post.
#74
I'd use it, but if it's too much of a pain, Mr Flibble's idea would be alright.
#75
Quote from: Khris on Tue 30/03/2010 08:29:14
Never as in never, or never as in doesn't when I want it to?

Never as in never (if I took out the wait it caused an error, saying the while loop ran 150001 times).
Using the variable works (with 641), and changing the condition to 640 instead of 641 works too (without the variable).

Thanks for your help Khris.
#76
I'm making a title screen in AGS 3.1.2 SP1 which scrolls to "another screen" (in reality the room is just double the X size of the room width set in general settings which is 640x400).
When I try to scroll to the "other screen" I use a while loop to set the X coordinate of the viewport using:

Code: ags

while(GetViewportX() < 641)
{
  SetViewport(GetViewportX()+10, GetViewportY());
  Wait(1); //To update the game
}


Yet, even when the X of the viewport is at 650, the while loop still executes.
Any reason why?
#77
Couldn't you turn off the other GUI while your inventory is visible? Or maybe you could overlap your inventory GUI with the other GUI, thus hiding the Bag button from view.

Never mind. I see that your Bag button closes and opens the GUI. How about a timer?

Code: ags

function btnBag_OnClick(GUIControl *control, MouseButton button)
{
 if (gInventbag.Visible) {
   if (IsTimerExpired(1) == 1) {
     gInventbag.Visible = false;
   }
   else {
     return;
   }
 }
 else {
   SetTimer(1, 30);
   gInventbag.Visible = true;
   aSOUND3.Play();
 }
}
#78
OK I've tried that and it works OK. Only problem is it sometimes loops before I change the view back to a still image, but the solution I've found is to change the delay on the frames in the view so it's slower. So it now all works well. Thanks for your help.
#79
I only want it to play the animation loop once per click. Also I don't really understand what you mean by changing it to a view where the cursor's animated. Could you expand on that?
#80
How could I get the mouse to complete an animation when the mouse button is pressed? Something like Character.Animate. I've tried:

Code: ags

if (mouse.IsButtonDown(eMouseLeft)) {
  int mouse_view = 5;
  mouse.ChangeModeView(mouse.Mode, mouse_view);
  }
else mouse.ChangeModeView(mouse.Mode, -1);


But that only made the mouse go spazzy when held down and stopped on a random frame when the button was released. I however need the mouse to complete a full animation loop. How could I do it?
SMF spam blocked by CleanTalk