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

#21
Well, I still don't understand how this plays out exactly, but indeed disabling the transparency and lowering the gamespeed shows that the dog was not sent back to x=288.

What appears to be the problem is the statement in room_AfterFadeIn(): cDog.Walk(120, 275, eNoBlock, eAnywhere);
In repexec the dog should be sent back when it's at x=195, but it looks like the instruction to walk to x=120 takes precedence. Is that possible?
It seems to be fixed if I set the statement in afterfadein to cDog.Walk(192, 275, eNoBlock, eAnywhere);

So it looks like my problem is solved, but if anyone understands what was really happening here I'd love to know. ;)

Thanks
#22
No, the death gui blocks the game permanently. Clicking it should make it close, but that doesn't happen in this situation.
I'll try the debug label later.
#23
In room_Load() there's
cDog.ChangeRoom(49, 288, 280);

And in room_AfterFadeIn() there's
Code: ags

if (dog_bone==false) {
    EnableRegions();
    RemoveWalkableArea(5);
    Display("Watch out! A VERY unfriendly dog rushes toward you!");
    mouse.SetPosition(300, 15);
    cDog.Walk(120, 275, eNoBlock, eAnywhere);
  }
#24
If I do this
Code: ags

function room_RepExec()
{
  if (cDog.x<=195) {
    player.Walk(100,  262, eBlock, eAnywhere);
    player.FaceLocation(player.x+1, player.y);
    player.x+=10;
    cDog.Transparency=100;
    cDog.x = 288;
    cDog.y = 280;
    player.LockView(DOG_ATTACK);
    player.Animate(0, 3, eOnce, eBlock);
    player.UnlockView();
  }
}

I see the animation unlocking and restarting three times.

If I do this:
Code: ags

function room_RepExec()
{
  if (cDog.x<=195) {
    player.Walk(100,  262, eBlock, eAnywhere);
    player.FaceLocation(player.x+1, player.y);
    player.x+=10;
    cDog.Transparency=100;
    cDog.x = 288;
    cDog.y = 280;
    player.LockView(DOG_ATTACK);
    player.Animate(0, 3, eOnce, eBlock);
    player.UnlockView();
    ShowDeathGui(eDeathDogAttack);
  }
}

The death gui coms up after one animation. But when I click it away it gives an error at player.Walk(100,  262, eBlock, eAnywhere); because there's no loop one.
Apparently it is still in the dog_attack view, and the condition  if (cDog.x<=195) appears ither not checked or still true.

edit: oops, I made a typing error in unlockview. Now that error doesn't happen, but the game locks up when the gui is displayed, I'm assuming because it wants to play the animation 2 more times.
#25
Ai, this is a big game and I'm just helping out. Many animations have been placed in the normal view (it has 43 loops) and they all play out well. It's just this one (so far) that behaves weird. Placing them elsewhere will have quite some impact.
#26
Hi,

I'm stumped here. The animation plays 3 times and then stops.Since the x-coordinate for the dog is set back it's supposed to play one time only.
Code: ags

function room_RepExec()
{
  if (cDog.x<=195) {
    player.Walk(100,  262, eBlock, eAnywhere);
    player.FaceLocation(player.x+1, player.y);
    player.x+=10;
    cDog.Transparency=100;
    cDog.x = 288;
    cDog.y = 280;
    player.Animate(36, 3, eOnce, eBlock);
  }
}


Any ideas?
thanks
#27
Oops sorry, found the problem.
The height of the gui that holds the label is less than 442. Don't know how that happened.
Thanks for the help.
#28
I used lblText.Font (indeed better anyway) but no difference. The font is not outlined as far as I know (how can I verify that?).
When I check GetFontHeight it gives 16, which corresponds to GetTextHeight being 320 with 20 lines.
But still 21 lines don't fit in the label with a height of 442.
#29
I meant that I noticed that the 21st line in this label is not displayed completely.
When the text is 20 lines, GetTextHeight gives 320. The height of the label is 442.

I'll try the code you posted.
#30
Experimenting a bit I found that the label can hold a maximum of 20 lines, which according to GetTextHeight is 320.
The height of the label is 442. The difference is more than one pixel per line.

Of course knowing this I can now do
Code: ags

  int height = GetTextHeight(s, eFonttext, lblText.Width + 1);
  if (height <= 320) lblText.Text = s;

But is that the best way?
#31
Hi,

I see there are several posts about this but I still don't understand what's happening with the GetTextHeight function.
I'm trying to see if a certain string will fit in the bouderies of a label.

Code: ags

  int height = GetTextHeight(s, eFonttext, lblText.Width);
  Display ("The height is %d.", height);
  if (height <= lblText.Height) lblText.Text = s;

It doesn't work however. The display shows a number that is indeed lower than the height of the label but the text is actually too big and isn't shown completely.
Somewhere it is suggested to use width + 1, but that doesn't make a difference.

Is this bit from the helptext relevant?
The height is returned in normal 320-resolution pixels...

How can I make this work?
thanks
#32
Yes, access denied.
It's just a random location on C:\ so that should not be the problem.
Antivirus: possibly. But this wasn't a problem before.

To be honest I never touch that antivirus (Norton). Is there a way to see if it is locking AGS?

Edit: Ok, I turned off heuristic scanning (don't know if that's wise though) and it works now.
There appears to be no way to just let AGS through.
#33
This problem has been mentioned before I see, but I haven't found an answer yet.
I have used AGS editor 3.4.3.1 without problems, but now I get "The game engine does not appear to have shut down properly" on every project I try.
This happens when I run a game from the editor. If I build the exe and run that, there's no problem.
I created a new game for testing and it gave the same error.

Has anyone found out how to fix this?

BTW, the send error report also gives an error.

Thanks for any insight.

Error: Toegang geweigerd
Version: AGS 3.4.3.1

System.Exception: Toegang geweigerd ---> System.ComponentModel.Win32Exception: Toegang geweigerd
   bij AGS.Editor.Tasks.RunEXEFile(String exeName, String parameter, Boolean raiseEventOnExit)
   bij AGS.Editor.Tasks.TestGame(Boolean withDebugger)
   bij AGS.Editor.InteractiveTasks.TestGame(Boolean withDebugger)
   --- Einde van intern uitzonderingsstackpad ---
   bij AGS.Editor.InteractiveTasks.TestGame(Boolean withDebugger)
   bij AGS.Editor.Components.BuildCommandsComponent.TestGame(Boolean withDebugger)
   bij AGS.Editor.Components.BuildCommandsComponent.CommandClick(String controlID)
   bij AGS.Editor.ToolBarManager.ToolbarEventHandler(Object sender, EventArgs e)
   bij System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   bij System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   bij System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   bij System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   bij System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   bij System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   bij System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   bij System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bij System.Windows.Forms.Control.WndProc(Message& m)
   bij System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   bij System.Windows.Forms.ToolStrip.WndProc(Message& m)
   bij AGS.Editor.ToolStripExtended.WndProc(Message& m)
   bij System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
#34
Nice theme.
It's been a while since I did scripting for an AGS game and I like to stay in practice a bit. :)
So if anyone likes to focus on other things, maybe we can join efforts?

Thanks
#35
1
Spoiler
You need to open the bottom cabinet door that's stuck.
[close]
2
Spoiler
Something to make the hinges move again.
[close]
3
Spoiler
The yellow liquid is 'oily'
[close]
#36
Quote from: Danvzare on Thu 29/11/2018 10:57:22
I'd put music to a close second though. Simply because I have no idea where to even begin making music. And all the tutorials online assume that you can already make music. (Which defeats the purpose of a tutorial in my opinion.)
Yes, learning to compose can be very hard (and I don't claim to be any good at it). That's why I'm surprised there are so many composers. Just look at the 'Offer Your Services' thread. Music is offered more than anything else, so I wouldn't say it's a hard to find skill.
#37
Doing anything well is difficult anyway. But musicians and scripters are easy to find (yes, the two things that I myself can contribute with).
Artists though, thats what everyone is looking for in my experience.
#38
Hi,

Is it possible to make a difference between leftclick and rightclick on a listbox?
I have the code under the only listbox option, OnSelectionChanged, but it fires on right and leftclick.
I suppose I want the selection NOT changed when rightclicking.

How do I do that?

thanks
#39
I usually read the mags-threads but never join for the simple reason that I can't make a game on my own. So for me, teaming up could help.
But in my view the initiative for projects, mags and non-mags, lies with the artists. Requests from scripters or designers for artists never lead anywhere that I can see. Requests from artists for scripting or music are instantly succesful however; that's my impression at least.

Another reason for fear of joining is indeed the fact that so many mags-projects don't get finished. I have spent some time on games that never got released. That is not really encouraging...
Maybe a longer period (2 months?) could help increasing the chance a project gets finished?
#40
True. But op's problem had to do with getting multipe pieces of coal. If player loses it you may want to be able to get another piece. If not, then indeed GameDoOnceOnly is the best option.
In both cases creating a new variable is not needed.
SMF spam blocked by CleanTalk