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

Topics - glurex

#1
Hi!

As I mentioned in the title, in one of my games I have a windmill with blades that rotate around their own pivot point. To achieve this, I tried to coded a small void in version 3.6.1, which I call from a repeatedly execute. In it, I create a dynamic sprite and rotate it by a certain angle.

However, after upgrading from version 3.6.1 to 3.6.2, I noticed that the blades no longer rotates — instead, they just "tremble" in place without actually moving.

Here's my code:

Code: ags
DynamicSprite *aspasSprite;

int angle = 0;
int aspasX = 485, aspasY = 452; // lower left corner coords (angle 0). With "aspas" I mean "blades".
float px = 158.5;
float py = 158.5; // sprite's pivot cords

void Aspas(){
  angle = (angle + 1) % 360;
 
  // Here I set the sprite and store dimensions
  aspasSprite = DynamicSprite.CreateFromExistingSprite(421);
  int w = aspasSprite.Width;
  int h = aspasSprite.Height;
  // rotate if it's necessary
  if (angle > 0) aspasSprite.Rotate (angle);
  oAspas.Graphic = aspasSprite.Graphic;
  
  // Here I calculate the sprite dimension change offset
  float xOff = IntToFloat(w - aspasSprite.Width) / 2.0;
  float yOff = IntToFloat(aspasSprite.Height - h) / 2.0;
  
  // Here I calculate vector from pivot to center
  float vx = IntToFloat(w) / 2.0 - px;
  float vy = IntToFloat(h) / 2.0 - py;
  // rotate vector
  float rad = Maths.DegreesToRadians (IntToFloat (angle));
  float cos = Maths.Cos(rad);
  float sin = Maths.Sin(rad);
  float vrx = vx * cos - vy * sin;
  float vry = vx * sin + vy * cos;
   
  oAspas.X = aspasX + FloatToInt(xOff - vx + vrx, eRoundNearest);
  oAspas.Y = aspasY + FloatToInt(yOff - vy + vry, eRoundNearest);
}

I guess there's something incorrect that I'm not seeing. So the question is: what could be wrong in my code that worked fine in 3.6.1 but not in 3.6.2?

Thanks a lot in advance!
#2
Hints & Tips / The Last One (Walkthrough)
Sun 24/03/2024 02:44:35
Since the game is relatively easy, nobody asks for a hint. But just in case, here is a quite complete gameplay video of The Last One:




#3
Completed Game Announcements / The Last One
Thu 29/02/2024 05:00:35



Awake in a pixelated room, surrounded by the distinct abundance of the same four shades of green. It nostalgically harkens back to those '90s games.
Could this be another cliché where everything turns out to be a dream? Or is there something more behind the mysterious creatures lurking in the forest?
Don't give up even when all seems lost. Starting the game anew might hold the key to rescuing more than one lost soul.


The Last One is a brief and simple adventure paying homage to the classic GameBoy aesthetic.

Download it here:



Credits:

  Programming, Coding, Puzzles, Story

Manuel M. (glurex)

    Third Party Scripts/Modules

- AltKeyboardMoviment by Khris (AGS, slightly modified by me)
- TypeWriter by Phemar (AGS, slightly modified by me)

    Music

TipTopTomCat (itch.io)
   
    Sounds

- Sweet Sounds By Coffeevalenbat (itch.io)

- Pokemon Red_Blue Sound Effects

    Graphics made from

- World tilesets By Monkeyimage (Itch.io)
- GB Studio By The Pixel Nook (Itch.io)

  Fonts

- 04Font by Yuji Oshimoto
- Early GameBoy by Jimmy Campbell (Slightly modified)
- 07 Arrows by Sizenko Alexander

AGS 3.5.1 by Chris Jones et al.



THANKS FOR PLAYING!
#4
I have a scenario where I need to play a sound every time the player collides with ANY object in the room, not just a particular one. I have a code that executes repeatedly and accomplishes this perfectly, but only with specific objects.

Is there a way to achieve the same result with every object in the room using the IsCollidingWithObject function? That way, I can write a single function that works globally in every case.

PPCollision module have a function named "CWithAnything" that does exactly this, but I have problems with the module (maybe because it's old).

Thanks!
#5
Last year, I created a small silly game for MAGS in a few weeks. Although it wasn't my first game made with AGS, it was my first "published" game (now I'm working on two more titles). While watching the video that Stupot kindly recorded for the MAGGIES 2022, I realized (among other things that I have fixed now) something weird: in one of the rooms (Roman room), we have a board with many items that we have to find. As a hint system, I made it so that when the name of the object is clicked, an image of the item appears (and when the name is clicked again, it disappears). That image(s) is/are also a GUI, just like the item names on the board (yeah, a label would be better). However, I noticed that when someone clicks on another name (without clicking again to make the previous image disappear), the previous image remains and the effect is pretty awkward. I'd want that when one name is clicked and the previous image remains, that previous image dissapear before that make the other visible.

Here's the video (courtesy of Stupot) at 24:10:


I was thinking of possible solutions... maybe creating an array and assigning each item name (which is also a GUI) a position in the array. But I can't find a way to do it.


Thanks!
#6
Hi everyone!

I was trying to do what is on the title. I have a text label (label3) inside a GUI that says "Interact", and I want that when the cursor is over that label the label change its text to "Select" but, when the mouse leaves that label, I want it says "Interact" again.

I thought in using GUIControl  to get the mouse coordinates with GUIControl.GetAtScreenXY(mouse.x, mouse.y). But I have a problem because the text remains fixed in "Select" even when the mouse leaves the label (instead of change to "Interact" again).

That's my faulty code:

Code: ags
GUIControl *guicon = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
Label *lab;

  if (guicon != null) //Mouse is on the label
  {
    lab = guicon.AsLabel;
  }
  if (lab != null)
  {
    if (lab.OwningGUI==gInfo)
    {
      Label3.Text="Select";
      }
    }

Maybe there's a more efficient way to do that. I guess I'm complicating things  :) .

Many thanks!
#7
I wasn't sure where to post this, but I guess this is the right place.

It's a triviality, very low priority request. But I'd want to know if there's a posibility to make System.Gamma works on windowed mode (for now this only works on MS Windows FullScreen). IDK if that's a hard thing to do (or if it's even possible), but I leave this request for future.

Thanks!
#8
This maybe it's a silly question but... Is there any way in game to set VSync true/false with D3D9 or OpenGL? (System.VSync only works with Software Render)

I know I can set this from the editor (Default Setup), but it would be nice if the user can change it via a GUI inside the game.   
#9
I was wondering if there's a way to link the character movement, for example, to the properties of a GUI (like its transparency). So while a character (the player) walks in X axis coordinates a GUI could slowly became visible (from 100 to 0 transparency). Or even a Music could slowly became more loud.

Maybe with a while condition?

Code: ags
While (player.moving? player.x >Screen.Width / 2?)
{
GUI.transparency--;?
}

But i'm sure I'm not understanding how while works.

Thanks!

#10
Hi everybody!

It's kinda hard to explain, at least to me... But here we go:

I have an inventory that displays four inventory items "per page". This inventory has two buttons for scrolling purposes (the classical btnInvUp and btnInvDown). I have asigned a sound to each one so when I click one of them it sounds a scroll sound.



But I want to play a sound (scroll sound) when there is more items in the next "page" to show and another sound when there isn't more items (stuck sound). Similar case when I have less than 4 items, it should sound "stuck" in both ("<" and ">") buttons. But if I have, for example, 5 items it should sound stuck in "<" and sound scroll when I click on ">" because there is a new "page" with one item.

For example in this scenario, if I click the right btnInvDown (>) it must sound a "stuck sound" because there isn't enough items:



I belive I have to code with "InvWindow functions and properties", and "ItemCount"/"ItemsPerRow"/"RowCount". But I have not find the right way to do that. Bearing in mind I don't know yet how many inv items my game will have.

Many thanks!
#11
Hi :)

I realize I have a problem with "face location" in scrolling rooms (in "normal" rooms it works great). I set FaceLocation to get coordinates from mouse, so when the cursor interacts with something like a character, hotspot, object... in some specific side of the room the player character turns that direction.
I suspect that this problem in scrolling rooms have to do with room coordinates being different to screen coordinates. So instead of the classic

Code: ags
player.FaceLocation(mouse.x, mouse.y);

I write this:

Code: ags
player.FaceLocation(mouse.x - (Game.Camera.X), mouse.y - (Game.Camera.Y));

But didn't work at all, and now I'm pretty confuse about it  :-\




#12
Hi everyone!

I have a little question about inventory items/window. Normally inventory isn't a problem, but this time I want to organize items on my inventory this way:

Inv-Diagrama" border="0

Where the "I's" are the inventory items. The problem is I don't know how to place the items in the inventory in their correspondent "space". I mean I know how to change item height and item width but that doesn't work beause the space is not always the same. For example between item 1 and item 2 there is not the same space than between item 2 and item 3. I try to "artificially" put a transparent space in the sprite image of the item but that doesn't work either because I don't know the order the player will to pick up the objects.

Is there any way to solve this problem? Maybe "segmenting" the inventory window into multiple windows of the same inventory? Or maybe I have to change this GUI and make a more convenient one?
#13
Imagen67" border="0


A little first person point n' click adventure made for MAGS May "Museums"

Imagen2" border="2

A Monstuano suddenly comes to the Non-Living Entities Redirection Office.

And that means... troubles. The eternal intern of the office will try to get some specific items
to complete the ritual that will lead the Monstuano to his respective paradise.

Imagen3" border="2

What does all this have to do with a museum?
Well, where can you get a Roman Patera, an Inca Quero and a Chinese Ding?

Imagen4" border="2

And no. I don't understand the boss either.

qudipa" border="0

#14
Sopor" border="0


This short game it's about a person who wakes up in the middle of the night, trapped inside the duality between being awake and dreaming (sleep paralysis). They are visited by two entities that are willing to help them get out, one way or another.

This mini point and click game was made in the context of the Global Game Jam 2022 in just one week. The theme was: Duality

Instructions

Left click hold - Interaction wheel.

Right click - Inventory

Esc - Skip dialog and/or enter Quit Game GUI

Credits:

Jeremias Cerrone - Game Design

Florencia Del Pino - Narrative Design

Lucien Dupont Trape - Enviroment Art

Ezequiel Godoy - Assets and Character Art

Manuel Marchesotti - Programming and translation

Franco Malaspina - Music and SFX

Perpetua Franck - Project Management

Tween Module 2.2.2 by Edmundito


Download

Link Updated: 2/4/2022

SOPOR ETERNO (ETERNAL TORPOR)

(The game default language is Spanish, to set English language you
must click on "winsetup" and select "English" in Game Language section)




#15
Hi!

I have a doubt... it´s quite hard of explain but i´ll do my best:

I´m using the VerbCoin template and I put as string text "Use" in eModeInteact... that´s works in mostly scenarios except in a specific one: a drawer where I think is better to say "Open" instead of "Use".

Is there a way to change the string text ("VerbCoin.RegisterButton(btnInteract, eVerbCoinPositionSouth, eModeInteract, "Use");") ONLY in the case of interact with the drawer? Somewhat like:

Code: ags
 VerbCoin.InterfaceGui = gVerbCoin;
  VerbCoin.RegisterButton(btnLook, eVerbCoinPositionNorth, eModeLookat, "Inspect");
  VerbCoin.RegisterButton(btnTalk, eVerbCoinPositionEast, eModeTalkto, "Talk with");

  if (?????)
  {
  VerbCoin.RegisterButton(btnInteract, eVerbCoinPositionSouth, eModeInteract, "Open");
  }
  else 
  {
      VerbCoin.RegisterButton(btnInteract, eVerbCoinPositionSouth, eModeInteract, "Use");

  }
  VerbCoin.RegisterButton(btnPickup, eVerbCoinPositionWest, eModePickup, "Pick Up");


Thank in advance!

Cheers!
#16
Hi!

I hope my post is in the right forum. If not feel free to "move it" or delete it. Well, my question isn`t specific but a bit general:

Could I make a game like FRAN BOW (http://store.steampowered.com/app/362680) with AGS engine? I mean... technically speaking is it possible? Or that kind of "high resolution" sprites/graphics/backgrounds are too much for our old and beloved engine? By the way I think the scripting won`t be a problem.

Thanks!
SMF spam blocked by CleanTalk