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 - pcj

#141
Uh, that works for me.  Make sure you have Game.NormalFont (and Game.SpeechFont for speech) set to the font and not its outline.



#142
Change the text color in your text window GUI's properties.
#143
LucasArts speech is always centered (with respect to the character).
#144
Code: ags
game.text_align = eAlignCentre;


Only for message boxes and Sierra-style speech.
#145
With the module:
Code: ags
Credits[1].CreditStyle = eCreditScrolling;
#146
The Credits module is more recent and probably easier to use.
#147
Since SayBackground returns an Overlay,  you can manipulate the position with Overlay.X and Overlay.Y, that may help.  From a few brief tests it does appear to allow going off screen using that method.
#148
Hey, the eraser is Hotspot 0.  Just saying.
#149
ShowTextCentered is a custom non-blocking function using Overlays.  It's just the Wait causing it.
#150
Enable pixel perfect click detection in the game's general settings.
#151
Are there any blocking scripts running?  GUI controls are disabled during blocking scripts.  All those Wait() commands in room_AfterFadeIn() would do it.

GUI scripts should be placed in the global script.
#152
If it's staying on indefinitely then just make sure you are declaring the Overlay variable in a global scope (so it doesn't disappear when it goes out of scope) and only Remove it when the variable goes below that (checked through repeatedly_execute).

Code: ags

Overlay* Boom;
function repeatedly_execute() {
  if (heatIndex >= 3) {
      if (!Boom.Valid) Boom = Overlay.CreateGraphical(100,100,71,true);
  }
  else {
      if (Boom.Valid) Boom.Remove();
  }
}
#153
It will need to be in repeatedly_execute as blocking functions such as Wait() can't go in rep_exec_always().  In any case, you'll probably be better off creating a timer to specify the duration (checking to see if the timer is expired will also go in repeatedly_execute) - just remember to declare the overlay variable outside the function or it will disappear when it goes out-of-scope (the function concludes processing).  If you do use a timer rather than Wait, you should be able to use repeatedly_execute_always(), but it will run when the game is blocked with other scripts, which may not be what you intend.

I believe you change the transparency of graphical arrays by modifying the transparency of the image itself - you've enabled transparency so it should work.  You will probably need to remove and re-instate the array with the changed graphic.
#154
But if you're already using the animated background feature to switch between versions of a background, you'll be unable to switch back to animating the background without it looking weird (since you only have 5 frames to work with).  At which point it may be better to use separate rooms for each background, or objects where needed instead of animated backgrounds.

Also, if you want to change the background for a room the character isn't presently in, you'll need to use a global variable and check it when the character loads that room.

#155
SetBackgroundFrame(0); in Room load (before fade in) will fix it to the first frame until you call SetBackgroundFrame again.
#156
Code: ags
gInventory.Visible = true;


With the default settings, this will pause the game.  If you want to change that, just change the visibility setting on the gInventory properties pane to "Normal, initially off" or the respective setting as you want.
#157
For simple checks to see if the player has the inventory item before moving to another room, use player.HasInventory(itemid);

So:
Code: ags

if (player.HasInventory(iKey)) player.ChangeRoom(3);


If you need to change the appearance of a particular room while the character is in it you can use the on_event function (this is built-in and doesn't require binding in the room editor):

Code: ags
function on_event(EventType event, int data) {
   if (event == eEventAddInventory) {
       if (data == iKey.ID) oDoor.Visible = false;
   }
}


         
#158
You need to set up the background frames first in the room editor.  Look for the Display Background setting to specify a new background.

#159
So, once you've got the background frames set up it will be like:

Code: ags
function hSymbol1_Look()
{
Display("It sounds like you've found a strange symbol.");
SetBackgroundFrame(1);
}


And you'll need to bind "enters room before fade-in" and specify:
Code: ags
function room_Load() 
{
SetBackgroundFrame(0);
}
#160
It depends on what you mean by "finding those symbols".  If you mean "the character walks up to the object", you can put a region under it and map a function to it, then put SetBackgroundFrame in the function.

It's a mixture of setting up regions/objects and code, so it's hard to provide code that works out of the box unless you give me an idea of what you have so far.
SMF spam blocked by CleanTalk