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

#201
As long as you're just starting off, I'd consider switching to 1280x720 instead of 800.
16:10 is a legacy resolution; most screens today are 16:9.
#202
How dead-set are you on this exact mechanic?

Is this primarily about implementing the exact thing you're describing? Or is the more important thing the general ability to ask characters about specific words they mentioned?
Because AGS already natively supports adding a textbox to the dialog options.

Are you planning on releasing the game for touchscreen devices? Or is the drag-and-drop thing just incidental?
#203
Quote from: DiegoHolt on Sat 07/09/2024 19:42:45I don't know why I thought that the random number included the 0 when counting...
???

Sorry, just to clarify: the result range does include 0, and more importantly: does include the integer you pass, which was the reason your code failed every fourth time on average.
#204
The Rumpus Room / Re: What grinds my gears!
Thu 05/09/2024 11:44:09
QuoteProps to the animators for making this with one hand.
lol
#205
A good point to start is the TwoClickHandler script from the BASS template.
#206
If button is eMouseLeftInv or eMouseRightInv, you can do

Code: ags
  InventoryItem* clickedItem = inventory[game.inv_activated];
https://adventuregamestudio.github.io/ags-manual/GlobalArrays.html
https://adventuregamestudio.github.io/ags-manual/Gamevariables.html

To allow using inv item A on inv item B, check if player.ActiveInventory is != null and what the mouse.Mode is.

To set the clicked item as active:
Code: ags
  player.ActiveInventory = clickedItem;
https://adventuregamestudio.github.io/ags-manual/Character.html#characteractiveinventory

And so on. At this point you're just asking us to write all the code for you, but we still don't know what interface exactly you're trying to build. You should check out existing templates and their code, look up the used commands and try to understand how it all fits together.
#208
(Got interrupted in between writing and posting this)

If this is just for a single occasion:

Code: ags
  cChar1.LockView(cChar1.SpeechView);
  cChar1.Animate(cchar1.Loop, 5, eRepeat, eNoBlock);
  Overlay* o1 = cChar1.SayBackground("HA HA HA");
  
  cChar2.Say("HA HA HA");

  // clean up
  if (o1 != null) o1.Remove();
  cChar1.UnlockView();
Not tested.

In general you'll probably want to write a Character extender function and implement a way to clean up all background speech.
#209
You have added the block inside the eMouseLeft block but eMouseLeft and eMouseLeftInv are two different values so button cannot be equal to both of them.

Code: ags
function on_mouse_click(MouseButton button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT or LEFTINV or RIGHTINV
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
  else if (button == eMouseLeft) {
    Room.ProcessClick(mouse.x, mouse.y, mouse.Mode);
  }
  else if (button==eMouseLeftInv) {
    // inventory[game.inv_activated].RunInteraction(mouse.Mode);
    cXeno.Say("qualcosa triggera");
  }
}

Note how the proper indentation greatly helps with reading the code.
#210
To use built-in inv handling you need to switch the mouse.Mode to eModeInteract when the player opens the inventory. Now you should be able to select an inv item by clicking it.
Also make sure you set the invWindow's ItemWidth and ItemHeight to large enough values, otherwise just the top left corner of the item will react to a click.

To manually process clicks on inventory items you need to

1) go to General Settings -> Inventory and set "Override built-in inventory click handling" to "True"
2) add your own eMouseLeftInv and eMouseRightInv blocks to the global on_mouse_click function

(Also note that the hover check you're asking for in the title is not needed to solve this; you should always ask about the original problem, instead of about your attempt to solve it)
#211
Not possible afaik.
However actual dialogs do support really long option text. Why not use a dialog for your dialog?
#212
Did you click the character with the walk cursor? IIRC that's the only one that doesn't trigger "any click on"
#213
Sorry, I just noticed I didn't upload the actual Credits module (laugh)
So whatever you imported wasn't the right module.

Please download Credits_0.1.scm from here https://khris.ddns.net/modules/

Also, your room_Load has two opening braces. That shouldn't compile anyway.
(Also make sure the two room* functions are linked in your room events, and note that my example code runs the credits when you press space.)
#214
You're basically telling AGS to find a walkable path 40 times per second. You can try to lower that number like this:

Code: ags
int frameCounter;

function repeatedly_execute()
{ 
  frameCounter = (frameCounter + 1) % 5;
  if (frameCounter == 0) mouse_continous_down();
}

This should reduce the lag but have little effect on the button processing.

Solving this in an optimized way probably requires completely custom walking / walk cycle code.
#215
This is just a standard Google Drive download page.

You can also download directly from here: https://khris.ddns.net/modules/
#216
First, pick a suitable size for the screenshot. Like an eighth of the game resolution for instance. The size doesn't matter so much as the aspect ratio, obviously. Now resize the button to that, if you haven't already.

Now replace
Code: ags
    buttonSprite = DynamicSprite.CreateFromSaveGame(lstSaveGamesList.SaveGameSlots[lstSaveGamesList.SelectedIndex], 78, 78);
with
Code: ags
    int slot = lstSaveGamesList.SaveGameSlots[lstSaveGamesList.SelectedIndex];
    buttonSprite = DynamicSprite.CreateFromSaveGame(slot, btnScrnshot.Width, btnScrnshot.Height);

(Assigning a larger sprite to a button will not clip it by default. You can turn this on in the button properties but that will simply crop the screenshot. The fix is shrinking the image.)
#217
If the character behind the desk is going to move and supposed to stick to walkable areas, you can use a different walkable area for the area behind the desk and turn it on/off as needed.

If you don't really need the area anyway, just remove it, this is the simplest solution.

I suspect the approach code from the template calculates coordinates that are outside the WA so the player, while trying to reach them, ends up on top of the NPC.

You can also fix this a different way:
Go to Scripts -> TemplateSettings -> Edit Script and find line 66. Set the eVerbGuiApproachCharInteract option to false.
Now wrap your code in the usual
Code: ags
  if (Verbs.MovePlayer(123, 45)) { // coordinates in front of desk
    player.FaceDirection(eDirectionUp, eBlock);
    // look at, etc
  }
#218
The shape of the area shouldn't matter but composing it anew each frame will very much make a difference. However the whole point of doing this was to not have a massive room in the first place.

What exactly are you doing? Can you show relevant code?
#219
Very generally put, using pseudo-code:

Code: pseudo
String book;
int chapter, verse;

loop over book text files
 loop over chapters
  loop over verses
    if (match found) set book, chapter, verse and break out of loops

set vice / virtue variables based on book, chapter, verse
clear input
start next dialog

Imagine the nightmare of finding out you also need to do something else and having to amend 31000+ lines of code. (In addition to the unimaginable horror of first writing these 31000+ lines of code.)
You need to come up with some system that is much more amenable to later changes.
#220
GIFs do not support an alpha channel, which is what you need to get anti-aliased edges. Try rendering your model as PNG with an alpha channel.

Here's a tutorial:
SMF spam blocked by CleanTalk