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

#3141
Ok, sorry, I made a mistake. There apparently have been some older version of SDK from couple of years ago, which I thought is current one.
The directory in "...\AppData\Local\Android\Sdk" was practically empty with only 1 file inside.

I fully deleted Android Studio and SDK from my system to be certain, and resintalled again using most recent version, and double checked the new paths. Now the building is running (still waiting for result while I type this).

UPDATE: it completed successfully now, and there's app-mygame-release.apk.
Maybe a silly question, but should not it use game's name? or I missed another instruction?
#3142
Right now I have following installed (checked in the SDK manager):

SDK Platforms:
* Android 11 (api level 30)
* Android 10 (api level 29)

SDK Tools:
* Android SDK build tools: 32.0.0, 30.0.3, 29.0.3
* NDK (side by side): 22.0... , 21.3...
* Android command line tools 6.0
* Android emulator 30.3.5
* Android SDK platform tools 30.0.5


May someone else say what do they have?

May the problem be that I set wrong path to ANDROID_HOME? Do I need to set it to the Android Studio root folder, or to one of the subfolders?
#3143
Is it possible to post a list of components that I have to check and install in the SDK Manager? Because I tried installing the ones from error message, was not able to find all of them in the list, and even after i installed some of them it kept reporting same missing components again.
#3144
I'm testing this Android building now. After setting up ANDROID_HOME and JAVA_HOME, I'm getting following error in the command window:

Spoiler

Quote
FAILURE: Build failed with an exception.

* Where:
Build file 'D:\Dev\ags-games\ags-camdemo\Compiled\Android\mygame\app\build.gradl
e' line: 31

* What went wrong:
A problem occurred evaluating project ':app'.
> path may not be null or empty string. path=''

[close]
What is this "path" variable refering to, do I need to also set it?
EDIT: Oh, looking at the code, this is keyStoreProperties not set. I wish there was some kind of error message thrown with more details.

UPDATE 1: I hate Android Studio because it looks strange and I cannot find anything it its menus.
So ended up generating keystore from command line following instructions:
https://stackoverflow.com/questions/3997748/how-can-i-create-a-keystore

UPDATE 2: next problem:

Spoiler

Quote
* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.

> Failed to install the following Android SDK packages as some licences have not
been accepted.
     patcher;v4 SDK Patch Applier v4
     emulator Android Emulator
     build-tools;30.0.3 Android SDK Build-Tools 30.0.3
     platform-tools Android SDK Platform-Tools
     platforms;android-29 Android SDK Platform 29
     tools Android SDK Tools
  To build this project, accept the SDK license agreements and install the missi
ng components using the Android Studio SDK Manager.
[close]
So, there are missing components, but I have two questions:
- why is emulator required to build the game?
- is the SDK platform version a variable somewhere, or this is hardcoded, and we must use exactly that version?
#3145
Quote from: Pajama Sam on Mon 14/02/2022 18:05:30
Sorry I don't comprehend what your saying exactly.Just to be sure were talking about the same thing let me explain again what I mean.I want to be able to type a room function in a room script and not have to put it in the event panel.

By "room function" do you mean like, "room after fade in" kind of function? You do not want to link them on the event panel all the time, and only type in script?

If so, this is not possible at the moment, and this is what may become possible either after fernewelten's function pointer feature is completed.

In case of room events this may also be made possible by changing engine to look for a fixed function names, just like it does with "game_start", "on_mouse_click" and so on.
#3146
I never heard about "teleport to room" command affecting game sounds. Could it be there's some logical flaw, where sounds require something to be initialized first, and this initialization gets skipped because you teleport?
#3147
"ICBM" by Michael Davis / REPVBLIC, has project source available on gamejolt:
https://gamejolt.com/games/icbm/57197

with original art and soundtrack too.
#3148
Quote from: Monsieur OUXX on Mon 14/02/2022 11:15:55"We can't do _________ because in AGS VM pointers for _________ are the same as pointers for ________ and the VM can't technically tell the difference"?

I may be begining to understand what you are refering to. Indeed the old VM could not tell what the pointer is refering to: is it a global variable, a value on stack, a managed object created by the engine, or object created by plugin etc. This is why I had to store additional info along with pointers (along with every script value in fact), which tells what it is. It's a simple "enum" meaning "value type".

I don't know what "we can't do" refers to though. I think it's best to clarify what is the overall goal is first, before searching whether and how we may (or not) do that, and find solutions for that.

As per your solution, it might work in certain enviroment, which either a) stores these addresses in a variable which is guaranteed to be larger than the pointer size and/or b) you use a virtual memory management that forces allocation to particular address range.
The former (a) will break the bytecode offset calculations again, returning the old problem of values being larger than 32-bit (as any offset calculation in bytecode currently relies on everything being 32-bit).
The latter (b) have been suggested and discussed before by several people, as a potential solution to simplify the current VM and possibly make it faster, if all script objects will be allocated within 32-bit space.

But the above only makes sense if we take full backward compatibility into account. Because as soon as compatibility with old scripts and games is not a concern, then bytecode and VM may be adjusted differently to suit our needs.
#3149
Quote from: Monsieur OUXX on Mon 14/02/2022 09:49:40
I remember CW saying that one of the obstacles of easily "managing" managed objects inside the AGS virtual machine is that they share the same address space as basic pointers.

I honestly don't remember saying that, and frankly not sure what this even means.
Managed object addresses are not stored in a common script memory, instead they store 32-bit handles, which are simply IDs. These IDs are then rerouted to real memory address using a simple map.

EDIT: Could you may be refering to the script bytecode (and old VM) working with addresses as 32-bit values, while memory may be 64-bit? I'm not sure, but it's the only problem I know that has any connection to the address values.

Quote from: Monsieur OUXX on Mon 14/02/2022 09:49:40
I don't remember exactly which kind of difficulties it was causing but I clearly remember that it was creating a technical glass ceiling -- because in the end everything is a pointer. So this limitation was indirectly impeding some glorious steps towards engine modernity and dynamic objects.

It would be better to clarify which difficulty you are refering to, and what "steps" it impedes. Before working on solution we need to know which problem we are trying to solve. Not having a clear statement of a problem or a goal leads to trouble and wasted time.
#3150
Quote from: Pajama Sam on Mon 14/02/2022 05:22:05
I assume your saying that your working on being able to have functions like beforefadein without using the event handler GUI and have that the event handler can be activated by script.Because what Im talking about is allowing the event handler be activated using script as in a second control instead of clicking the GUI buttons.It seems like it should be possible to  type a keyword to run the programming that event handler GUI buttons have .I'm no programmer though so I don't know.

At first I thought i understand what you mean, but now I am in doubts again...
Your feature request sais "be able to declare events through script", here you say "activate handler using script".
Maybe what you mean is -- call existing button handler from another place? If not, could you give an elaborate example of what you are trying to do?

Spoiler

As per fernewelten's work, the code example above was perhaps not making things fully clear, so I'll amend.

The idea is to be able to connect a function to variable which may be then used to call this function. If that variable is a part of a button, that button may automatically call it when pressed.

For example,
Code: ags

function game_start()
{
     // connect functions to button events
     bButton1.OnClick += MyEventHandler;
     bButton2.OnClick += MyEventHandler;
     bButton3.OnClick += MyAnotherEventHandler;
}

function MyEventHandler()
{
}

function MyAnotherEventHandler()
{
}

[close]
#3151
AGS is licensed under "Artistic License", it's open-source, completely free to use, and no permission or fee is required for creating commercial games with it.
#3152
Quote from: Mehrdad on Sun 13/02/2022 13:12:52
Sorry, I didn't right understand. Do must I make global variables? And after that how can I fill your conditions?

You fill them with actions corresponding to the event. Just like you fill on_mouse_click now.

For a simple example:
Code: ags

     else if (!mouse_down && was_mouse_down)
     {
         // user just released the button
         // call room interaction (walking, using objects, etc)
         Room.ProcessClick(mouse.x, mouse.y);
     }


If there are more problems with this code, I suggest discussing this in the "Technical help" forum, as this is mostly a scripting question.

#3153
Quote from: Mehrdad on Sun 13/02/2022 08:10:47
As I said before we need to "release mouse" instead "press down" on mobiles. User wants search hotspots with finger moves on screen. It start to walking with "press down" and mobile users don't want it.

@Mehrdad, indeed AGS currently does not have a ready event for released mouse, but you can change your script to react to the mouse state change (pressed - released) in the repeatedly_execute.

To do this:
1) have a global variable to remember last mouse button state
2) check in repeatedly_execute for the current mouse button state
3) compare to the last saved state. If button's state changed, do the action.
4) save new state in the variable.

Code: ags

bool was_mouse_down;

function repeatedly_execute()
{
     bool mouse_down = Mouse.IsButtonDown(eMouseLeft);
     if (mouse_down && !was_mouse_down)
     {
         // user just pressed the button
     }
     else if (!mouse_down && was_mouse_down)
     {
         // user just released the button
     }
     was_mouse_down = mouse_down; // remember new state
}


Also I may recommend speaking with Wadjet Eye (Dave and Janet Gilberts) and other people who ported their games to mobile, perhaps they will have some advices.
#3154
Quote from: Pajama Sam on Sat 12/02/2022 22:29:37someone said about it to me as being annoying to have to un-declare deleted functions.Some people don't like certain guis that much.

I was puzzled by the request at first, but judging by this phrase, I guess you mean an ability to link functions to object events in script, instead of the properties/events panel?
Yes, such ability would be very nice to have.

For a proper feature we would likely require a "function pointer" support in AGS script, that is being able to store a function reference in a variable. It's been discussed before, and we have a proposal open in our issue tracker; but that's a serious task, unlikely done too soon.

In theory there may also be workarounds, like linking function by passing only its name as a string. But such approach may be unsafe, as there will be no way to prevent connecting wrong kind of function (with wrong number of arguments, etc).
#3155
Quote from: Laura Hunt on Sat 12/02/2022 18:32:13
Also, an interesting side effect was that in the compiled Windows version, frame-linked sounds were not playing at all. I don't know what this has to do with the changes introduced for the Android build, but I can confirm that when I compiled and ran my game with the "vanilla" AGS 3.6.0.17 Alpha 18 build, those sounds played correctly.

There's something broken in the master branch after the audio refactor i did few days ago.

From my own tests, ViewFrame sounds sometimes play and sometimes don't, which seem random.
#3156
Quote from: barnacleboy on Sat 12/02/2022 13:33:39
The only approach I've found so far is manually setting timers/variables to trigger the "next" line of dialogue inside a room_RepExec. It's horribly tedious!

Using timer and some sort of "dialog state" variable is indeed a correct approach, but it's also true that doing so by hand for each line is very tedious and makes the script long and complicated.

The good solution is scripting a system that keeps the track of the current line and advances dialog on timer. This is beyond "Beginner's questions" though.

There has been a module named "QueuedSpeech" that seems to be doing this: https://www.adventuregamestudio.co.uk/forums/index.php?topic=23806.0
It may be a little outdated, but it appears there's an updated version posted by Potajito in the end of the thread recently.
#3157
This is amazing, but someone just found out that the Dialogs limit that was supposed to be removed back in 3.4.1 (several years ago) was not actually removed in the Editor; there's simply a condition under which Editor refuses to add more Dialog items in the list (at 500), while engine allows to have more...

Weird how this got missed, perhaps not many people ever reach that many dialogs. Depends on how you utilize dialogs too, probably.

In any case, it looks like I'll have to make another small patch afterwards.
#3158
Quote from: eri0o on Thu 10/02/2022 10:28:38
I agree 100% with moving to ags4 right after. Just to clarify, we can really do the tools there and backport if needed, I think it's the better way too.

Sorry, did not mean to discourage you, or anything! I just suddenly got agitated, wondering if more things will be put on 3.6, while we already have a big list of planned but undeveloped features there.

The idea of build configurations where you may select files and compile options sounds pretty interesting. I guess right now this may already be doable to some extent by writing package scripts by hand which call agspak and compiler tools? I wish we had some kind of "feature group lists" that describe these ideas for the future, and all related tasks (e.g. "Automated game building"), so that everyone could know where we are going.

But this is offtopic here, so I will shut up.

#3159
Quote from: eri0o on Thu 10/02/2022 09:02:34
I would like to redo how the build process of AGS works, but I am not sure I can do it fast enough and bug free enough to be something that gets in 3.6.0, but ideally I would like to be possible so you can selectively exclude rooms or set macros and things and build different versions of game data, possibly paired with different versions of acsetup.cfg and then can choose what gets build to which system and things like that. But there's already a plan to get after 3.6.0 is done a version of the editor that uses command line tools to build AGS games so I think I would prefer to have that happen at that time. So currently there is no reasonable panel to place things like an adb interface or a gradle interface. :/

I honestly think it's best to switch focus to ags4 soon after 3.6.0, where you can overhaul whatever you like, cutting old features if necessary. ags4 has been in development "limbo" for a long while now, and becomes stale. There's a new script compiler with lots of useful features, an open room format almost ready, and someone may eventually do open sprite format as well. I fear that pretty soon someone asks: why cannot we have these features if they are ready? Then someone will get an idea to start moving them to 3.* branch, and development will go on a new cycle of getting stuck in a 3.* again. This happened before, several times, in the last 5 or so years.

The 3.6.0 was not supposed to be as big as it became, the sole purpose of it initially was to have a SDL2-based engine that has full backward compatibility, as a backup. I'm afraid that pushing changes there further will eventually come in conflict with this concept. When I started 3.6.0 there were two major goals: SDL2 and command-line build tools. SDL2 is practically done, and tool development was unfortunately frozen at some point. But compatible tools may be added to that branch later when time permits, or even backported from ags4 if they are first done there.

[REDACTED] removed unnecessary ramblings
#3160
Quote from: Rik_Vargard on Wed 09/02/2022 18:41:13
1/ Is it possible to keep the Background Music playing when you start a video?
Quote from: Khris on Wed 09/02/2022 18:57:43
1) This should happen by default if the video doesn't have a sound track

I don't remember whether presence of audio track affects it, but normally this is controlled by the PlayVideo function parameters:
https://adventuregamestudio.github.io/ags-manual/Multimedia.html#playvideo
You may play either video sound, or game sounds, but not both at the same time. If you want both, then the only solution currently is to separate video sound into an audio clip, and play on its own.

Quote from: Rik_Vargard on Wed 09/02/2022 18:41:13
2/ Why use a Boolean when you can use an INT ( 0 or 1)?
Quote from: Khris on Wed 09/02/2022 18:57:43
2) Why use an int when you can use a boolean? actual advantage: you can write  if (itsRaining)

In AGS script there's no practical difference between int and bool, because bool is secretly an enum and declared as:
Code: ags

enum bool {
  false = 0,
  true = 1
};


The reason to use "bool" is primarily to empasize its purpose, i think. Because when you see "int" you cannot tell which range of values it may take. "bool" means it supposed to be "true" or "false".
This is also the reason to use enums: because they indicate the purpose and which values this variable is supposed to have.


Quote from: Rik_Vargard on Wed 09/02/2022 18:41:13
5/ Is it possible to click through the transparent part of a Character's PNG image?

This is controlled by the "Pixel-perfect click detection" option in the General Settings. Also may be turned on and off using SetGameOption.
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_General.html#setgameoption
IIRC this is enabled by default.
SMF spam blocked by CleanTalk