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

#521
Okay, still doesn't work.

How do I display the GUI during speech?
#522
Not quite understanding this:
Code: ags


function dialog_options_mouse_click(DialogOptionsRenderingInfo *info, MouseButton button)
{
	if (info.ActiveOptionID > 0) {
		DynamicSprite *MyDynamicSpriteForTheFakeGUI = DynamicSprite.CreateFromBackground();  //???????
		DrawingSurface *ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
		DrawDialogOptions(ds, info);
		ds.Release();
		info.RunActiveOption();
	}
}


Do you want it to create drawing surface so that... a drawing surface... can... ????
I know this is simple code but my brain get's pretty easily confused.

Anyway, the above code still doesn't work :/
#523
So uh... which function combination would be used for this?
GetFromBackground, DynamicSprite, CopySprite,...?

I mean, I know this is the advanced technical forum, but when it comes to graphics, it took me about 1 month to come up with this:

Code: ags

DynamicSprite *sprite = DynamicSprite.CreateFromExistingSprite(SLOT, true);  //safe closed
DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
    
sprite.Crop(mouse.x-65, mouse.y-65, 240, 240);
sprite.CopyTransparencyMask(SLOT);
  
surface.DrawImage(mouse.x-65, mouse.y-65, sprite.Graphic, 20);
      
surface.DrawImage(0, 0, SLOT, 90);            //safe closed
surface.Release();
sprite.Delete();


...to make a circle which saw into another background (another background, just that circle thing, like Sam & Max: Hit the Road).



Here's my custom dialog code btw:

Code: ags

function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
  // Create a 1024x64 dialog options area at (0,704)
  info.X = 0;
  info.Y = 704;
  info.Width = 1024;
  info.Height = 64;
}

function dialog_options_render(DialogOptionsRenderingInfo *info)
{
  int i = 1, ypos=0, xpos=0;
	info.Surface.Clear(15);	
	while (i <= info.DialogToRender.OptionCount)
  {
    if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
			String str = info.DialogToRender.GetOptionText(i);
			int cur_img = str.AsInt;
			info.Surface.DrawImage(xpos, ypos, cur_img);
			xpos+=64;
    }
    i++;
  }
}

function dialog_options_repexec(DialogOptionsRenderingInfo *info)
{
	int i = 1,  xpos = 0;
  while (i <= info.DialogToRender.OptionCount)
  {
	 if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
      if (mouse.y >= info.Y && mouse.x >= xpos && mouse.x <= xpos+64)
      {
        info.ActiveOptionID = i;
				return;
      }
			xpos+=64;
    }
    i++;
	}
}

function dialog_options_mouse_click(DialogOptionsRenderingInfo *info, MouseButton button)
{
	if (info.ActiveOptionID > 0) {
            //PUT SPRITE COPY CODE HERE
            info.RunActiveOption();
	}
}


It works out like this, with the options at the bottom rather than text:
#524
Okay I had the same idea by taking a "screenshot"/sprite of the custom options and then displaying them while speech happens;
BUT
Where do I put this code? I can't figure out the entrypoint/exitpoint for dialogues. Put it in the custom dialog_options_render function? When does the "speech_is_happening_now" moment actualy occur?
#525
Setting either one, to any other option, does nothing.
My OPT_WHENGUIDISABLED was set to 2; setting it to something else did nothing.
The custom screen dissappears during speech.
#526
I've made a custom dialog screen; however it dissappears while people are talking (while there's speech), then comes back on when speech is finished.
How can I make it stay up there always?
#527
But when will it not be a WIP edition and actually part of the 'Stable' release?
#528
Any news on which release this will finally be in? Is it set for 3.4.1-patch 4 or something?
#529
Possibly, but it was happening in rooms where FaceObject was not even used. I'd like to try this solution, but I'll just have to wait until this randomly and inexplicably happens again :P
#530
Well, it solved.
Just add this line:

Wait(1);

Great! Several hours of pain caus I was missing out a screen update :P

No idea why... SpeechBubble? The only thing calling TotalLipsync when pronouncing speech sound (as in, spoken &123 lines).
I'll let Snarky figure it out :P
#531
Further further further:
It has something to do with sound.
When I write a speech number, ie.
cJulius.SayBubble("&123 a spoken line");
it will not do the animation.

When I do not write a speech number:
cJulius.SayBubble("a silent line");
It plays the animation.

So...... god knows. But there we are, a bit closer to a solution.

Let me reiterate, I haven't done anything to SpeechBubble v0.8 or TotalLipsync v0.6 at all in the last few months.
#532
Further further:

The animation seems to *only* play in this room; in yet other rooms, it doesn't play.
I noticed he says something before each pickup with SayBubble (from the speechbubble module), but not this one specifically.
I'm now trying to think if anything's changed with speechbubble... and can't. I haven't touched it in 2 months. But Snarky, who wrote it, might make a sudden eureka moment? :P
#533
Further:
It's something to do with this room specifically; it only happens here. I walked into the other room, and it played animation normally.
Therefore, something in room load is the problem.
I can post my entire code for this room to this thread, but... would anyone read it? :P
#534
Aha!

If I add in a display to the code:

Code: ags

...
    } else {
        loop=1;	//left
    }
	
    Display("view %d, loop %d", _height, loop);
    this.LockView(_height);
    this.Animate(loop, 0, eOnce, eBlock);
    this.AddInventory(i, 0);
    o.Visible = visibility;
...


It works! But If I comment it out, it doesn't work, same problem as before.
It must require user interaction to work properly, or a delay of some kind?
#535
Yes 49 and 50 are the view numbers.

No, changing from 0 to 1 does nothing; I changed it to 10, still nothing. Not even 300ms longer of nothing; just nothing. Animation won't play.
#536
Also, the extra animation I've added:

Code: ags

function room_Load()
{
...
    if (JuliusDied) {
        cJulius.LockView(81);
    }
}

function room_AfterFadeIn()
{
...
    if (JuliusDied) {
        cJulius.Animate(0, 0, eOnce, eBlock);		//lying down/getting up animation
        cJulius.SayBubble("&1353 Hmm, what a strange dream...");
        JuliusDied=false;
        cJulius.UnlockView();

        cJulius.ChangeView(1);	//julius
        cJulius.SpeechView=2;	//julius speech
        cJulius.AnimationSpeed=-7;	//normal animation speed
        cJulius.SetWalkSpeed(4, 4);	//normal walk speed
    }
}


JuliusDied is currently set to false; but this code is the only other place in the room I have 'LockView' or 'Animate'.
#538
I wrote a function for picking up an object a while ago, which worked fine. I've recently added another animation, and now it doesn't.
HOWEVER, if I turn off or delete code for the animation I've added, it still does it.

Here's my code:
Code: ags

function hStick_Interact()
{
	cJulius.FaceObject(oStick);
	cJulius.SayBubble("&244 It's my friend - mr sticky-stick.");
	cJulius.PickUp(eLow, iStick, oStick);
	hStick.Enabled=false;
}


in GlobalScript.asc:
Code: ags

function PickUp (this Character*, PickUpHeight height, InventoryItem *i, Object *o, bool visibility)
{
    int loop=0;
    int _height=0;
	
    if (height == eLow) {
        _height=50;     //low animation
    }
    if (height == eHigh) {
        _height=49;	//high animation
    }
	
    if (this.x <= o.X) {
        loop=2;	//right
    } else {
        loop=1;	//left
    }
	
    this.LockView(_height);
    this.Animate(loop, 0, eOnce, eBlock);
    this.AddInventory(i, 0);
    o.Visible = visibility;
    this.UnlockView();
}


Firstly, I have tried this with and without UnlockView().

For the code:
-first, julius walks to a predefined position for hStick, a hotspot.
-then he faces the stick
-he say's something ("It's my friend - mr sticky-stick.")
    -it goes into the function pickup - this is a low pickup, to the right, so:
        LockView(50);
        Animate(2, 0, eOnce, eBlock);
    -the animation is supposed to happen - IT DOESN'T
    -inventory item is added, object is set to invisible
    -view is Unlocked (or not, when I comment it out, makes no difference anyway)
-the HotSpot for this object, hStick, is switched off

Here's a video:

video

yes, I have tried plotting out the course of the code with breakpoints, this appears to be the only way.

Why, oh god why, is it not animating?
#539
Here's the working code for anyone needing it:

Code: ags

function room_Load()
{
	gIconbar.Clickable=false;
	gIconbar.Visible=false;
	RunCreditsNow=true;
	SetGameOption(OPT_CROSSFADEMUSIC, 0);		//set crossfade to 'no crossfade' for music_chan
	music_chan=aSong.Play(eAudioPriorityNormal, eOnce);
}

function room_RepExec()
{
	if (RunCreditsNow) {
		mouse.Mode=5;    //blank action
		if (oCredits.Y>=690) {
			oCredits.Y-=1;
			SetTimer(TIMER_WAIT_3SECONDS, GetGameSpeed()*3);
		} else {
			if (music_chan.PlayingClip!=aSong) {
				if (IsTimerExpired(TIMER_WAIT)) {
					FadeOut(10);
					QuitGame(0);
				}
			}
		}
	}
}
#540
Fabulous :)

And another thing...

I've come across a problem running this code:

Code: ags

function room_Load()
{
	cJulius.Transparency=100;
	cJulius.x=2000;
	cJulius.y=2000;
	gIconbar.Clickable=false;
	gIconbar.Visible=false;
	mouse.Mode=5;
	SetGameOption(OPT_CROSSFADEMUSIC, 0);		//set crossfade to 'no crossfade' for music_chan
	music_chan=aTitleTheme_1_6_1.Play(eAudioPriorityNormal, eOnce);
}

function room_RepExec()
{
	if (oCredits.Y>=850) {
		oCredits.Y-=1;
	} else {
		if (music_chan.PlayingClip!=aTitleTheme_1_6_1) {
			SetTimer(TIMER_WAIT, GetGameSpeed()*2);
			
			if (IsTimerExpired(TIMER_WAIT)) {
				FadeOut(5);
				sounds_chan=aBlowing_out_a_match_2.Play(eAudioPriorityNormal, eOnce); 
				QuitGame(0);
			}
			
		}
	}
}


I set break points, but it's forever jumping between these 2 lines:

Code: ags

SetTimer(TIMER_WAIT, GetGameSpeed()*2);

if (IsTimerExpired(TIMER_WAIT)) {


It then never ends.

My original idea was to Wait() 2 seconds, then turn the game off, but the Wait icon appeared; I was trying to get the mouse pointer set to something else, but nothing worked within the Wait() loop, when it would be changed to the little watch-face anyway. Finally, I thought of setting a timer; but it just loops forever. :/
SMF spam blocked by CleanTalk