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

#2321
Have you numbered the speechlines? I think either AGS itself or speech center provides a functionality to automatically number the speech lines.
#2322
Here's the journey to the GitHub organization big blue cup.
#2323
Thanks Jack! the AGS project can be downloaded here as .zip. Fair warning, expect bugs and me failing to grasp concepts! XD

One cool addition is being able to create a Matrix like this:

Code: ags
Matrix* m = Matrix.CreateFromString("{{4,8},{2,3}}");
#2324


Recently I've been inclined to learn the math that enables doing 3D stuff. In the long past I guess people have looked into it (I found this thread from 2005!), and more recently a very impressive demo was put here...

So I decided to look into what could be done in similar manner, as a module, to help with such endeavors. From a different unreleased, unfinished, project, I cobbled up some code here in this GitHub repository. The README is barely a sketch, I will try to figure out the concepts and put them there as I learn.

You can get math3d.scm here. You can experiment with it.

I could really use some help understanding this stuff, if you have better ideas for the API and things to have, fire up. If you find a bug, please PR on GitHub if you know how to fix.

I intend to provide a triplet vector (which may have a fourth element), quaternions, matrix and helpful transformation functions.

Also I like discussing this and will try to update this thread as I learn. The gif above links to a video showing me playing with a virtual camera.
#2325
You can manually type the edge position on the room properties and then adjust manually providing the Edge layer is selected and visible.
#2326
Ah, in this case, there's a chance the build isn't including the redistributable VC stuff - use MT flag on Visual Studio C++ compiler.

Can you try the build here? I am not sure they are correctly configured though. (I briefly read the vcxproj xml file but couldn't find mention of the MT flag... Also the build is suspectly small. It still needs the SDL.dll)

https://github.com/ericoporto/AGS-Controller/releases/tag/1.1.1

If this is the case (the above build doesn't work), I can fix later. (I don't have VS right now and managed to expire my azure connection credentials for this repo, so I can't build things right now)
#2327
What are the correct locations? Both must also be added on the AGS Editor directory itself.
#2328
Just a note that the way it's, is the better way for commercial games on platforms like Steam, GOG, ... Where the game directory (updated per version) and savegames (which is clound synced) and configs (system dependant, but GOG and Steam are cross platform) have to be in different locations.

So I would be in favor to keep as is. This also makes possible to run games from read-only filesystems.
#2329
MorganW sent me an alternative version that would be case sensitive. My problem is restricted to symbols and numbers, but I will leave this here in case it's useful to anyone.
Code: ags

String[] Split(this String*, String token) {
  String ret[];
  int reti = 0;
  
  if (token.Length == 0 || token.Length > this.Length)
  {
    ret = new String[2];
    ret[reti] = this;
    reti ++;
  }
  else
  {
    ret = new String[this.Length + 1];
    int offset = 0;

    for (int i = 0; i < this.Length; i ++)
    {
      if (this.Substring(i, token.Length) == token)
      {
        if (i - offset != 0) // don't use 0 length slices
        {
          ret[reti] = this.Substring(offset, i - offset);
          reti ++;
        }
        
        offset = i + token.Length;
        i = offset - 1;
      }
    }

    if (this.Length - offset != 0)  // don't use 0 length remainder
    {
      ret[reti] = this.Substring(offset, this.Length - offset);
      reti ++;
    }
  }

  ret[reti] = null;
  return ret;
}
#2330
Edit: Figured out a way to split a string on needles or tokens...

Code: ags

int CountToken(this String*, String token){
  String sub = this.Copy();
  int count = 0;
  
  while(sub.Length > 0){ 
    if(sub.IndexOf(token)==-1){
      return count;  
    }
  
    sub = sub.Substring(sub.IndexOf(token)+token.Length, sub.Length);
    count++;
  }  
  return count;  
}

String[] Split(this String*, String token){
  int count = this.CountToken(token);
  
  if(count<=0){
    String r[] = new String[1];
    r[0] = null;
    return r;  
  }
  
  String r[] = new String[count+2];
  String sub = this.Copy();
  
  int i = 0;
  int cur = 0;
  
  while(i < count){     
    cur = sub.IndexOf(token);
    if(cur==-1) cur=sub.Length;

    r[i] = sub.Substring(0, cur);
    
    sub = sub.Substring(sub.IndexOf(token)+token.Length, sub.Length);
     
    i++;
  }
  r[i] = sub.Substring(0, sub.Length);
  i++;
  r[i] = null;
  return  r;
}


So what I would like is for "22, 33, 44, 55", a split on ", ", would return four strings.


  • "22"
  • "33"
  • "44"
  • "55"

So these strings wouldn't have the token strings in it. Lastly it returns a null string, so you can check you got the latest string by testing for null.

Edit:
Figured, fixed! It's working!

Here's a simple test of it in a room:

Code: ags
// room script file
function room_AfterFadeIn() {
  String mstr = "1, 232, 9, 55, 744";
  
  String b[] = mstr.Split(", ");
  int i=0;
  while(b[i]!=null){
    Display("%s[[%s", mstr, b[i]);
    i++;  
  }
  Display("the end");
}
#2331
That's a very interesting project! Well done! I liked your Python solution to generate the room elements. This is really cool!
#2332


link: youtube.com/watch?v=MBRoCdtZOYg
slides: naming_is_hard_lets_do_better__kate_gregory__cppcon_2019.pdf

Hey, I really liked this talk, even though it's c++ related, there is a lot of useful things related to naming things in code that I think can be applied to other vaguely similar languages (like AGS Script, with gotchas there).

I am reaaaally terrible at naming things and I freeze sometimes trying to figure out the right name for variables to provide the correct semantic meaning, so for me it was interesting to watch.
#2333
The module is just for parallax and smooth camera, the platformer was just for fun to test it under quick movement situations :)

The game project is on GitHub, you can also download it as zip, if you want to play with the code, the platformer bits are all on room1.asc, and it's just around 100 lines of code (if I remember it correctly). It requires the latest 3.5.0 release available!

Erh, maybe the take here is figuring out a new module that would provide some facility for 2D platfomer, but I don't have anything figured out for this for now (except further developing AgsBox2D to support the full Box2D api, but still, details like grab ledge would be onto who is using it :/)
#2334
rellax version 0.4.0

Get Latest Release rellax.scm | GitHub Repo | Demo Windows | Demo Linux | Download project .zip

Rellax while the camera tracks with cool parallax



This module uses the camera and Viewport API from Adventure Game Studio 3.5.0.

Demo game uses keyboard arrows control, up arrow jumps. WASD should also work.


Usage
Before starting, you must create the following Custom Properties in AGS Editor, for usage with Objects.
Just click on Properties [...] and on the Edit Custom Properties screen, click on Edit Schema ... button, and add the two properties below:

PxPos:
  • Name: PxPos
  • Description: Object's horizontal parallax
  • Type: Number
  • Default Value: 0

PyPos:
  • Name: PyPos
  • Description: Object's vertical parallax
  • Type: Number
  • Default Value: 0

The number defined on Px or Py will be divided by 100 and used to increase the scrolling.
An object with Px and Py 0 is scrolled normally, an object with Px and Py 100 will be fixed on the screen despite camera movement.
Objects with negative Px and Py are usually at the front, and positive values are usually at the back.


Script API

static attribute Character* TargetCharacter
The character being tracked by the Game.Camera.

static attribute bool EnableParallax
Gets/sets whether Parallax is on or off.

static attribute bool EnableSmoothCam
Gets/sets whether Smooth Camera tracking is on or off.

static attribute bool AutomaticallySetupOnRoomLoad
Gets/sets whether to automatically setup on room load. It defaults to yes (true).
Leave as this unless you really need it.

static void SetupRoomManually()
You should not call this, unless AutomaticallySetupOnRoomLoad is false.
Then call this at the end of your room_Load, after you are done setting things up.

static attribute bool AdjustCameraOnRoomLoad
Gets/sets whether to instantly adjust camera to target on room before fade in, when Smooth Camera is on. Default is true.

static attribute RellaxTweenEasingType EasingType
gets/sets the camera tween type to use when the character is stopped.

static attribute float TweenDuration
gets/sets the camera tween duration once the character is stopped.

static attribute int CameraOffsetX
Gets/sets the camera horizontal offset. It's applied without smoothing.

static attribute int CameraOffsetY
Gets/sets the camera vertical offset. It's applied without smoothing.

static attribute int CameraLookAheadX
Gets/sets the camera horizontal lookahead offset. This is an additional offset that is added in the direction the target character is facing (only 4 direction support now).

static attribute int CameraLookAheadY
Gets/sets the camera vertical lookahead offset. This is an additional offset that is added in the direction the target character is facing (only 4 direction support now).

static attribute int CameraLerpFactorX
Gets/sets the factor the camera should use when interpolating in the X axis.

static attribute int CameraLerpFactorY
Gets/sets the factor the camera should use when interpolating in the Y axis.

static attribute int CameraWindowWidth
Gets/sets the camera window width that is centered on the target lookahead point, when the target is outside of the window, the camera moves to keep it inside.

static attribute int CameraWindowHeight
Gets/sets the camera window height that is centered on the target lookahead point, when the target is outside of the window, the camera moves to keep it inside.


License
This module is created by eri0o is provided with MIT License, see LICENSE for more details.
The code on this module is based on the code of Smooth Scrolling + Parallax Module from Alasdair Beckett, which bases on code from Steve McCrea.
It uses easing code based on Edmundo Ruiz and Robert Penner's, works, which are MIT and BSD licensed, respectively (and included in the module script).
The demo game uses CC0 (Public Domain) art provided by jetrel.
#2335
I think I may do this entry. I have a sort of story sketch thing, but only time will tell if I can develop it into a game.
#2336
I really like the art and premises of this game. Can't wait for it.  8-0

I am cool with narrative and emotional impact :)
#2337
Hey, I can understand now with subtitles!  :-D

Spoiler
Right at the start he throws glasses on the floor, is it from a previous hunter?
[close]
#2338
I do a hack of changing the character normal view to another that's identical but with different sounds. I don't remember if it's the region or hotspot, but there's a place to set the view - I didn't had many cases I needed and have set it for the project a long time ago.
#2339
Oh, so the repeatedly_execute_always can be in the room itself, and whatever I said to do at game_start can be on the room load before fadein function. :)

Good luck, share a gif once it works :D
#2340
The basic idea I can think is some sprite that is twice the size of your game camera, that's fully black, with a filled circle in the middle done in transparent color. Open GIMP, Aseprite, Graphics Gale, ... Your favorite drawing software that supports layers, and draw a layer that is fully black, and then draw a circle using the eraser. Save the file as a png and import on AGS with the option that preserves the alpha.

Now you need to move this along the character, supposing is the player character, you can do this in many ways. I would create a dummy character cLamp and set it's normal view to a view containing the sprite you just imported. If your light is directional, create a Sprite for each character loop and set it accordingly.

Now at game start, set the cLamp character z property to the height of your camera (this is, half that sprite you imported height). Set also this character to use manual baseline, and set the baseline to a number that is bigger than your biggest room height size, you can also do this using the properties on the Editor.

Now create a boolean variable for you to know the lamp is on.

Create a new module Script, and there, at repeatedly_execute_always, check if the lamp is on, and if it's , set cLamp.Room to match your player Room, and just set cLamp.x and cLamp.y to match the target character (probably the player) x and y position.
SMF spam blocked by CleanTalk