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

Topics - AdamM

#1
This is what my dialogue currently renders as (Lucasarts):

http://img97.imageshack.us/img97/4023/sierral.png

I'm in the process of designing a new conversation GUI with embedded portraits (yes I know you adventure design buffs will probably take issue with the options but please reserve comment for now):

http://img836.imageshack.us/img836/6509/talkgui.png

It all works perfectly, except for the dialogue which appears as the above default Lucasarts. This is what I want my dialogue to render as, i.e. on a GUI (Sierra with Background):

http://img801.imageshack.us/img801/9284/sierrabackground.png

Unfortunately there seems to be no way of achieving the latter effect without using a blocking function like Display(), or using SierraWithBackground, which displays an extra portrait in the top left of the screen in addition to the one I've drawn in my GUI (I'm using SSH's GuiPortrait module to achieve that). My current workaround is SierraWithBackground and a blank SpeechView, but even with this the text is limited to rendering in two fixed positions of the screen i.e. top left or top right, whereas I want to move it wherever I want so that it doesn't necessarily cover up the conversation GUI or anything else.

If I make a new GUI to handle it, it isn't able to dynamically (and magically) resize itself depending on the amount of text it is displaying like the mysterious Text Window GUI.

So that's the problem. Solutions go.

PS: And why is SierraWithBackground destroying all my SpeechColor variables anyway?

PPS: No responses in 20 hours? A more complicated problem than I thought then?
#2
I decided to redesign my interface more than the old walk-look-interact mouse cursors, and I've started by converting my default LucasArts-style conversation system into a Sierra-style portrait system with interaction buttons alongside it. Kind of like in Jagged Alliance 2 (if anyone except me has played that game).

The easiest way to do this is of course a GUI. I wanted the GUI to have a start-up animation, so it does something snazzy when it first pops up, but this doesn't seem so easy. The only thing you can animate on a GUI is a button, and even then it doesn't block! My function-in-progress looks like this, designed to resize the button so it is the size of the GUI and then animate:

Code: ags
function StartTalkSystem(Character *chartalkto, Dialog *chardialog)
{
  gTalkSystem.BackgroundGraphic=572;
  gTalkSystem.Visible=true;
  TSAnimateButton.Visible=true;
  TSAnimateButton.Height=66;
  TSAnimateButton.Width=169;
  TSAnimateButton.Animate(70, 0, 3, eOnce);
  TSAnimateButton.Visible=false;
  TSAnimateButton.NormalGraphic=572;
}


Of course when I tested it out, nothing appeared to happen. This is of course because button.Animate(); was not blocking and the lines of code after were being run immediately, causing the button to disappear. Commenting them out makes the animation visible, but even then I have no idea of knowing when the animation is finished, and therefore I can't write any more code for it.

Why is this the case, and what should I do?
#3
As we all know the character [ formats a new line in strings. In one instance I want to use the character itself rather than a new line. I understand the usual way to do this is to 'escape' it by inserting a backslash (as in \[) but this doesn't seem to be working. Does it have something to do with the string I'm using being a GUI label? Can someone verify that escaping [ works or not with GUI label text?
#4
Can it be done?
#5
Check me out, I've decided to upgrade to the 'Technical Forum'!

I've written my very first supercool proper function, called ScrollSign.

function ScrollSign(String message, int scrollfromx, int scollfromy);

Utilizing SSH's SpriteFont module with a font of my own invention named 'Scrolling', it produces text (message) that gradually originates at co-ordinates scrollfromx and scrollfromy and scrolls left for a pre-determined amount of pixels (136, that being the size of the scrolling signs I have drawn) before disappearing.

There are three sections enclosed by while() loops; the first one gradually scrolls the text until it is fully visible, the second moves the text along the sign, and the third one swallows it at the left edge.

(It still needs work; I don't think it will work with text longer than 136 pixels, it will overlap the sign etc.)

This is the first time I've done this sort of thing so I'm sure the scripting is very sloppy, feel free to suggest improvements.

I have a problem which I will elaborate on at the end of the script.

Code: ags
function ScrollSign(String message, int scrollfromx, int scollfromy) {

RawSaveScreen();
DynamicSprite* ScrollingSign=Scrolling.TextOnSprite(message);
int pixelsright;
int a;
int b;
pixelsright=ScrollingSign.Width-1;
a=(ScrollingSign.Width-pixelsright);
b=a;
int pixelsleft;
int xleft=scrollfromx;
int xcompare=(scrollfromx-136);
//136

while (pixelsright!=0) {
 DynamicSprite* ScrollingCrop=Scrolling.TextOnSprite(message);             //make a DynamicSprite of the message
 a=(ScrollingSign.Width-pixelsright);                 //work out how many pixels to remove from the right
 b=a;
 ScrollingCrop.Crop(0, 0, b, ScrollingCrop.Height);                //crop them
 RawDrawImage(xleft,scollfromy,ScrollingCrop.Graphic);      //draw it
 ScrollingCrop.Delete();
 Wait(2);                                           //keep it there for a bit
 RawRestoreScreen();                                        //erase it
 RawSaveScreen();
 xleft--;                                                           //move it left
 pixelsright--;                                                 //reveal another pixel's worth of message
 }

while (xleft!=xcompare) {                               //do the same thing but without revealing pixels
 DynamicSprite* ScrollingCrop=Scrolling.TextOnSprite(message);
 RawDrawImage(xleft,scollfromy,ScrollingCrop.Graphic);
 Wait(2);
 RawRestoreScreen();
 RawSaveScreen();
 xleft--;
 ScrollingCrop.Delete();
 }

int c;
int d;
c=ScrollingSign.Width;
d=c;

while (d!=0) {                            //do the same thing but with removing pixels from the left side
 DynamicSprite* ScrollingCrop=Scrolling.TextOnSprite(message);
 a=(ScrollingSign.Width-pixelsleft);
 b=a;
 ScrollingCrop.Crop(pixelsleft, 0, b, ScrollingCrop.Height);
 RawDrawImage(xleft,scollfromy,ScrollingCrop.Graphic);
 Wait(2);
 RawRestoreScreen();
 RawSaveScreen();
 pixelsleft++;
 d--;
 ScrollingCrop.Delete();
 }
}


The main problem I can't find a solution to is that due to my usage of Wait() in the while() loops, this is a blocking function, which was not my intention at all: I want it to run in the background. is there a non-blocking alternative I can use instead of Wait() to keep the action running? I tried a suggestion by SSH in another thread, which was to use an variable check like so:

Code: ags

int count;

while (pixelsright!=0) {
 DynamicSprite* ScrollingCrop=Scrolling.TextOnSprite(message);
 a=(ScrollingSign.Width-pixelsright);
 b=a;
 ScrollingCrop.Crop(0, 0, b, ScrollingCrop.Height);
 RawDrawImage(xleft,scollfromy,ScrollingCrop.Graphic);
 ScrollingCrop.Delete();

 count++;

  if (count==20) {                         // if message has stayed on screen for twenty loops

  RawRestoreScreen();                 // get rid of it
  RawSaveScreen();
  xleft--;
  pixelsright--;

  }

 }


But this just resulted in the game hanging for ages and then revealing that it had bled the message all over my sign somehow.

Is there a way to fix this?
#6
I have a room where interacting with an object starts a script. The beginning of the script involves moving the player character over to the object. While doing so he passes over one or more regions. The regions are scripted to make things happen when the player passes over them. However, because the first interaction script is already running, the region script gets blocked and is only run once the interaction script is finished. This is not ideal, as the region script is meant to be run whenever the player passes over them. That said, I can live with the script not being run in this particular instance, as long as it is not run at the end of the interaction script.

So, what I'm looking for is either:
1) A way to tell the region script that the interaction script is running and it should therefore not run, or
2) Some kind of special function which I can place in my interaction script that can 'flush' the script threads and discard all queued-up blocked actions, thus preventing the region script from running.

(By the way, I hate repeatedly_execute and his sister _always with a passion, as I think this is the way out for the coward willing to accept a workaround. I'm not one of these.)

Thanks in advance!
#7
When I was building my game in 2.70, I had a script (which I think I nicked off someone else on these forums but can't remember who) in the first room (the splash screen) that triggered an InputBox asking for the player's name. This would then be stored in buffer, StrCat'd a surname onto it, and then StrCopy'd to character[EGO].name.

The player character's name is simply that, 'character[EGO].name', so that it can be used in things like looking at oneself:

Code: ags
Display("That's me, %s.", character[EGO].name);


I upgraded to 2.72 so that I could use a module that required it. Upon trying to compile I was told that "'name' is not a public member of 'character'" and suggested I capitalise it. Grumbling, I did, and upon compiling found the error message had changed to:

Type mismatch: cannot convert 'String*' to 'string'

It references the line that says:

Code: ags
StrCopy(character[EGO].Name, buffer);


Now this completely baffles me, and nothing I try will fix it... help!
#8
So I've scripted so that when a player presses Escape, it calls PauseGame and brings up a menu GUI (IF the menu GUI isn't visible in the first place, which means if it is the Escape key will hide it and call UnPauseGame).

This all looks fine and dandy on paper, but as soon as I stuck PauseGame and UnPauseGame into my script, the Escape key doesn't get rid of the GUI. Why is this? PauseGame shouldn't stop on_key_press, should it? Is it something to do with the button animation I'm running in the GUI at the same time?

Code: ags
Ã,  if (keycode==27)
 {
if (gMenu.Visible==true) 
{
gMenu.Visible=false; UnPauseGame();
} 
else {
gMenu.Visible=true; PauseGame(); Animation.Animate(25, 0, 10, eRepeat);
}
}
#9
Hi guys. Here's an easy one. How do you set hotspots etc. to display a default message when the player clicks on them (e.g. if the player has their cursor set to Talk To, and clicks on an inanimate object, the game displays 'You can't talk to that' or similar)? I can't seem to find an contextual answer in the manual or by searching. Thanks in advance.
SMF spam blocked by CleanTalk