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 - Crimson Wizard

#2121
If I recall correctly, you may still use "return" inside the brackets, if you indent and return a proper code:
https://adventuregamestudio.github.io/ags-manual/DialogScript.html#using-regular-scripting-commands-in-dialogs

QuoteIf you want to conditionally break out of the dialog script, the special tokens RUN_DIALOG_GOTO_PREVIOUS, RUN_DIALOG_RETURN and RUN_DIALOG_STOP_DIALOG are available which you can return from inside a script block
#2122
Updated to Beta 5
(Please use download links in the first post)

Changes in this update:

Editor:
- Support '\n' linebreak character in the Label's Text and potentially other text properties.
(along with the traditional AGS's '[')

Script API:
- Added static File.ResolvePath() and File.Path attribute.
These are mostly useful for diagnostic purposes, or logging, or to pass into plugins, for instance. File.ResolvePath() takes path like "$SAVEGAMEDIR$/data.dat" and returns the actual path on player's computer. File.Path returns the actual path this file was opened at.

Engine:
- Fixed IsSpeechVoxAvailable() returning positive result if run from IDE and Speech folder is empty.
- Fixed speech and messages were skipped by modifiers and other special keys (Ctrl, Alt, etc). (regression since 3.6.0)
Also fixed few regressions since previous Beta 4:
- Fixed engine crash when trying to render a non-32bit sprite.
- Fixed ListBox.FillSaveGameList() fills the items in a wrong order.
- Fixed File.Open() fails if no location token is present in a path.
- Fixed walkable area 0's scaling is completely ignored by characters and objects.

Plugin API:
- Added IAGSEngine.ResolveFilePath() method, which resolves a script path (with location tokens) into a proper system filepath.
#2123
There have been a report about the recent Beta causing error
"UpdateDDBFromBitmap: mismatched colour depths".
Unfortunately, I was not able to test the game which caused this, because it is a big download, and i had issues with internet connection recently.
I suspect that particular graphic feature is causing this. I may experiment with various things, but this is a unreliable kind of test.
If anyone experience same problem, please report here!

EDIT: okay, what's happening is a "false positive" error check , happens when sprites are not 32-bit.
#2124
I forgot to mention, I really like to recommend declaring constants to use in script instead of plain option numbers. This is a standard method that helps avoiding editing too much script if ID changes, as you only need to edit that in one place: the constant's declaration.
Besides it clearly tells what you are doing.

What I mean is this:
Code: ags
#define DIALOG_NPC_OPT_TELLYOURNAME    1
#define DIALOG_NPC_OPT_SELLMETHEKEY    2
#define DIALOG_NPC_OPT_BYE             3

with which you can do
Code: ags
option-off DIALOG_NPC_OPT_SELLMETHEKEY
or
Code: ags
dDialog1.SetOptionState(DIALOG_NPC_OPT_SELLMETHEKEY, eOptionOff);


A somewhat safer alternative to "#define" is "enum":
Code: ags
enum DialogOptions
{
    eDlgNPC_TellYourName = 1,
    eDlgNPC_SellTheKey = 2,
    eDlgNPC_Bye = 3,
}
#2125
This looks like a design issue in AGS, dialogs have names, but options don't. And there's no way to conveniently reorder them anyway in the dialog editor, without copy-pasting lots of stuff (option text + script). Neither it's possible to setup their display order at runtime (automatically).

Quote from: Khris on Mon 10/07/2023 23:31:50Yeah, but reordering them via custom dialog rendering is going to be much more cumbersome

I think that reordering in dialog will be far worse, because you will have to carefully copy-paste option texts, option scripts, adjust option's checkboxes, etc. Carles already mentioned option ID references everywhere.

Reordering on display may be done by introducing mapping array: an array of ints, where index is an order of display and value is the ID of an option (or vice-versa, depending on what's more convenient).
Such array would be initialized 1:1 by default, and then adjusted depending on the dialog. This way you only need to manually configure cases where you need to change the display order.

Then script the "custom dialog options rendering" to use this array when drawing options.

EDIT: by the way, I wonder any of the existing modules support options reordering already. This sounds like something that many users would find useful.
For example, reorder options based on their "already asked" state, and so forth.
#2126
I tried this project and it works as supposed to.

1. Rebuilt all files, look at character: it sais "Damn you're looking good".
2. Went to Speech dir and deleted Ego1.wav
3. Copied Ego3.wav into Speech dir, and renamed to Ego1.wav
4. Pressed F5 in the editor, look at character: it sais "Talking to yourself is a sign of madness".
#2127
This is the precise situation I was referring to, and it worked for me.
I may test again, but it's quite strange.

Can anybody else try this out?

Does this sound replacement play at all, after you rebuild all files?
#2128
Quote from: Gal Shemesh on Mon 10/07/2023 17:20:17The second problem is if you compile all files and then add or change an existing speech file in the Speech folder, when testing the game by hitting F5 from the editor, it won't reflect in the game unless you delete the Speech.VOX file from the Compiled folder.

That's what I was referring to:

Quote from: Crimson Wizard on Mon 10/07/2023 16:10:18I tried this in 3.6.0, and it works as expected: if I add new files to Speech folder, or replace existing ones, without rebuilding speech.vox, then run the game from the Editor, then the files from the Speech folder are used.

1. Make a game with sounds in Speech folder (e.g. EGO1, EGO2, EGO3), and few dialog lines that use these.
2. Rebuild all files. Test that everything works.
3. Replace 1 voice file in Speech folder.
4. Press F5 to run a test (dont rebuild all files), the replacement works.
#2129
@Gal Shemesh

I tried this in 3.6.0, and it works as expected: if I add new files to Speech folder, or replace existing ones, without rebuilding speech.vox, then run the game from the Editor, then the files from the Speech folder are used.

Please tell in detail, how did you test this case in your game?
#2130
Quote from: Gal Shemesh on Mon 10/07/2023 09:03:15I think that as long as the game is in development, testing the game from the editor should not relay and use the compiled VOX files, but rather relay on the presence of the source raw files in the game's folders.

This is how it is supposed to work, but if you say it does not, then it's a bug, and engine got broken somewhere during the development process.

The idea was that Speech folder has a priority over speech.vox, or rather plain files on disk should have a priority over the package. This lets to add new files without recompiling large vox.

Same is true for audio files, and AudioCache folder.

Quote from: Snarky on Mon 10/07/2023 10:11:07Yeah, the way running games from the editor works (in terms of which files/folders it references) is complex and confusing.

Engine registers lookup locations with category filter. There are 3 filters now, called arbitrary "random files", "audio files", "speech files".
Locations may be directories or packages.
When searching for a file, directories are supposed to have priority over a package.

When run from the editor, engine receives instructions for alternate locations via a command line.

Random files:
- Root project dir
- Compiled/Windows dir - looks for random game files (that is mostly in case user added custom files)
- game package (whether attached to exe or *.ags)

Audio files:
- AudioCache dir
- audio.vox

Speech files:
- Speech dir
- speech.vox
#2131
Quote from: RootBound on Mon 10/07/2023 03:29:32From reading the manual all I could find was character.ID, and the only example given there was interactions with deprecated script functions, which made it sound like the number array was obsolete.

What do you call a "number array" though?
"character[]" is not a array of numbers, it's array of Character* pointers.

The manual mentions these with example here:
https://adventuregamestudio.github.io/ags-manual/GlobalArrays.html
#2132
I see now, when run from the editor, the AGS game reacts on mere presence of "Speech" folder, because it counts as an alternate clip location. When run from a compiled exe it will look for vox only.

Probably it could test for the presence of any sound files in the folder too.
#2133
QuoteI feel like if I could access the character.ID integer array, I could do it easily with a "for" statement, but there doesn't seem to be a way to do that anymore since the script now uses name pointers instead of ID numbers.

This is a misconception, the script does not use "name pointers", it uses pointers, which may be stored in named variables (either generated by the editor, or declared by you), as well as in arrays.

There's a global array for each precreated object type in AGS. For characters this is "character[]" array. But you may create your own, if you need to only store particular objects there.

Some random examples:
Code: ags
for (int i = 0; i < 10; i++)
    character[i].Move(...)

Character* someCharacter = character[5];
Character* anotherCharacter = cEgo;

Character* enemies[10];
enemies[0] = cZombie1;
enemies[1] = cZombie2;
enemies[2] = cZombie3;
...
for (int i = 0; i < 10; i++)
    enemies[i].Move(...)

In the context of using placeholder characters as enemies, I may mention a ObjectPool module which I wrote for keeping track of used and free objects: https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/module-objectpool-keep-record-of-reusable-objects/
#2134
Please tell which version of AGS are you using?
#2135
Updated to Beta 4
(Please use download links in the first post)

Changes in this update:

Editor:
- Added TextureCacheSize and SoundCacheSize properties to Default Setup. These let configure the sizes of runtime texture and sound cache sizes respectively.
- Fixed Labels don't draw text in preview (regression since the previous Beta 3).

Engine:
- Implemented "texture cache", in addition to the existing "sprite cache". The texture cache keeps textures generated from raw sprites and lets reusing them, improving performance and reducing CPU workload. The textures mostly occupy the video memory (on GPU). The actual impact is proportional to the game's resolution and amount of simultaneously animated objects on screen.
- All the script File functions now treat paths in case-insensitive way (including subdirs), which makes them platform-independent.
- Added new config settings in "graphics" section: "sprite_cache_size" (which replaces deprecated "cachemax" in "misc") and "texture_cache_size".

WinSetup:
- Added options for setting texture cache and sound cache size.



These were the the last major changes planned for the 3.6.1 update. I suppose we'll leave this in Beta stage for a couple of months, to let people test this, and fix/improve things as needed.
#2136
Quote from: Gal Shemesh on Sun 09/07/2023 12:24:41However, even if I'm running a game without any sound files in the Speech folder, the IsSpeechVoxAvailable returns the value 1 as if there are.

Is speech.vox present in Compiled folder?
#2137
Quote from: cat on Sun 09/07/2023 08:03:35Wouldn't copying the source to another repository remove the version history of the new development?

There are various options here:
- copy source files;
- copy whole git repository contents, with history;
- clone (fork) wip repository.

There's an option to rename previous repository to "Old Demo Game" and free "Demo Game" title. Or not rename anything, and call new repository "Demo Game 2023" or something.
#2138
It's almost trivial to reimplement in script, this is a combination of
* character animating using particular view
* blocking message displayed

First may be done using Character.Animate, second using textural overlay, or GUI and Wait* commands family.
#2139
Manual:
https://adventuregamestudio.github.io/ags-manual/Character.html#characterthink

QuoteIf the character has a thinking animation, it will just loop through once (it won't repeat).
#2140
Quote from: cat on Fri 07/07/2023 15:52:59I noticed that there is already a repository for an AGS demo game. How should the new demo game be hosted and handled?

Having it under source control is a must, but it does not have to be in the same existing repository from the start.

I suppose that after the new demo game reaches working state, it may be copied over to the official ags repository, replacing old game (and old game may be left in a backup branch).
SMF spam blocked by CleanTalk