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

#101
Hello,

I made something to allow resizing a GUI like this:



To use, you need to create a TextGUI, in the example, this TextGUI is named gNinePieceExample, and add each image for it



It works like this, you need to set the GUI as resizable somewhere, like game start for the GUI you want

Code: ags

gGui1.SetResizableProperties(
  ResizableGUI.Create(
    gNinePieceExample.AsTextWindow,
    /* horizontal resize graphic */ 1,
    /* vertical resize graphic */ 2,
    /* top left resize graphic */ 3, 
    /* top right resize graphic */ 4, 
    /* bottom left resize graphic */ 5, 
    /* bottom right resize graphic */ 6, 
    /* move cursor graphic */ 7, 
    /* is click resizable */ true
  )
);


The Code and Example project is on GitHub.

I need help figuring out if this API makes sense or not. I want to use this with another thing I am making.
#102
ArrowSelect version 0.6.1

Select things using arrows keys or joystick hat, module for in point and click games made with Adventure Game Studio.

Requires AGS 3.6.1



Get Latest Release arrowselect.scm | GitHub Repo | Demo Windows

Note: This module doesn't deal with printing things on screen, but if you want to do this, you may find it provides some helpful functions with the Interactives abstraction.

Basic usage

For basic usage with Keyboard, in your global script, add at game_start:

Code: ags
    ArrowSelect.enableKeyboardArrows();

Usage with joystick

If you are using a joystick or gamepad plugin, you will need to implement your own function to deal with. An example for hat is below.

Code: ags
    //pressed a hat
    void pressedPov(int pov){
      if(pov == ePOVCenter){
      } else if(pov == ePOVDown){
        ArrowSelect.moveCursorDirection(eDirectionDown);
      } else if(pov == ePOVLeft){
        ArrowSelect.moveCursorDirection(eDirectionLeft);
      } else if(pov == ePOVRight){
        ArrowSelect.moveCursorDirection(eDirectionRight);
      } else if(pov == ePOVUp){
        ArrowSelect.moveCursorDirection(eDirectionUp);
      } else if(pov == ePOVDownLeft){
        ArrowSelect.moveCursorDirection(eDirectionDownLeft);
      } else if(pov == ePOVDownRight){
        ArrowSelect.moveCursorDirection(eDirectionDownRight);
      } else if(pov == ePOVUpLeft){
        ArrowSelect.moveCursorDirection(eDirectionUpLeft);
      } else if(pov == ePOVUpRight){
        ArrowSelect.moveCursorDirection(eDirectionUpRight);
      }
      return;
    }

What are Interactives ?

Interactives are things on screen that the player can interact with.
These are Objects, Characters, Hotspots, and GUI Controls like buttons and others.
This module only cares for their type, and a position that is similar to the thing center that mouse can click.

Note that some gotchas apply, for example, if you have three different Hotspots areas that map to the same Hotspot, instead of finding out they are different, it will erroneously find a point in the center of them.
So if you have, for example, two TVs in your background, that have the same interaction, create two different hostpots for them and just map the same interaction function to both, otherwise this module will fail.

Code: ags
enum InteractiveType{
  eInteractiveTypeNothing = eLocationNothing,
  eInteractiveTypeObject = eLocationObject,
  eInteractiveTypeCharacter = eLocationCharacter,
  eInteractiveTypeHotspot = eLocationHotspot,
  eInteractiveTypeGUIControl,
  eInteractiveTypeGUI,
};

managed struct Interactive{
  int x;
  int y;
  int ID;
  InteractiveType type;
};

ArrowSelect API

bool ArrowSelect.moveCursorDirection(CharacterDirection dir)
Moves cursor to the interactive available at a direction. Returns true if the cursor is successfully moved.

Interactive* ArrowSelect.getNearestInteractivePointAtDirection(CharacterDirection dir)
Get the nearest interactive available at a direction. Returns null if there is none.

Point* ArrowSelect.getNearestInteractivePointAtDirection(CharacterDirection dir)
Get point of the nearest interactive available at a direction. Returns null if there is none.

bool attribute ArrowSelect.UseMouseAsOrigin
If true, Mouse position is used as origin in getNearestInteractiveAtDirection and related functions. Default is true.

Point* attribute ArrowSelect.Origin
Point used as origin if UseMouseAsOrigin is false.

void filterInteractiveType(InteractiveType interactiveType, InteractiveFilter filter=0)
Filters or not a interactive type for cursor moveCursorDirection and getNearestInteractivePointAtDirection.

bool ArrowSelect.areKeyboardArrowsEnable()
Returns true if regular keyboard arrows are enabled for cursor movements.

bool ArrowSelect.enableKeyboardArrows(bool isKeyboardArrowsEnabled = 1)
Enables or disables (by passing false) regular keyboard arrows handled by this module.

Triangle* ArrowSelect.triangleFromOriginAngleAndDirection(Point* origin, int direction, int spreadAngle=90)
Returns a Triangle instance with one point at the origin points and the two other points separated by spreadAngle, and at the direction angle

int ArrowSelect.distanceInteractivePoint(Interactive* s, Point* a)
Retuns the distance between an interactive and a point.

Interactive* ArrowSelect.closestValidInteractivePoint(Interactive* Interactives[], Point* a)
Returns the closest interactive to a point.

Interactive*[] ArrowSelect.getInteractives()
Get a list of all interactives on screen.

bool ArrowSelect.isInteractiveInsideTriangle(Interactive* p, Point* a, Point* b, Point* c)
Returns true if an interactive is inside a triangle defined by three points.

Interactive*[] ArrowSelect.whichInteractivesInTriangle(Interactive* Interactives[], Point* a, Point* b, Point* c)
Returns a list of which triangles are inside a triangle defined by three points.

Implementation details

This is just the detail on how things works on this module

Problem
By using keyboard arrow keys or joystick directional hat, select between
clickable things on screen.

Solution
When the player press an arrow button do as follow:

1 .get the x,y position of each thing on screen,

2 .select only things on arrow button direction (example:at right of current
  cursor position, when player press right arrow button),

3 .calculate distance from cursor to things there, and get what has the smaller
  distance

Solution details
For 2, the key is figuring out the right angle and then create a triangle that
extends to screen border, the things inside the triangle can be figured with the
function below

https://stackoverflow.com/a/9755252/965638
Code: C++
public static bool PointInTriangle(Point p, Point p0, Point p1, Point p2)
{
    var s = p0.Y * p2.X - p0.X * p2.Y + (p2.Y - p0.Y) * p.X + (p0.X - p2.X) * p.Y;
    var t = p0.X * p1.Y - p0.Y * p1.X + (p0.Y - p1.Y) * p.X + (p1.X - p0.X) * p.Y;

   if ((s < 0) != (t < 0))
    return false;

var A = -p1.Y * p2.X + p0.Y * (p2.X - p1.X) + p0.X * (p1.Y - p2.Y) + p1.X * p2.Y;

return A < 0 ?
        (s <= 0 &amp;&amp; s + t >= A) :
        (s >= 0 &amp;&amp; s + t <= A);
}

Author

Made by eri0o

License

Distributed under MIT license. See LICENSE for more information.
#103
Hello,

Since today I am getting two weird bugs that I either didn't have before or never noticed on the AGS 3.4.3.1 Editor. Note that I use AGS Editor on Ubuntu 18.04 (previously 16.04) through Wine, for years, but this has never been a problem.

Sometimes, when I try to rename a script and then cancel the action, I get the following error on the Editor.

Error: External component has thrown an exception.
Version: AGS 3.4.3.1

Code: ags
System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at System.Windows.Forms.Control.DefWndProc(Message& m)
   at System.Windows.Forms.TreeView.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Also when I replace some text on the code editor, when I rewrite the name of a variable by double clicking it to select and start typing, I get:

Error: Length cannot be less than zero.
Parameter name: length
Version: AGS 3.4.3.1

Code: ags
System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at AGS.CScript.Compiler.FastString.Substring(Int32 offset, Int32 length)
   at AGS.Editor.AutoComplete.ConstructCache(Script scriptToCache, Boolean isBackgroundThread)
   at AGS.Editor.ScriptEditor.scintilla_OnBeforeShowingAutoComplete(Object sender, EventArgs e)
   at AGS.Editor.ScintillaWrapper.ShowAutoComplete(Int32 charsTyped, String autoCompleteList)
   at AGS.Editor.ScintillaWrapper.ShowAutoCompleteIfAppropriate(Int32 minimumLength)
   at AGS.Editor.ScintillaWrapper.OnUpdateUI(Object sender, EventArgs e)
   at Scintilla.ScintillaControl.DispatchScintillaEvent(SCNotification notification)
   at Scintilla.ScintillaControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Has someone ever met those bugs? I have recently used the latest 3.5.0.14 release of the Editor and I think they don't happen there, but I think I didn't got they before on 3.4.3.1, so I think I have something funny somewhere on my project.

I have backups so currently I am trying to see if there was any state before where this didn't occur. I really don't remember having them.
#104

Investigate the death of a mysterious woman in this short point and click game. Made for Adventure Jam 2019!

with


Francisco Gonzalez as Detective Logan
Miranda Gauvin as Emily Feliz
Mike Bodie as Lawson Aris
Sally Beaumont as MJ
Space Quest Historian as Wyatt
Paul Thomas as Remington Noe
Dave Macclellan as Jazz
and
Dave Gilbert as Roger


Written and Coded by Érico Porto
Art by Ricardo Juchem
Cover Art by Melany Sue
Sound Design by Edwyn Tiong
Music by Jon Paul Sapsford
Script Revision by Joth

Special thanks to Morgan Willcock who provided insights and revised my writing,
Crimson Wizard for the great latest ags beta,
and to Zaira, who kept me alive during the course of the jam.

     

#105
I think I found a bug

myfile.ash
Code: ags
enum EnumState {
  eES_False = 0, 
  eES_True = 1,   
};

struct Foo{
  protected EnumState _state;
  import attribute EnumState public_state;
};

Foo bar;



myfile.asc
Code: ags
FindoutStateEnum get_public_state(this Foo*){
  return this._state;
}
void set_public_state(this Foo*, EnumState value){
  this._state = override;
}


Trying to read bar.public_state get's me zero - elsewhere or in the same file (using bar.get_state()).

I guess I shouldn't declare the instance bar of Foo in the .ash, but I wanted something akin to a global singleton.

My solution was to change myfile.asc to
Code: ags

int local_state;

FindoutStateEnum get_public_state(this Foo*){
  return local_state;
}
void set_public_state(this Foo*, EnumState value){
  local_state = override;
}


---

Edit: CW solved below.
#106
Advanced Technical Forum / Rect object
Fri 07/06/2019 19:27:47
Has someone coded something similar to this? Maybe a math module that has a similar object. I am a bit unsure on how to fill the functions imported by these functions.

Edit: Solved

ash
Code: ags

managed struct Size{
  int width;
  int height;
  import static Size* Create(int width, int height);  // $AUTOCOMPLETESTATICONLY$
  import Size* Add(Size * sizeToAdd);
  import Size* Subtract(Size * sizeToAdd);
  import Size* MultiplyInt(int multiplier);
  import Size* MultiplyFloat(float multiplier);
  import Size* Set(Size* sizeToSet);
};
 
managed struct Rect {
  int x;
  int y;
  int width;
  int height;
 
  import static Rect * Create(int x, int y, int width, int height);  // $AUTOCOMPLETESTATICONLY$
  import Rect * SetPosition(Point * point);
  import Rect * SetSize(Size * size);
  import Rect * SetBounds(int x, int y, int width, int height);
  import Rect * SetBoundsRect(Rect * rect);
  import Rect * SetBoundsPS(Point* position, Size* size);
};


asc
Code: ags

// Size object
static Size* Size::Create(int width, int height){
  Size * size = new Size;
  size.width = width;
  size.height = height;
  return size;
}

Size* Size::Add(Size* sizeToAdd){
  this.width += sizeToAdd.width;
  this.height += sizeToAdd.height;
  return this;
}

Size* Size::Subtract(Size* sizeToAdd){
  this.width -= sizeToAdd.width;
  this.height -= sizeToAdd.height;
  return this;
}

Size* Size::MultiplyInt(int multiplier){
  this.width = this.width*multiplier;
  this.height = this.height*multiplier;
  return this;
}

Size* Size::MultiplyFloat(float multiplier){
  this.width = FloatToInt(IntToFloat(this.width)*multiplier);
  this.height = FloatToInt(IntToFloat(this.height)*multiplier);
  return this;
}

Size* Size::Set(Size* sizeToSet){
  this.width = sizeToSet.width;
  this.height = sizeToSet.height;
  return this;
}
// End of Size object

// Rect object
static Rect* Rect::Create(int x, int y, int width, int height){
  Rect* rect = new Rect;
  rect.x = x;
  rect.y = y;
  rect.width = width;
  rect.height = height;
  return rect;
}

Rect * Rect::SetPosition(Point * point){
  this.x = point.x;
  this.y = point.y;
  return this;
}

Rect * Rect::SetSize(Size * size){
  this.width = size.width;
  this.height = size.height;
  return this;
}

Rect * Rect::SetBounds(int x, int y, int width, int height){
  this.x = x;
  this.y = y;
  this.width = width;
  this.height = height;
  return this;
}

Rect * Rect::SetBoundsRect(Rect * rect){
  this.x = rect.x;
  this.y = rect.y;
  this.width = rect.width;
  this.height = rect.height;
  return this;
}

Rect * Rect::SetBoundsPS(Point* position, Size* size){
  this.x = position.x;
  this.y = position.y;
  this.width = size.width;
  this.height = size.height;
  return this;
}
// End of Rect Object

#107


Download RogerCamGame.zip

Hey just made a very simple thing, just to teach myself one of the many possibilities with the new Camera and Viewport system.

I already showed some of the people this. If you look into the script, the part that deals with camera and viewport is just two lines of code and the rest is more some fancy ideas to try to emulate a screen, and the other a thing to prevent the viewport from stretching the camera.

Anyway, this is just because there may be few people who tried the new Camera and Viewport functionality, and I thought they are pretty neat.
#108
https://www.theverge.com/platform/amp/2019/5/30/18645250/microsoft-xbox-game-studios-publishing-valve-steam-32-bit-windows

QuoteMicrosoft says it's committed to supporting competing PC game stores and it's announcing today that it will distribute more Xbox Game Studios titles through Valve's Steam marketplace. Typically, Microsoft has distributed its games through only Xbox Live on its game console platform and through its own Windows storefront on PC. Now, Microsoft says it wants to better support player choice and let customers buy games in more than one destination on PC.

“Our intent is to make our Xbox Game Studios PC games available in multiple stores, including our own Microsoft Store on Windows, at their launch. We believe you should have choice in where you buy your PC games,” writes Xbox chief Phil Spencer in a blog post announcing the shift in strategy. The move follows Microsoft's decision earlier this year to publish its upcoming PC port of Halo: The Master Chief Collection on Steam.

“We will continue to add to the more than 20 Xbox Game Studios titles on Steam, starting with Gears 5 and all Age of Empires I, II, and III: Definitive Editions,” Spencer explains. “We know millions of PC gamers trust Steam as a great source to buy PC games and we've heard the feedback that PC gamers would like choice.”

It's not an unusual move for Microsoft these days, especially not since Spencer took over the Xbox division in 2014 under CEO Satya Nadella, who promoted him again in the fall of 2017 to run all of the company's gaming initiatives spanning Xbox and Windows 10.

The two have worked together to build a far more open and cooperative Microsoft, and that's given birth to a lot of genuinely player-friendly advancements in the Xbox and Windows departments. Xbox games published by Microsoft can now be played on the PC free of charge, thanks to the Xbox Play Anywhere initiative, while Microsoft worked with Nintendo and game developers like Epic and Psyonix to successfully apply pressure on Sony to support cross-platform play. The company is also pioneering a new business model for games with its Xbox Game Pass subscription, and its upcoming xCloud cloud gaming service is poised to introduce an all-new distribution model for delivering games and potentially upending how games are both funded and sold.

What's remarkable in this case is that Microsoft is standing somewhat in opposition to Epic Games, a company whose CEO Tim Sweeney once criticized Microsoft for attempting to create a closed ecosystem with its Universal Windows Platform strategy, which attempted to distribute all software, including PC games, exclusively through its own storefront.

”Microsoft has built a closed platform-within-a-platform into Windows 10,” Sweeney wrote in a 2015 op-ed in The Guardian, “as the first apparent step towards locking down the consumer PC ecosystem and monopolising app distribution and commerce.” At the time, Sweeney called for Microsoft to let developers publish games built using UWP on other stores. He went so far as to say UWP “can, should, must, and will die.”

Now, it's Epic that's trying to supplant Steam with its own game store and finding itself embroiled in controversy stemming mostly from its exclusivity contracts it secures with developers. Of course, Epic's approach is much different than Microsoft's was back then, given it does not own the Windows operating system and has nowhere near the level of control Microsoft did when it was trying to push UWP. But Epic, despite having earned a substantial amount of leverage in the PC marketplace due to the success of Fortnite and its Unreal Engine, is discovering just how difficult it is to dethrone Steam.

Microsoft, on the other hand, has given up entirely on that vision and is instead embracing a much more open model. And it extends beyond gaming. Microsoft recently announced a partnership with Google to rebuild its Edge browser, once built on UWP, using the open-source Chromium framework.

“We also know that there are other stores on PC, and we are working to enable more choice in which store you can find our Xbox Game Studios titles in the future,” Spencer writes, indicating that Microsoft may eventually publish its games on Epic's store as well. Spencer goes on to say that the company is committed to providing voice and text chat, friends lists, and cross-play across PC and console to all titles it publishes under Xbox Game Studios. “On Windows 10 you'll find this functionality in the Xbox Game Bar, which we'll continue to evolve and expand,” he adds.

In addition to this shift to support Steam and competing stores, Microsoft says it's also opening up support in the Microsoft Store for games built as native Win32 apps, which is the predominant Windows app format and the format that UWP effectively was designed to replace. This all but ensures UWP will fall out of favor with game studios that may have felt forced to adopt the format in recent years to better access core Windows 10 features.

“We recognize that Win32 is the app format that game developers love to use and gamers love to play, so we are excited to share that we will be enabling full support for native Win32 games to the Microsoft Store on Windows,” Spencer writes. “This will unlock more options for developers and gamers alike, allowing for the customization and control they've come to expect from the open Windows gaming ecosystem.”

I just read this, and being AGS Win32 software, this means (I imagine) zero effort shipping of AGS Games on MS Store soon.
#109
http://jams.gamejolt.io/advjam2019/community

Adventure Jam 2019 is happening soon! If someone is thinking on doing it now is a good time to start figuring out teams!

The theme is only announced once it starts going!

Start: Jun 8, 2019 12:00:00 PM
End: Jun 22, 2019 12:00:00 PM
Voting End: Jul 1, 2019 12:00:00 PM

Surviving Adventure Jam
Text Resources
#110
Hello,

I am  trying to recreate something like the current TextGUI, html border-image (or Unity 9-Slices). Essentialy this box / rectangle will be so that:

  • The four corners do not change in size.
  • The top and bottom edges stretch or tile horizontally.
  • The left and right edges stretch or tile vertically.
  • The center section stretches or tiles both horizontally and vertically.
The idea is to use it with a custom function that's not the current text functions (like Say, and Display). Instead I want to make my own custom MySay that will exhibit a label with text, and a box around it.

Ok, now, how is the best way to go on to make this? Can I just have 9 buttons with a label on top? How I would stretch the image for drawing the borders?

I am trying to figure out the less resource intensive way to do this.
#111

ags on.chocolatey.org repository. If someone wanting to try AGS Editor on Windows and have Chocolatey installed, you can now run

Code: batch
cinst ags

AGS should install.



#112
Clicking on Download page from the main website goes to here:

https://www.adventuregamestudio.co.uk/site/ags/

But a lot of the contents are not really updated.

AGA, would you be ok with having some webpage for downloads built on github to be cloned there? I feel it could easen the update process for that particular page.
#113
I was unsure whether to post here or on beginner questions.

Is it possible to change the font of the scripts on AGS?
#114
Hell's Puppy

Windows Download | Linux Download | Android on Google Play | Source Code | Android Studio Project | Global Game Jam Webpage

Hey everyone, this weekend was Global Game Jam and we made an AGS Game in under 48h, in a bar! It's not a common point and click but can be played with mouse input. It plays better with left and right arrows!

art:: Gabriel Fernandes - bakudas - Ricardo Juchem
code:: Erico Porto
gamedesign:: Marcel - bakudas - team
audio:: Maurício Munky

Expect bugs! Here are some game screenshots






#115
I have a room that when you go to the left edge, the player teleports to a different room. A character was following my player character in the first room. Two seconds later  the following character appeared in the second room!

Is this expected behavior?

Edit: apparently I coded a function to do this while I was sleeping and forgot it, nevermind.

Edit2: apparently no, I didn't... Damn, can't figure out how the character is following the player on other rooms!
#116
Site & Forum Reports / About AGS Wiki
Mon 31/12/2018 13:37:54
Just a curiosity about the Wiki linked in the forums here, I think the maintenance of the one here on github may be easier. Is there interest in linking it here somewhere? Maybe some interesting knowledge from the original wiki could be migrated to that other one.
#117
So, I think I sucessfully built AGS ENGINE for Linux and packed as Snap.

To test it, you need first to install, just launch a Terminal anywhere and type:

Code: bash

snap install ags


Once it's installed, in the game folder (where the .exe file is) just run it:

Code: bash

ags


in some systems, fullscreen is problematic, then try:

Code: bash

ags --windowed


Please, report issues in the tracker here or this thread.

Also, AGS seems to have successfully built on the following systems: amd64/i386/arm64/armhf/s390x . This means it should work on any Ubuntu/snap compatible distribution on the Raspiberry Pi !
#118
I just watched Brett Hennig TEDx Talk about replacing democracy for a random selecting system and I had a random idea for an overtly complex (maybe) game.

Basically the idea is this, a city builder like Sim City 2000, with something like Entity Based Modeling for simulating, with a dummy IA building the city. The AI turn, it does it's random city building.

On the player turn, he gets a random citizen from the city assigned to him as his player character, and he has to create a policy (have no idea how exactly) that will influence how the city builder AI works, hopefully trying to maximize what's best to that citizen.

As the game progress, you are being matched with different citizens of the city, and they are all being behind the curtains being tracked. At the end of 15 turns, the final score for each assigned citizen is shown, and also the town score (population, produced money, debt,...).

This is just like the general idea, but I have no real idea if it could be fun or not, but the idea would be something that is visually interesting but still has lots of possibilities like Democracy.

Any thoughts?
#119
was looking SaveScreenShot in the manual today... I noticed it says one can choose either .pcx or .bmp .
I think it's only .bmp, but I am not sure, since it appears it just saves the buffer directly to file. Just wanted to fix it, since I think .pcx only exists in the engine for preload.pcx image (but I can be wrong).
#120
Hello,

I would like to suggest moving the default ags manual to a online help, and f1 just running a search on this online help in the user own browser. Most softwares uses online manuals these days.

We are hitting some hard issues to support using the current .chm help with easier to edit and maintain help. The new help gives per topic markdown files that can be edited online instead of the old 22k lines of LaTeX text file and a ton of magic.

Here is how is the online manual now:
https://adventuregamestudio.github.io/ags-manual/index.html

And here is the repository for it:
https://github.com/adventuregamestudio/ags-manual
SMF spam blocked by CleanTalk