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

#1342
Hello.

Quote from: FortressCaulfield on Sun 12/05/2024 17:49:171. I was surprised to find if I declare a variable in room script that it doesn't reset upon leaving and re-entering the room. I'm aware I could reset it with a region easily enough, but that's not really my question. How do variables declared this way differ from globals?

The global variables are different from room variables in that they may be accessed anywhere, in every room and script (well, almost, but I'll skip nuances for now).
Room variables may be accessed only in the respective room script.


Quote from: FortressCaulfield on Sun 12/05/2024 17:49:17The use in this case is player repeatedly looking at a bookshelf and being shown a different book each time in a specific sequence.

I'm a bit confused by this question, you are saying that you like to have a different reaction each time, then why do you want to have a variable reset? Or do you want this sequence to reset each time upon re-entering a room?

Resetting something is mostly a question of design.

If you like the whole room state to be reset each time, then you can make the room "non-state-saving". In AGS currently this is done by choosing a room number above 300 (301 and on). This will simply erase room from memory each time you leave it.

If you like to reset room state completely but only on certain occasions, then there's ResetRoom function.

Finally, if you like to reset only certain things, like variables or object positions, but not other things, then there's a "Enter Room before Fade-in" event (aka "room load"), where you may write room initialization code.


Quote from: FortressCaulfield on Sun 12/05/2024 17:49:172. I wanted to create a generic function for invalid inputs. Like if the player clicks talk on hotspots that are just bits of scenery, rather than creating a talk function for each of them.

AGS already has such function, it's called "unhandled_event":
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Event.html#unhandled_event
This function is called automatically any time an action is used on object or hotspot, which does not have a script function attached to corresponding event.

Of course, if you don't like this function for any reason, you may write your own, but then it's a matter of finding the optimal way for calling it. Commonly this is called from on_mouse_click(), after testing an object or hotspot under the cursor using IsInteractionAvailable().
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_General.html#isinteractionavailable
This is a very brief explanation, the actual code may be more complicated than this.

Quote from: FortressCaulfield on Sun 12/05/2024 17:49:17I thought I could put a generic_invalid_talk() function in global and then have every hotspot or object call that. Compiles fine, but crashes on use. Did I need to declare the function somewhere, or is this approach just a non-starter? Is there another way to come at this I'm not seeing?

I would not recommend calling this function from every object, because that is tedious and bug-prone; and instead suggest to use one of the two methods described above.

But to answer your question directly, calling a global function from the room script should normally work, if done correctly.
In order to tell what is wrong, I would need to know how and where did you declare this function, how and where did you call it, and what was the error message when it crashed.


Quote from: FortressCaulfield on Sun 12/05/2024 17:49:174. Is there a way to show specific graphics/sprites on the gui, on top of the background graphic? I remember seeing this a lot in old sierra games and would like to have a shot of the character on either the options menu or inventory window which will change through the game.

You may do this using non-clickable buttons (a button which has Clickable property set to false) with a NormalGraphic set and empty Text.

Quote from: FortressCaulfield on Sun 12/05/2024 17:49:175. Is there a way to adjust walk speed for specific directions? My character moves up and down too fast. Maybe bc her L/R loop is 8 frames and her Up/Down is only 6? I'm away the char struct has a x and y movement speed values.

In Character properties disable "UniformMovementSpeed" and set different values to "MovementSpeedX" and "MovementSpeedY".

In AGS Editor there's a quirk that some properties are hidden if another property render them useless. TBH this is not the first time such behavior gives user a wrong impression that certain option does not exist. Maybe this should be changed to displaying all properties always.
#1343
An updated variant:
PR: https://github.com/adventuregamestudio/ags/pull/2426
Download:
https://cirrus-ci.com/task/6618591464783872
https://cirrus-ci.com/task/5727916917522432

Adds properties and functions:
* GUI.ScaleX,
* GUI.ScaleY,
* GUI.SetScale(x,y),
* GUI.GUIToScreenPoint(int guix, int guiy, bool clipToGUI),
* GUI.ScreenToGUIPoint(int screenx, int screeny, bool clipToGUI)

Fixed InventoryWindow interaction in case of scaled/rotated GUI.

UPDATE 2: fixed to allow scaling value 0, which is useful in case of tweening between positive and negative scale.
#1344
The above script makes no sense in AGS, could you clarify what were you trying to do there?

Perhaps delete or comment these lines and see what happens then?
#1345
Quote from: Baguettator on Sat 11/05/2024 19:52:31How coordinates work while scaling ? If a button is at coordinates (10, 50) in its GUI which has width=200 and height =200, and you scale the GUI at (100, 100), what will be the new coordinates of that button ? Screen-related ? GUI-related ?

Control's coordinate properties (Button.X,Y) are unchanged, and related to non-transformed GUI.

Real position on screen changes along with GUI scaling and rotation.
Because GUI's origin is at 0,0, the real controls positions may be calculated by multiplying every control's coordinate by the scale value.
(Rotation is more complicated)

EDIT: we have Screen.RoomToScreenPoint/ScreenToRoomPoint functions because Cameras may be scaled and rotated.
I suppose we might need something similar for GUIs, in case user wants to find out real control's location in script.

EDIT2: I found a curious bug, apparently InventoryWindow does not respect transformation when being interacted with.
It is drawn correctly, but detected item positions are wrong.
#1346
Made a draft PR: https://github.com/adventuregamestudio/ags/pull/2426
Test build may be downloaded here and played with:
https://cirrus-ci.com/task/5935527583547392

Added GUI.ScaleX, GUI.ScaleY and GUI.SetScale(x,y).

The transformation mechanism is already in place, so this was a matter of inventing commands and "wiring" script to internal parameters.

Allows both positive and negative scaling; negative scaling leads to a mirrored image.
Scaling "0" is forbidden, passing "0" to any scale value will reset it to 1.0. If this seems inconvenient, I may allow it, but some fixes will have to be made around the code... Of course scale 0 means that object is not drawn.

When scaled, GUI's image shifts relative to its origin, which is top-left corner. If you want to scale "centered", you must adjust X,Y position along in script. This is perfectly consistent with other types of objects, each type has its own "origin".

#1347
In regards to the workflow, if there's only one, or a small number of people working on this project, and they find it difficult to use git and github, the alternative is that they do it in their own way, and then upload a new version periodically, which someone (e.g. me) will apply to the github repository.

But then the task of merging contributions is taken solely by whoever manages the game source.
#1348
Some years ago I have posted an advice regarding development of a combat system (this advice may be used for any system).
Now I am reposting this every time this question comes up.

Original thread:
https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/coding-fight-ai/msg636578340/#msg636578340

QuoteCoding is not only about knowing the programming language, but first of all about writing algorithms and structuring your program.
Complex algorithms are usually broken into smaller parts, to make it easier to understand and code.

My biggest advice to anyone who begins to learn programming and wants to make something complex, like fighting in this topic:
First, write down what you'd like to have "on paper". At this stage there's no need to go into much details, just rough outline. What objects would you like to have on screen, how these objects act, how player is supposed to act.
Second, try to break the whole scene down to smaller tasks, and learn to make these one by one, separately. After you did, you will be able to combine complex scene out of those pieces.

For example, you want to have QFG-like combat. This involves a picture of a player that swings sword (or does other stuff) by player's command and picture of enemy that does actions by AI command. Essentially this means that there is some visual character that receives commands from a source. Source can be either player or AI script.

Try following: make a simplier scene (perhaps in a test game), where you have a character on screen, that runs animations when player presses a button. Learn how to test when action ends, so that player could not run new actions before that.

Then make another scene where same character is controlled by a script. Learn how to make it launch same actions randomly, by a timer.
It may be important to learn how to "detach" animation script from AI script, to make them independent of each other. This way you will be able to connect same AI script to multiple characters.

Next step: teach AI to react on opponent's actions. You do not have to have actual opponent for that. Implement "imaginary" opponent. For example, remember what opponent is doing (defending, attacking, etc) in a variable, put a text on screen telling that to make it easier for you, and let player change that imaginary action by key press. Make AI react to this variable: when you set it to "attack" - AI should defend, and vice versa (or other variants).

Fourth scene could be where two characters stand face to face. They may be even both controlled by AI. Make them fight with each other using techniques you learnt in previous three scenes.

After you succeed in this, move on to combat rules and GUI part, with health, winning and loosing conditions, and so forth.
#1349
Could somebody please tell which licenses should be used with this game source? It will be even better if one would send me necessary file or files with the license texts, and explanation what refers to what (if one license is for the art and another for the code).

I do not really know how this is normally done when there are 2 licenses applied to the project. Should they go in 2 separate files, or in one file, separated by sections?

I did this in my own small projects in the past, but idk if that's a proper way:
https://github.com/ivan-mogilko/ags-camdemo/blob/master/README.MD
https://github.com/ivan-mogilko/ags-lastfurious/blob/master/LICENSE.MD

If nothing else, I may do it similarly as a temporary solution, but I need to know which precise licenses have been chosen for this game.

EDIT: But I also need to know whom to attribute. Is "RootBound" okay, or it should mention a real name?
#1350
Quote from: TheVolumeRemote on Sat 11/05/2024 01:54:08Where do I put these files, I thought they went w the compiled executable but it sounds like I need them to compile the executable?

You should not be placing these to game exe yourself, place plugins in Editor program folder and AGS will copy them over to your game as needed. Windows plugins go to the root folder historically, Linux to "Linux" folder etc. Well, looks like you already did it.

Quote from: TheVolumeRemote on Sat 11/05/2024 01:54:08Edit: I put the linux .so files in the AGS 3.6.1\Linux\lib folders (32 and 64 respectively) and tried to compile and got the same error. not saying I was supposed to do that, only that I tried it :)

Your plugin is called "ags2clientstub" so you must have "libags2clientstub.so".

But then, is it really the plugin that you want?  My understanding is that "stub" means that it does not do anything, it only works as a "stub", emulating the presence of Steam/GOG plugin.
You probably need something that does not have "stub" in the name.

Where do you download these?
#1351
Beginners' Technical Questions / Re: Font size
Sat 11/05/2024 09:32:36
Quote from: SebastianEl on Sat 11/05/2024 09:08:33Thank you, it worked, but now I see text doubled (two fonts on top of each other) - is it speech outline? Deleting it is disabled

Then you need to either
- resize the outline font as well. (unless you already resized it)
- change font's outline type to None or Auto
#1352
Hm, I did not remember there's a suggestion ticket.

We have reserved transformation fields for "scalex", "scaley" in save format for almost all types of objects now, and iirc the discussed API was to have properties ScaleX, ScaleY; and something convenient to set uniform scaling, like a SetScale(x,y) function, where "y" arg is optional, and if not passed, then it is set equal to "x".

Both scaling and rotation are done using fast texture transformation (with renderers that support that), and will likewise be affected by the "Render sprites at screen resolution" setting.
#1353
Quote from: Baguettator on Fri 10/05/2024 20:53:34I don't know if it has been already asked for a request, but is it doable in AGS to add the possibility to rotate/rescale dynamically (when game is launched) GUIs and/or GUIControls ? It would be so great... :)

In AGS 4 it is possible to rotate GUI and almost anything else (Objects, Characters, Camera...) using Rotation or GraphicRotation property (varies depending on type of object).
There's no command to scale gui, but it's not too difficult to add. In the current state of AGS 4 it's mostly a matter of inventing a good way to set this parameter.

I might try adding this in the next update.
#1355
I've been neglecting the issues with the navigation bar for a very long time. I know that some of the things mentioned here have been mentioned before, perhaps more than once.
(E.g. see https://www.adventuregamestudio.co.uk/forums/editor-development/feature-request-make-arrows-for-scrolling-through-room-elements-larger/)
Recently @Radiant also mentioned some related problems on github.

Although this navigation control received a lot of criticism, it should not be removed without having a good replacement designed first (Here's a conversation about this: )https://www.adventuregamestudio.co.uk/forums/editor-development/suggestion-room-explorer-a-tree-like-control-for-navigating-room-contents/).

For now, the short-term goal is to provide minor fixes to make its negative sides less annoying.

I've quickly set up an experimental version, based on older @eri0o 's work, and my own recent findings.
The PR may be found here: https://github.com/adventuregamestudio/ags/pull/2422
The latest build downloaded here: https://cirrus-ci.com/task/4945972789248000

Following is the list of implemented fixes:
1. Scroll dropdown menu with the mouse wheel.
2. Increase the size of "arrow" buttons.
3. Dropdown height is made at least as big to accommodate 16 items at once, that is current max number of walkable areas, etc.
4. Fixed dropdown menu closing when hovering over other items in the bar.
EDIT: this fix is temporarily removed, because it turned to be not reliable and causing new problems.

Known issues:
1. After scrolling with a wheel, there's a certain position desync when scrolling with buttons: they may scroll further than necessary (not sure yet if possible to fix).

The biggest problem there is that the "tool strip" control used in this navigation bar is not easy to customize, and we often have to rely on hacks. This is somewhat offset by the fact that the WinForms source code is now available for reading, so we can at least learn how these controls work.

Here I try to follow the principle of doing as less changes as possible...
#1356
Quote from: eri0o on Wed 08/05/2024 20:45:19Which is why I abandoned and made the arrow navigation way. But while it works fine, I ended up feeling that it was better to not waste much time on that and instead go for the TreeView approach.

I actually think that this may be worth adding. The code is relatively small, and keyboard navigation may be convenient for some people. So this is going to be useful in a short term.
(One thing to remember is that users tend to stick to older versions years later, so fixing existing control may be still worth it, so long as it's a reliable fix and you do not spend unproportionally lot time on it.)

Although, I would not be adding this to RoomSettings, but rather to AddressBarExt, to keep this contained withing the control itself.

The only thing necessary for RoomSettings would be a key which sets focus to the navigation bar, similar to how Alt key sets focus to the Main Menu.
#1357
I suppose that regardless which controls are there, someone eventually will like to have keyboard navigation with shortcuts.
#1358
Quote from: Radiant on Wed 08/05/2024 17:36:17I'd say that the easiest step from here would be to revert to the menus used back in AGS 3.4.3, which let the user perform the same tasks with fewer mouse clicks; and has a less cluttered interface.

You may ignore the subitems in this navigation bar and only use it for selecting a layer.
Everything else stayed the same, and you may still perform all other actions the way you did in 3.4.3: individual items may be still selected by clicking in the room or using a drop-down list on property grid. The only difference compared to 3.4.3 is layer selection: where you have to open a drop-down menu by clicking on "..." after "Room" word, instead of opening a combobox in front of "Show this room's:" label.

I cannot tell what do you mean exactly when you suggest to "revert". Whether you are talking about planning & experimentation stage, or about reverting this in a public version. If the latter, then I will refuse to do this, because current control, as imperfect as it is, contains few functions that users were asking about, such as:
- displaying multiple layers simultaneosly;
- hiding individual objects in the editor.

The old interface did not let to do either of that.

If you find it difficult to select layers with this control, we might consider some kind of a hotfix, some quick solution, such as keyboard shortcuts, for example.
#1360
Quote from: InfernalGrape on Tue 07/05/2024 18:49:55By the way, if we are supposed to submit files to MS, which files are meant? Defender reacts like that on temporary files during compiling process, so normally you never have access to those files... Right?

I was asking same question.

Is there any way to recover this file, if it's stored in a quarantine for example? Then we could look inside and at least find out what is it.

EDIT: elaborating, I do not know if these "temp files" are reacted to because Defender does not like *them*, or because it generally does not like what AGS Editor is doing, and wants to prevent any files that it creates.
SMF spam blocked by CleanTalk