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

#381
Adding:

Code: ags

Room.ProcessClick(mouse.x, mouse.y, eModeLookat/eModeInteract);


doesn't work either.
#382
Code: ags

    //move up and down throught inventory with mouse wheel:
    if (button == eMouseWheelNorth) {
      invCustomInv.ScrollUp();
    }
    
    if (button == eMouseWheelSouth) {
      invCustomInv.ScrollDown();
    }

    //left click look, right click use
    if (button == eMouseLeftInv) {
      mouse.Mode=eModeLookat;
    }
    
   
    if (button == eMouseRightInv) {
      mouse.Mode=eModeInteract;
    }
    
    if (button == eMouseMiddleInv) {
      if (player.ActiveInventory!=null) mouse.Mode=eModeInteract;
    }


The above doesn't actually *work* - it changes mode graphic, but it doesn't do 'interact with item' ie. useinv; or 'look at item'.
#383
Thankyou, I'll try this.
What is mouseleftinv and is it better than mouseleft?
#384
Okay, well, tried everything in every function and nothing works, or responds. I've spent all day on this, reading the forums and documentation.
So, I'm off to kill myself (j/k), but if anyone wants tell me where to capture: right-click, middle and left-click; and how to go about that (left click, lookat; right click, interact; middle click, get rid of activeinventory and go back to pointer) I would be eternally, eternally grateful.
#385
More experimenting, I've set 'General Settings -> Inventory -> Override built-in inventory window click handling' to True, and used on_event() to capture the mouse button presses.
This is finally working, though not sure how to get father than this:

Code: ags

 
  if (gInventory.Visible) {
    
    //move up and down throught inventory with mouse wheel:
    if (event==eEventGUIMouseUp) {      <-- works
      invCustomInv.ScrollUp();
    }
    
    if (event==eEventGUIMouseDown) {      <-- works
      invCustomInv.ScrollDown();
    }

    //left click look, right click use
    if (mouse.Click(eMouseLeft)) {           <-- does nothing
      mouse.Mode=eModeLookat;
    }
    
    if (mouse.Click(eMouseRight)) {           <-- does nothing
      mouse.Mode=eModeInteract;
    }
    
    if (mouse.Click(eMouseMiddle)) {           <-- does work sometimes
      Display("thasth");
    }
  }
#386
ps. this is in 3.5.0b5
#387
Tried putting them in gInventory_OnClick(), same situation. Turned off 'override built-in inventory settings', it just did nothing when clicking in the inventory.
#388
The game will not respond to middle click in the inventory.
General Settings -> Inventory -> Override built-in inventory window click handling is set to False.
(though if I write it as True, nothing happens on_mouse_click(), so I'll stay away from that)

Basically, I want to have:
MouseWheelNorth - go up in inventory (works)
MouseWheelSouth - go down in inventory (works)
LeftClick - work's opposite way, it Uses
RightClick - work's opposite way, it LooksAt
MiddleClick - I want deselect the currently selected item (not totally sure how to do this either). It Uses whatever invitem it's over. Display code is ignored completely.

When I make General Settings -> Inventory -> Override built-in inventory window click handling set to True, it does nothing at all with any mouse click.

Code: ags

function on_mouse_click(MouseButton button)
{

// Game paused?

  if (IsGamePaused() == 1) {                                            // do nothing if paused
  } else

  if (gInventory.Visible) {                                             // if inventory is visible...
    
    
    
    //move up and down throught inventory with mouse wheel:
    if (button == eMouseWheelNorth) {
      invCustomInv.ScrollUp();
    }
    
    if (button == eMouseWheelSouth) {
      invCustomInv.ScrollDown();
    }
  
    //left click look, right click use
    if (button == eMouseLeft) {
      mouse.Mode=eModeLookat;
    }
    
    if (button == eMouseRight) {
      mouse.Mode=eModeInteract;
    }
    
    if (mouse.IsButtonDown(eMouseMiddle) || button==eMouseMiddle) {
      Display("thasth");           //NEVER DISPLAYS
    }
#389
Yes, not once. The sprite file in 3.1.4 doubled in size each time I added a sprite back and saved, till I gave up a left it compressed.
The uncompressed sprite file is 3.5.0b5 (which decompressed with no issues) is 3.4GB.
#390
Hasn't happened so far on 3.5.0b5...
#391
Will this slow it down, have the old compiler etc. and basically be like using 3.4.1?
#392
Okay well I replaced everything it couldn't understand with Screen.Viewport.Width/Height/X/Y/etc. but now the speech bubbles just don't come up :/
#393
I'm having trouble with line 3:

Code: ags

int calculateDefaultTextWidth(Character* c)
{
  int w = System.ViewportWidth * 2/3;
  if(c.x - GetViewportX() <= System.ViewportWidth/4 || c.x - GetViewportX() >= System.ViewportWidth * 3/4)
    w -= System.ViewportWidth/5;
  return w;
}


error is: SpeechBubble_0.8.0.asc(1059): Error (line 1059): '.ViewportWidth' is not a public member of 'System'.

This is with AGS 3.5.0b5
Making a new version for this AGS?
#394
General Settings -> Visual -> (when player interface is disabled, GUIs should) Be Hidden.

So yeah, figured that out pretty quick :p
#395
I have a top-bar menu which is invisible most of the time, but comes into view when you move the mouse cursor over the general area.
How can I get it to *not* display (or display greyed out?) when I'm a) in conversation (dialog) or b) during a process that is blocking ?
#396
UPDATE:
With the new cache size, the game goes for an hour of play (instead of 10minutes or less), but it now gets the same error as before, and says sprite 70 is the problem. No sprite for 70 has been imported.
Reduce number of sprites..?
Added 2 new sprites; number of the second one is 70. So, now there *is* a 70. Next time, different number?..
Also could mean the sprite stack is off by 1...?

Is 3.5.0 going to be released soon? :P
Could certainly do with no max size for sprites.
#397
QuoteAre the reported sprites actually ones you have imported?
Yes, probably, but they don't exist anymore. My my sprite library is a little bit of a rats nest - imagine starting out knowing nothing and recovering from a stroke, and then 2.5 years later being on the verge of releasing a game -- it's like that, growing pains :P

Well it would appear to be eureka, same error hasn't occurred once :)

I increased the cache size in the debug game (/game/_debug/acsetup.cfg with Build->game setup), recompiled; it seems to work. It was at 128mb before, now at 512mb. Could it be higher? In text of the game setup file anyway? Currently 'cachemax=4194304' which is about 4200mb; in the game options under General Setup it's 4GB. Not sure about these two sizes or whether I'm reading it wrong, but either way it does work better now and error free (fingers crossed) with 4 times the cache space.

settings:
Code: ags

[sound]
digiid=-1
midiid=-1
digiwin=-1
midiwin=-1
digiindx=0
midiindx=0
digiwinindx=0
midiwinindx=0
[misc]
game_width=1366
game_height=768
gamecolordepth=32
antialias=1
notruecolor=0
cachemax=4194304
user_data_dir=
shared_data_dir=
titletext='Lost on Cow Island' Setup
[graphics]
driver=OGL
windowed=1
screen_def=scaling
game_scale_fs=stretch
game_scale_win=max_round
filter=stdscale
vsync=1
render_at_screenres=0
[language]
translation=
[mouse]
auto_lock=0
speed=1


All good for testing now, I'll get back to you in 24 hours if it comes up again :)

ps. as for corrupt sprite cache, why is the corruption caused by asking it to uncompress/recompress? Any experience with bugs in the sprite cache with compression algorithm, anyone else done this? It doesn't blow up in my face (ie. it doesn't just say 'sprite file corrupted, oh well, hope you had fun trying'), but several (or 10s or 100s) sprites turn to the blue teacup and have to be re-imported.
#398
Happened again, this time with a different character. Immediately after conversation, same sprite number. Here's the code for dialogue script:

Code: ags


//----------------------------------------------------------------------------------------------------------------------
// DIALOGUE
//----------------------------------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------------------------------
// Dialogue Options Get Dimensions
//----------------------------------------------------------------------------------------------------------------------

function dialog_options_get_dimensions(DialogOptionsRenderingInfo* info)
{

// Create a 1366x64 dialog options area at (0,704)

  info.X = 0;
  info.Y = 672;
  info.Width = 1366;
  info.Height = 96;
}

//----------------------------------------------------------------------------------------------------------------------
// Draw Dialog Options
//----------------------------------------------------------------------------------------------------------------------

function DrawDialogOptions(DrawingSurface* ds, DialogOptionsRenderingInfo* info)
{
  int i = 1, ypos = 0, xpos = 0;  
  ds.Clear(COLOR_TRANSPARENT);
  while (i <= info.DialogToRender.OptionCount)
  {
    if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
      String str = info.DialogToRender.GetOptionText(i);  //get glyph number from option text
      int cur_img = str.AsInt;                            //current image is that number
      ds.DrawImage(xpos, ypos, cur_img);                  //draw this glyph
      xpos += 96;                                         //xpos+=width of glyph
    }
    i++;
  }
  //if (MyDynamicSpriteForTheFakeGUI != null) MyDynamicSpriteForTheFakeGUI.Delete();
}

//----------------------------------------------------------------------------------------------------------------------
// Dialog Options Render
//----------------------------------------------------------------------------------------------------------------------

function dialog_options_render(DialogOptionsRenderingInfo* info)
{
  DrawDialogOptions(info.Surface, info);
}

//----------------------------------------------------------------------------------------------------------------------
// Dialog Options Repeat Exec
//----------------------------------------------------------------------------------------------------------------------

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+96)
      {
        info.ActiveOptionID = i;
        
        //transplanted in from dialogue_options_mouse_click() to get rid of background/old buttons in real time
        MyDynamicSpriteForTheFakeGUI = DynamicSprite.Create(info.Width, info.Height, true);
        DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
        DrawDialogOptions(ds, info);
        ds.Release();
        
        return;
      }
      xpos += 96;
    }
    i++;
  }
  gFakeDialogOptions.Visible = false;
}

//----------------------------------------------------------------------------------------------------------------------
// Dialog Options Mouse Click
//----------------------------------------------------------------------------------------------------------------------

function dialog_options_mouse_click(DialogOptionsRenderingInfo* info, MouseButton button)
{
  if (info.ActiveOptionID > 0)
  {
    MyDynamicSpriteForTheFakeGUI = DynamicSprite.Create(info.Width, info.Height, true);
    DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
    DrawDialogOptions(ds, info);
    ds.Release();

    gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
    gFakeDialogOptions.Visible = true;
    info.RunActiveOption();
  }
}


// END DIALOG FUNCTIONS


This is the only area in the game which has dynamic sprites.
#399
ps. it's not changing view (except for Farmer, but the error crashes everything after the view change - and even then, it's just lock/unlock animation of a view, not a ChangeView())
nor is it a Dynamic sprite - they're technically used in my custom dialogue script, however this error doesn't happen 150 times during all conversation, just this one (of the two) particular ones.
Not sure what else it could be. Julius (room 3) might have changed direction while walking and that caused the error? It wasn't a sprite close to his walking cycle.
#400
Hi, been having a strange intermittent problem.

I'm using AGS 3.4.1.15 NMP.

This sprite error has happened twice, with the same sprite number, 6436. The sprite is nowhere near the View frames for Julius (main character, walking along to left), or the Farmer Cow (secondary character, running to left special animation) sprites. It has happened during the Farmer's running animation to the right in room x, and Julius walking in room y. They're both part of the same scene, but the rooms are 3 and 47, unrelated and made a long time apart, so god knows.
It's happened once while talking to the farmer (in room 47), which culminated in him running away right (then 2 seconds, sprite error); once with Julius walking towards the Farmer (room 3) - 2,3 seconds, sprite runtime error.

The sprite is close to 6435 and 6437, which occurs in the section I was importing/redoing after the sprite cache was corrupted (when I changed it from compressed to uncompressed; errors and some sprites replaced with blue teacup; turned it back, re-imported sprite, all good apparently). My thought is that somehow, the sprite number was corrupted, redone, but something of the corruption remained in the sprite library for some time. Not sure. Not sure how to fix or read an error log :/

Truly, truly hoping I don't have to manually re-import all sprites, all views, and spend the next 6mo redoing this one part of the game. it has 6-8000 sprites. I mean, originally I just went to general settings, sprite library, compressed->un-compressed->save->f'd up->compressed (after realizing the sprte library was now too large)->re-import. If this causes an immediate and lingering error, whys it even allowed?

Hoping for some good advice. Also, *it may not be* the sprite library (the sprites this probabaly effected, 6435-6437, are not part of a view which is used yet anywhere in the game), but I don't know.

Lost and frustrated :/

pics:
[imgzoom]https://redrom.ltd/img/room3.png[/imgzoom]

[imgzoom]https://redrom.ltd/img/room48.png[/imgzoom]
SMF spam blocked by CleanTalk