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 - EnterTheStory (aka tolworthy)

#241
Quote from: GarageGothic on Thu 12/06/2008 19:11:03
Yes, that's indeed what will happen. But wouldn't it be easier just trying it out (like I just did) than writing the code and then post it on the forum?
Often my code SEEMS to be doing one thing, but it's ACTUALLY doing something else and the desired result was only a coincidence. So it's good to check with the experts.
#242
Quote from: SSH on Thu 12/06/2008 12:16:49
No. The Room Change will occur after the script has completed.
So in this imaginary example:
Code: ags

function do_A()
{ Display("A1");
  player.changeRoom(x); 
 Display("A2");
}
function do_B()
{ Display("B1");
  do_A(); 
 Display("B2");
}

Running do_B() I would expect to see displayed B1, A1,A2,B2, and THEN the room changes?
#243
True or false:

If function1 calls function2, and function2 calls 'ChangeRoom,' then function2 ends, right?
And function1 will end as well? So adding 'return' is redundant?

(Edited for clarity)
#244
Quote from: SSH on Thu 12/06/2008 10:12:12
Since AGS 3.0 and above have a proper debugger included, I guess that CJ's not goign to try too hard to fix the stuff you mention...
So it is an actual bug? I wondered if I just misunderstood it, or if there is a workaround.
#245
I have a question about an "unsupported" feature mentioned in the manuals. I realize that any bugs will not be fixed, and mods have no obligations to answer, but is it still OK to ask a question just in case someone feels like answering?

In case it IS permissible, my question is about using 'scroll lock' then 'left shift' to see the module name and code line numbers. The module is often reported as "unknown." Even when known, the line numbers seem to have no relation to what is in the actual code (often looping through blank or commented out lines). If anyone has any experience with this I'd be grateful!
#246
Quote from: Pumaman on Sun 08/06/2008 19:17:45
Have you tried disabling MIDI music in the Winsetup?
No, but I will... as soon as I can rescue my main machine. To cut short a very long story, I am currently unable to install Windows at all, so MIDI is no longer my main worry.  :-\
#247
I just reinstalled Windows, tried running the last build of my game (using 2.72), and got this error message: "DIGMID path set not found." I think this means Windows cannot find any MIDI sound players. But my game doesn't use any MIDI (as far as I know).

How can I make sure my users never see this message?

Edit:
I just found that it's a more general problem with my computer. But I'm still interested in knowing how I can modify this kind of error message. Can I check if sound works then show a message of my own choosing, instead of the Windows default message?
#248
Thanks. I must have done something foolish earlier to make me think that wouldn't work. I'll do it right, now. :)
#249
In first serious attempt at using "optional" parameters I get this error message:

Error: Character.Animate: Invalid DIRECTION parameter

Code: ags

// the call
animate2(FANTINE,176,8,1);	

// calling this
function animate2(int who,  int view,  int loop, int delay, int repeat, int block,int direction) // qqq
{	character[who].UnlockView();
	character[who].ChangeView(view);	
	character[who].Animate(loop,delay,repeat,block,direction);
}

// module header:
import function animate2(int who, int view, int loop=0, int delay=2, int repeat=1, int block=1, int direction = 1 );

Is it because I'm defining integers then accepting enumerated types? What should I have done instead? Any guidance would be gratefully received!
#250
Quote from: Pumaman on Sun 01/06/2008 17:00:02
Would it be useful if you could specify that lucasarts-style speech was drawn in a text window GUI, which would allow you to use an alpha-transparent background image?
Yes, definitely! Though in my case I'm wedded to 2.72 for Linux, and 16 bit for speed reasons, but it sounds like a very useful feature for anyone who can upgrade.
#251
Quote from: Pumaman on Sun 01/06/2008 13:06:00
You can't necessarily assume that Say uses a 165 width.

The algorithm for lucasarts-style speech is that the speech area width is 4/6 of the screen width, minus 1/5 if the character is within 80 pixels of the screen edge. In this case that would mean a 149 pixel-wide speech area
Ah! So the 1/5 refers to the screen width. I thought it was the speech width. That makes more sense now. Thanks.

Quote from: Pumaman on Sun 01/06/2008 13:06:00Perhaps what you're after is some sort of Game.MAxSpeechWidth setting that you could manually set to allow you to specify the width of character speech?
Actually, all I really wanted was to fade out the background immediately behind the text in 'Say' or 'SayBackground'. The only way I can do it is by making several fuzzy cloud characters at different transparencies, and place them behind the text. Hence the need to know exactly where the text is at all times.
#252
Quote from: Radiant on Sat 31/05/2008 13:16:39
I believe it is, except if the text needs to be wrapped for the screen edge.

ATOTK uses gettextheight for its customized text box, and that works out.
So you force a particular width rather than letting 'Say' decide its own? I wonder if that can be done with "Say"? I don't think a customized box would work in my game, as I make heavy use of text (so a box would be too intrusive for me) and heavy use of "SayBackground" (so it would be a headache to code)
#253
I tried the following code to see if the height was being correctly reported:
Code: ags

String what ="1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 0 0 0 0 0";
int length =GetTextHeight(what, 1, 165);   Display("next string, width 165, height %d", length); cEgo.Say(what);
what ="1111 1111 2222 2222 3333 3333 4444 4444 5555 5555 6666 6666 7777 7777 8888 8888 9999 9999 0000 0000";
length =GetTextHeight(what, 1, 165);   Display("next string, width 165, height %d", length); cEgo.Say(what);
what ="111111111 222222222 333333333 444444444 555555555 666666666 777777777 888888888 999999999 000000000";
length =GetTextHeight(what, 1, 165);   Display("next string, width 165, height %d", length); cEgo.Say(what);
what ="1111111111222222222 3333333333444444444 5555555555666666666 7777777777888888888 9999999999000000000 1111111111222222222";
length =GetTextHeight(what, 1, 165);   Display("next string, width 165, height %d", length); cEgo.Say(what);
   
The results were:
First string: actual height 2 lines, or 20 game pixels. Reported as 30.
Second string: actual height 2 lines, or 20 game pixels. Reported as 30.
Third string: actual height 2 lines, or 20 game pixels. Reported as 40.
Fourth string: actual height 3 lines, or 30 game pixels. Reported as 60.
Any idea what is going on here?

Notes:
This refers to text spoken when ego is near the edge of the screen. I calculate that near the edge of my 320x240 screen, text width is 165. Experiments confirm this. I'm referring to game pixels here - my game is actually 640x480 in real pixels. Also, I loaded the exact same font into all three font slots, just to make sure that wasn't the issue.
#254
Many thanks. That is extremely useful to know!
#255
Is there any way to find out exactly where 'Say' will place its text?

Failing that, any idea how 'Say' decides the height above a character's head and the width of a line?

Failing that, is there something like 'SayAt' that works with 'SayBackground'?

(I'm trying to position a transparent balloon character behind text, for better visibility.)
#256
(Edited for simplicity)

In this code, the overlay is deleted after leaving the room. I tried declaring it globally, and even tried declaring it separately in each room, but it only ever works in the first room. Any suggestions?

Code: ags

// global script
Overlay* myOverlay;
int whatOverlay;
function backgroundDialog(String what)
{myOverlay = Overlay.CreateTextual(160,100, 200,0,textColor,what); 
}	

Code: ags

// on_mouse_click:
whatOverlay++;
if(whatOverlay ==1)cEgo.Say("This is regular text, for comparison");
if(whatOverlay ==2)backgroundDialog(0,"1 0123456789");
if(whatOverlay ==3)backgroundDialog(0,"10 0123456789 0123456789");
if(whatOverlay ==4){backgroundDialog(0,"The Quick Brown Fox jumps Over The Lazy Dog."); whatOverlay =0;}

#257
Thanks. That was exactly what I was looking for.
#258
Does anyone know the exact formula for how long 'Say' will keep text on the screen? I have some characters that need to disappear at the exact same time as text disappears.

Thanks in advance.
#259
Update. I still don't know exactly what caused the problem (so I can't really mark this thread as solved). But I was short of time, so re-wrote the code to combine several short strings into one longer string. With a lower string count the "overflow" problem does not arise.
#260
Quote from: SSH on Tue 20/05/2008 13:19:28
I'd back-up your game, try importing it into AGS 3.01 and see if the problem still occurs there.
Do you mean for diagostics, or to stay with 3.01? I'm wedded to 2.72 for Linux purposes.

Quote from: Radiant on Tue 20/05/2008 15:15:50
What exactly are you doing with this many strings, and how are you generating them?
This module has most of the dialog in the game. This is a simplified version:
Code: ags

bool saidStuff;
function sayStuff(int who, int when, String what)
{ if((who ==you)&&(when ==now)) { character[who].say(what); saidStuff =true; }
// this also includes code for remembering what was said last, and next time you start looking from that point}
function checkDialog()
{saidStuff =false;
sayStuff(EGO, ANYTIME,"its a lovely day"); if(saidStuff)return;
sayStuff(EGOFRIEND,NIGHTTIME,"it's very dark"); if(saidStuff)return; 
// etc., etc. 7,200 lines
}
SMF spam blocked by CleanTalk