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

#181
A conversion operator would be a hidden additional operator afaict from the discussion. I don't like this approach at all. And I don't think we should add opcodes without thinking too, that loop is a critical part that affects everything.
#182
If you just write the new message this doesn't happen, like only when replying?
#183
ints secretly cast to float and vice versa can cause hard to figure it out bugs. I would prefer if they aren't silently casted ever. I would also argue that I prefer to never pay for things I don't use, a lot of things I have to do a lot of times per frame and AGS Script isn't super fast, so I prefer to not add things that could slow it down - more API calls.

Overall it's possible to just write int math when dealing with int, and avoiding hitting the engine when possible - if you aren't going to do a lot on the native side in the engine you will pay more in the call than you would if you just wrote in AGS Script.
#184
Maths is only floats, so in theory they would have to be floats.
#185
Here

Code: ags
import float AbsF(float a);
import float MaxF(float a, float b);
import float MinF(float a, float b);
import float ClampF(float v, float min, float max);

Code: ags
float AbsF(float a)
{
  if(a<0.0) return -a;
  return a;
}

float MaxF(float a, float b)
{
  if (a > b)
    return a;
  return b;
}

float MinF(float a, float b)
{
  if (a < b)
    return a;
  return b;
}

float ClampF(float v, float min, float max)
{
  return MinF(max, MaxF(v, min));
}

The Engine Script API is an API to the engine, where Script code can implement things. For small things I don't think it's worth it to go through the Engine Script API - haven't actually timed but my guess is that the in script implementation will be faster.
#186
I think if there's a need there could be an API for that like Point* GetRelativePosition(int x, int y). Does GUI.ProcessClick(int x, int y) uses screen or GUI relative coordinates? (I don't remember)
#187
About base class, other approach is to put all of these properties in an object like DrawableProperties or something else - coming up with a good name in this approach is hard - and then deprecate the options and instead use this common object to hold it along.
#188
(minor improve over 0.5.4 in a specific error message from list releases that can happen if github api blocks the query for some reason)

New AGS Toolbox 0.5.5 now can use the /maketemplate command from the editor.

When using the export template command, use the -f or --force-editor flag to make it use the export template command from the editor instead of the self built mechanism in agstoolbox.

Code: bash
atbx export template -f ../../dkrey/ags_tumbleweed/ tumbleweed.agt ../

Will export the tumbleweed template as tumbleweed.agt on the ../ dir.

This will only work if the game project is using either Editor version 3.6.2.1 or above or if it's an ags4 project, version 4.0.0.9 or above. Additionally, the necessary editor version must also be installed - either from using the installer or as an agstoolbox managed editor.
#189
I am looking at AGS Script function calling, and saw this method in the code

https://github.com/adventuregamestudio/ags/blob/62894ea31074f7266db7e1f23ed17ba89aece60a/Engine/script/cc_instance.cpp#L379

It looks like it has a bunch of things to improve, it does for inside for through strncmp and also does atoi. If I understood this is done on each function call, I think this is one of those things that if necessary should be patched before the script is run

Edit: ah this is for plugin
#190
On fixing things, we need Length to appear in autocomplete for dynamic arrays and also check if any updates are required in the templates - adding additional data parameters in on_event, check if mouse position handling is done using in event position parameters when possible, descriptions.

I guess if we plan at least one more beta release I could upgrade the dependencies versions - notably SDL2, to see if things are alright.
#191
That wouldn't work in reality once you need the character to speak you need to turn that off somehow - the loop/frame syncing.

Also I am not at home, but does mouse middle click in a tab in ags Editor, closes the tab? (was looking into the suggestion for close in tabs which is actually addressed in ags4) Mouse middle click for closing the tabs I think is in ags4 already too.

I see also a back and forwards button in the editor suggestion, I tried to do this at some point and failed, but I don't remember what was the issue with it, I think I need to scavenge my branches... One other thing that isn't there but I have hacked code somewhere is for a filterable property grid. I keep forgetting to try to fix the issues of this and see if I can get it to work.
#192
There is one here that got me curious

https://www.adventuregamestudio.co.uk/site/projects/open/278/

Spoiler
It then suggests this idea of composite views

https://www.adventuregamestudio.co.uk/site/projects/open/320

I have been playing with SCI Companion, and it apparently doesn't have it

https://scicompanion.com/Documentation/views.html

But in reality it kinda does, character portraits usually have mouth, eyes and face as independent entities - so they can talk AND blink. I haven't got much into it yet how it works, there are many scripts that are just included in all games, so it appears that the engine doesn't have much standard behavior it's just that some scripts are just reused in every game.

The more common use of this that I have seen is the use of something like skeleton animation though.

Obviously a lot of the cost of implementation of something like this is making the Editor for this which is almost an application in itself.
[close]

Other one I saw is the music loop one, I sort of have a kludge of my own for that, I have a few musics in a game that is a sequence of 4 loops, and I want to be able once the player does something to let it roll to the next section and then lock it in a loop. What I did is I sliced it in 4 separate files, and then I use PlayQueue just before the music is going to end and if the player hasn't done what's necessary I queue the same loop and if they did, I queue the next one.
#193
I have a custom module I use myself that looks like this

CustomFollow.ash
Spoiler
Code: ags
// new module header

import function Follow(this Character*, Character* toFollow, int dist=10, int eagerness=67);
import bool IsFollowing(this Character*);
import Character* Followed(this Character*);
[close]

CustomFollow.asc
Spoiler
Code: ags
// new module script
bool _isFollowing[];
Character* _following[];

void game_start(){
  _isFollowing = new bool[Game.CharacterCount];
  _following = new [/spoiler]Character[Game.CharacterCount];

}

function Follow(this Character*, Character* toFollow, int dist, int eagerness){
  _following[this.ID] = toFollow;
  if(toFollow!=null){
    _isFollowing[this.ID] = true;
  } else {
    _isFollowing[this.ID] = false;
  }
  this.FollowCharacter(toFollow, dist, eagerness);
}

bool IsFollowing(this Character*){
  return _isFollowing[this.ID];
}

Character* Followed(this Character*){
  return _following[this.ID];  
}
[close]

I've been thinking of just having a readonly property for the character named Following, as Character::get_Following that returns null if no character is being followed or a pointer to the character that this character is following. Does this makes sense? Would this be useful for anyone else?
#194
I think that it's simply single assignment - in ags4.

QuoteYou may have readonly global variables, local variables, function parameters, and struct attributes.

Two most common uses of a readonly variable are function parameters and local variables. This works as a "failproof" method to ensure that they are only assigned, but are never changed within the function by programmer's mistake.

In ags4 managed structs will have constructors soon - CW has a PR with them already.
#195
For this case specifically you can also use an enum instead, enum can fakely be a const int or typedef like in feelings. You just can't use an enum for non-dynamic array size.

In ags4 with the new compiler, I believe readonly is the keyword you use for const like behavior. And there I believe that it also works in non-dynamic array size.
#196
Remove the trailing ; character, define is a text macro replacement, you are placing a ; inside the function parameter.
#197
@AGA is there some way to dump all of these into an Excel (or Google or libre office...) Spreadsheet? I was going through these and taking notes but if there was a spreadsheet maybe it would be easier to color them as done or not relevant or to take a closer look later.
#198
OK, after taking a look at it, it seems a first step would be to refactor the script parsing that is in scintilla wrapper to the ScriptEditorBase. The callTip (as it's called the tooltip) is constructed in the scintilla wrapper instead of the ScriptEditorBase, and the variable watch interface that should in theory be in the ScriptEditorBase - at least I think.

Other issue is that querying and getting variables back is an async operation, and not blocking, so the code for the calltip need to instead be async to, but this may delay the caltip a bit more.
#199
In ags4, you could use the MaskPathFinder to pathfind in some arbitrary sprite and then move in this path something that is invisible, then you could scale down the size of the mask and make the invisible character move at a scaled down speed too, and then it's about connecting the two worlds. You can do something similar in your case with adjustments, you don't need to use the actual same characters.
#200
I have made a version of AGS Editor somewhere (I thought I had photos here in some topic but can't find) that has a Build node where you can add targets and build configs in a matrix way, and also disable the specific builds directly in the Project Explorer. It wasn't fully functional but I may have it in some archive.
SMF spam blocked by CleanTalk