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

#201
I've just found out this only happens to Julius (main character), as he has a separate talking function (to accout for Z-axis alteration). I "reverse engineered" (ie hacked together unknowingly) the speech bubble function, which looks like this:

Code: ags
function cJulius_spk(String msg)
{
  // Calculate text dimensions
  int textWidth = -1;

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

  if(textWidth < (System.ViewportWidth - 40)) {
    textWidth=textWidth;
  } else {
    textWidth=System.ViewportWidth - 40;
  }
  
  int textHeight = GetTextHeight(msg, 1, textWidth);
  
  int cut = textWidth;
  int height = textHeight;
  while(cut>1) {
    cut = (cut+1) >> 1; // Subtract half as much as we tried last time, rounding up
    height = GetTextHeight(msg, 1, textWidth - cut);
    if(height == textHeight) {
      textWidth -= cut;
    }
  }
  height = GetTextHeight(msg, 1, textWidth-1);
  if(height == textHeight) {
    textWidth=textWidth-1;
  } else {
    textWidth=textWidth;
  }

  int totalWidth = textWidth + 20 + 20;
  int bubbleHeight = textHeight + 10 + 10;
  int totalHeight;
  totalHeight = bubbleHeight + 9;

  SpeechBubbleHeight_blr=totalHeight;

  int headHeight=355;     //constant
  int spaceAboveHead=8;  //constant

  float h=IntToFloat( SpeechBubbleHeight_blr ); //constant
  float f=( (IntToFloat(headHeight+spaceAboveHead)/100.0)*IntToFloat(cJulius.Scaling) ) + h;
 
  cJulius.SayAtBubble(cJulius.x, cJulius.y - FloatToInt(f), msg);
}


Would you be able to help me insert the viewport code? I can work it out but it'll take a long time.
#202
I'm using a game with 1366x768 (widescreen) backgrounds, and it's 32it colour.
When I use this module, the player and other on-screen objects show no change, and the background begins to sway wildly getting more and more distorted.
What am I doing wrong?

SOLVED: I was using the wrong resolution. Mine are 1366 wide, so lines 34/35/50/51 in module are all using 683.0 (half of 1366), not 160.0 (half of 320, the very small size).

eg:
Underwater.asc:

Code: ags
float get_gradient_y(int xi, int yi)
{
  float x = IntToFloat(xi)/683.0 - 1.0;
  float y = IntToFloat(yi)/683.0 - 1.0;
  
  float dy = 0.0;
  int i = 0;
  while (i < 5)
  {
    dy += b[i]*t*Maths.Cos(a[i]*t*x + b[i]*t*y + c[i]);
    i++;
  }

  return dy;
}
#203
Snarky, I have two things and wondering if they’re possible:
1. Turn off speechbubble easily (so they never display) by setting one option.
2. Not allow a speech bubble to be written off the right edge of the screen (at the moment it must start at x=0, but if a character is standing too far to the right, they’re speech bubble may be cut off). Is there a way to make their right edge or both edges impossible to be drawn off screen?
#204
Quote
There are two main known methods to make extensible set of variables:
1) Create a regular global array of ints (or other type) bigger than you need right now. Then later you may use extra elements from that array without breaking saves (unless you change array size).

If I were to do this, how would I write this array so it’s global? In global.asc? Just as:

globalint=new dynamic array[999];
int globalvtar[]=, globalvar[]=, etc?
#205
How might I define all my variables in global.h, making them truly global and extensible without causing save game incompatibility? Is it even possible to achieve the same without the Global Variables section?
#206
When you say object, I’m assuming you only mean variables with graphical entities in game and are written beginning with an ‘o’ ie. oBird.Visible=true? Or you mean a programmatic object?o
#207
Total size bytes in script vars? Like changing an int to 2048 from 1024?
#208
I've noticed that if I add or delete a variable, save-games made before that change are no longer compatible with the new .exe file.
Some experimentation has shown that it's the number of variables, not the name or type. Is this true?
What, other than deleting essential rooms or characters, will make a save-game incompatible?
#209
My question's so simple today you'll scoff before you've finished reading it.
How do I write code that reflects...

"If the player has an active inventory, and the active inventory is iABC, and he left clicks while the cursor is over a non-transparent part of object oXYZ, then do something."

Thank you.
#210
I thought it meant the block within the open/close-curly-bracket, or perhaps just the previous line, was generating the error?

Anyway fixed the checking of tInv before lookat action, this was possibly the area the error was referring to. Thank you :)
#211
Could you elaborate on what you were saying in ‘note:’? I think that might be the one.
And the line number of the error was:

if (button == eMouseLeftInv) {
  if (player.ActiveInventory) {
    if (tInv!=null) {
      tInv.RunInteraction(eModeUseinv);
      mouse.Mode=eModeLookat;
      RemoveActiveInventory=true;
    } <=== THIS LINE WAS THE NULL POINTER ERROR
} else {
#212
I've had some trouble with the on_mouse_click() function recently.
This error is runtime and intermittent - it's happened twice so far.

The rules for mouse clicks logic in the inventory window are:

Right click
  Are you over a non-null item (ie. you're not clicking on an empty area)?
    Can this item have a Useinv interaction run on it?
      If so, load the item you just clicked on as the activeinventory item.

Left click
  Is there an item loaded as the activeinventory item?
    Yes - combine the activeinventory item with the object you just clicked on (ie. activeinventory=key; useinv key with door)
    No - LOOK at the inventory object you just clicked on
    if the inventory item you just clicked wasn't there (ie. you clicked an empty area), then do nothing.

Here's the code:

Code: ags
...

InventoryItem *tInv;
tInv = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    
    if (button == eMouseRightInv) {
      if (tInv!=null && tInv.IsInteractionAvailable(eModeUseinv)) {
        player.ActiveInventory=inventory[game.inv_activated];
        player.ActiveInventory.CursorGraphic=inventory[game.inv_activated].CursorGraphic;
      }
    }
   
if (button == eMouseLeftInv) {
  if (player.ActiveInventory) {
    if (tInv!=null) {
      tInv.RunInteraction(eModeUseinv);
      mouse.Mode=eModeLookat;
      RemoveActiveInventory=true;
    }
} else {
    mouse.Mode=eModeLookat;
    player.ActiveInventory=null;
    tInv.RunInteraction(eModeLookat);
  }
}

...


The error is: null pointer referenced.

My thoughts are that it has something to do with line 4: tInv is defined. Because the position is defined a second before the if statement catches it, I think that the rare situation when it references a null pointer has something to do with the user moving the mouse sharply, and clicking on an item when they were just over a point that was empty?.. ie. they pass a null pointer, when they thought they were clicking on an actual item?.......  No idea to be honest :/

Can anyone see any obvious mistakes, improper code, or the runtime error itself? It's definitely in the above logic, just no idea where :/
#213
I’m publishing a game soon, and I’d like it to be a success (no way of knowing if it will make $500k or $57.80, but hey).
I’ll be putting out a demo - how long should it be? Should I even bother with one, and just put an enticing video/screenshot package?

It’s being sold on Steam, windows exe (er, when I can be bothered getting a publisher); Gameplay is about 3.5 hours at the quickest, full dialogue.

What’s a good length for a demo? 30min, 15min, 1 hour? Should I leave them hanging or make it obvious when the demo is done? And do I even need one?

Seeking your sage advice ;)
#214
I have a fresh hell. I get clicks and pops when I play a sound, as it's ramping up in volume as I approach the epicenter of the sound source. What's going on? Code:

Code: ags
#define SOUND_SOURCE_COUNT 3
SoundSource soundSources[SOUND_SOURCE_COUNT];
void StopSoundSources()
{
	for(int i=0; i<SOUND_SOURCE_COUNT; i++)
		soundSources[i].Stop();
}

function room_Load()
{
	soundSources[0].Init(aWubwubwub, eAudioPriorityNormal, 430, 420, 150, 3, player);
}

function late_repeatedly_execute_always()
{
  for(int i=0; i<SOUND_SOURCE_COUNT; i++)
    soundSources[i].UpdateVolume(player.x, player.y);
}
#215
Could anyone help me with steam? Like step by step.
Reason is: steams worth a lot of money; steams a steep learning curve; to me, so was this language. So you know. Anyone. I know a few of you have tried the steam ags/sdk - what say ye? Are publishers usually those who take care of all steam? Humbly asking.

Update: the publisher will.
Now, just gotta get of them...
#216
Here's the new font. It's called Caviar Dreams, which whisked me away and I had to have it :p


Quote from: milkanannan on Fri 04/09/2020 04:42:25
Wow the artwork looks great! You should get your Steam pre-order page up so we can wishlist it and not lose track of the project.

Yes I should - *but how*?
No, seriously I have no idea how. I have the $150 starter thing, but..... now what? Can't find anything on the net in way of a tutorial (though I've not been working on it for ages while I wait literally months for new animation and sound samples)
#217
Images coming soon...
(I’m always working my way slowly)
#218
Okay:

-simpler, larger font
-thinner or no text outline
-more contrast between font and bg colour

Is this good?
#219
I uploaded the alpha.
Most people found the font hard to read, partly because the origin size of screenshots was smaller than original. They’re now full size, was wondering if anyone still had trouble reading them.

Well that’s good news, 6mo animation work not done in vain.
#220
Is it easier to read at full size?
SMF spam blocked by CleanTalk