Recent posts

#91
Competitions & Activities / Re: Background Blitz: panorami...
Last post by Creamy - Tue 22/04/2025 00:14:21
Quote from: Misj' on Wed 16/04/2025 20:28:24@Creamy: My entry is moving along. But I already know I'm probably going to need an extra week to finish it. I'll try to hit the deadline, but might require an extension.

I've added an extra week.
#92
Beginners' Technical Questions / Re: Making an object hover
Last post by brushfe - Mon 21/04/2025 21:22:41
Woah, that is next level math! Thank you very much, this is such a cool solution and it will certainly help me get into the numeric side of animation. I can't wait to try it out! Gracias!
#93
Beginners' Technical Questions / Re: Making an object hover
Last post by Khris - Mon 21/04/2025 21:01:36
You can use a sine wave for this:

Code: ags
float angle;

function repeatedly_execute_always {
  angle += 0.03;
  if (angle > Maths.PI * 2.0) angle -= Maths.PI * 2.0;
  oHoverboard.Y = 120 + FloatToInt(Maths.Sin(angle) * 10.0, eRoundNearest);
}

(Just add this to your room script and adjust the object's script name and initial y coordinate of 120.)
#94
Beginners' Technical Questions / Making an object hover
Last post by brushfe - Mon 21/04/2025 20:01:40
Hello!

I wondered if anyone has a more efficient way of making an object 'hover' or 'float' than the current plan of using animation frames.

The objects are static, and only really need to move up a couple of pixels, then down a couple of pixels, in an endless loop. I figured animation could solve it, but it feels like a waste of space to keep duplicating sprites and shifting them up/down.

I'm still getting the hang of AGS, but perhaps there's a bit of math or a tween that could take care of it?

Thank you very much!
#95
Quote from: gabriel19681_1 on Mon 21/04/2025 15:20:01Hello, I have a game that is very difficult to find, Abstract, Or at least I think so, since I can't run it. I'll leave it to you to see if anyone can tell me how to run it. Thanks.

https://mega.nz/file/wFojRaKB#jedO-ZMbHGdhDYB0_LiUAdFKD_nR6dqq6q6WiV_Av6A
This one is also here: https://lost-ags-games.itch.io/abstract
The TMD has commented (Two years ago):
QuoteAnother missing game no more lost. Thanks for your efforts in preserving them. Downloaded and tested on DosBox: nicely working
#96
Hello, I have a game that is very difficult to find, Abstract, Or at least I think so, since I can't run it. I'll leave it to you to see if anyone can tell me how to run it. Thanks.

https://mega.nz/file/wFojRaKB#jedO-ZMbHGdhDYB0_LiUAdFKD_nR6dqq6q6WiV_Av6A
#97
General Discussion / A long, sad joke (AKA American...
Last post by RootBound - Mon 21/04/2025 14:58:49
So a person walks into a doctor's office, and the doctor says, "You're too healthy. I'm prescribing a headache. I'll send the prescription in to your pharmacy."

The patient goes to the pharmacy, who say they received the prescription and they do have the headache in stock, but the patient's health insurance won't pay for it because it's a name brand and not a generic, with a price for 90 days of $35,000 dollars, which exceeds the plan's coverage. The pharmacy tells the patient they need to call their insurance.

The patient calls their insurance and waits on hold for a while. When a representative picks up, the representative explains that they need a Prior Authorization from the doctor. This is a basically a note from the doctor saying the patient needs the medication.

The patient says, "Isn't that just a prescription?"

The representative says, "No, this is a note from the doctor saying the patient actually needs the medication."

The patient calls back the doctor's office and says, "They need a Prior Authorization."

The doctor's office says, "Sure, we'll send that right in."

The patient goes back to the pharmacy, and the pharmacist says, "Sorry, the insurance is still saying they won't pay for it."

The patient calls the insurance again, who says, "We never received the Prior Authorization from the doctor's office."

The patient says, "Isn't there anything you can do? My doctor says I really need this headache."

The representative says, "Let me transfer you to another representative."

The patient waits on hold for awhile again.

The second representative says, "I dug around and figured out a way to override this. That means we'll pay for 90% of the cost of the prescription, so that leaves you with a co-payment of only $3,500 for the 90 days, or only $1,166 per monthly refill."

The patient goes back to the pharmacy counter, and the pharmacist says, "We haven't received any override information from the insurance. Do you want to pay the out-of-pocket price?"

The patient sits down in the waiting area and says, "God, my head hurts."
#98
General Discussion / Re: Newbies introduce yourselv...
Last post by heltenjon - Mon 21/04/2025 13:27:57
Welcome, Zwiffer. We look forward to playing your game when you're ready to show it. You'll find many Sierra fans here, and the community is awesome.  (nod)
#99
General Discussion / Re: Your thoughts on A.I. art ...
Last post by Snarky - Mon 21/04/2025 12:23:34
(I just deleted the post CW linked to and banned the poster, so the link doesn't work any longer.)

Quote from: Crimson Wizard on Mon 21/04/2025 11:07:50I also understand that it's not correct to blame without evidence, so won't.

You did, though.  :-D

As you know, Crimson, but others might not, the moderators keep an eye on certain posters we suspect may be spam bots, and as soon as we notice sufficient evidence (usually in the form of a spam link) they get banned. If any AGSers have suspicions about any member, new or old, please report one of their posts or send us a PM rather than speculating in public.

The moderators take slightly different attitudes to this, but personally I apply a policy of "innocent until proven guilty," and consider the act of publicly accusing someone of possibly being a spam bot as potentially a form of harassment. (Also, if you are right, they are going to be banned soon and all their posts deleted, so posting about it just adds clutter to the forums.)
#100
Modules, Plugins & Tools / Re: MODULE: jsonparser 0.1.0
Last post by Snarky - Mon 21/04/2025 11:44:40
I went ahead with a rewrite of the module to fit my requirements and preferences. The implementation is still based on the same JsonParser (discarding MiniJsonParser), and it should produce essentially the same parse trees, but the user-facing API is rather different.

I still need to do some code cleanup, I haven't thoroughly tested it, and there are some minor features missing (there should be a way to dispose of the parsed data if you no longer need it, for example), but it seems to be working, so this could be considered a pre-release:

Json.ash
Json.asc


The API looks like:

Spoiler
Code: ags
/// A Json node/token, with parent/child/sibling links forming a Json tree
managed struct Json
{
  /// ID of this Json token (for internal/debugging use)
  import readonly attribute int Id;
  /// ID of this Json tree (for internal/debugging use)
  import readonly attribute int TreeId;
  
  /// Type of this Json node
  import readonly attribute JsonType Type;
  /// String representation of the Json Type
  import readonly attribute String TypeAsString;
  /// Key for this Json node (null if none, implies this node is the root)
  import readonly attribute String Key;
  /// Value of this Json node,  as a string (i.e. all its contents; if node is not a leaf, its full subtree)
  import readonly attribute String Value;
  /// Value as int
  import readonly attribute bool AsInt;
  /// Value as float
  import readonly attribute bool AsFloat;
  /// Value as bool
  import readonly attribute bool AsBool;
  
  /// Path from the root to this Json node
  import readonly attribute String Path;
  
  /// The root of the Json tree this node belongs to (if node is root, returns itself)
  import readonly attribute Json* Root;
  /// The parent of this Json node (null if none, i.e. this node is root)
  import readonly attribute Json* Parent;
  /// The direct children of this Json node
  import readonly attribute Json* Child[];
  /// The number of direct children of this Json node (size of .Child[])
  import readonly attribute int ChildCount;
  /// The next sibling of this Json node (so if this node is this.Parent.Child[i], returns this.Parent.Child[i+1]; null if none)
  import readonly attribute Json* NextSibling;
  
  /// Whether this Json node is a leaf node
  import readonly attribute bool IsLeaf;
  /// Whether this Json node is the root of the Json tree
  import readonly attribute bool IsRoot;
  
  /// Select a node in this node's subtree (using the subpath to navigate)
  import Json* Select(String path);
  
  /// Convert this Json node to a flat dictionary (making each leaf in its subtree a key/value pair)
  import Dictionary* ToDictionary(Dictionary* dictionary=0);
  
  /// Parse a String into a Json tree, returning the root node (null if error, see Json.ParserState)
  import static Json* Parse(String jsonString);
  /// Parse a text file into a Json tree, returning the root node (null if error, see Json.ParserState)
  import static Json* ParseFile(String fileName);
  /// Status of parser after parsing (if successful >0, count of tokens parsed; if error, JsonError value)
  import static readonly attribute int ParserResult;
  /// Number of Json trees parsed and stored
  import static readonly attribute int TreeCount;
  /// Retrieve a Json node directly (for internal/debugging use)
  import static Json* GetNode(int id);
  /// Retrieve a Json tree
  import static Json* GetTree(int treeId);
};
[close]

And you can use it like this, for example:

Code: ags
  Json* jsonData = Json.Parse("{ "ags-games": [ {"title": "Rosewater", "author": "Grundislav", "released": true} , {"title": "The Flayed Man", "author": "Snoring Dog Games", "released": true}, {"title": "Old Skies", "author": "Wadjet Eye Games", "released": false}] }");
  // Or to read from a file: Json* jsonData = Json.ParseFile("$INSTALLDIR$/ags-games.json");
  if(jsonData)
  {
    Json* agsGames = jsonData.Select("ags-games");
    for(int i=0; i<agsGames.ChildCount; i++) // Loop through "ags-games" array
    {
      Json* agsGame = agsGames.Child[i];
      AgsGameData* gd = AgsGameData.Create();  // Assume we have this managed struct defined

      // Set fields
      Json* title = agsGame.Select("title");
      if(title) gd.Title = title.Value;
      Json* author = agsGame.Select("author");
      if(author) gd.Author = author.Value;
      Json* released = agsGame.Select("released");
      if(released) gd.IsReleased = released.AsBool;
    }
  }

My plan is to use this to let developers and players import (and eventually export) style sheets for the TextField and SpeechBubble modules. I also think the approach of having styling specified in external data files rather than hardcoded in script is generally useful for other modules and templates, particularly in light of the accessibility considerations we discussed some time ago. (In many cases it will probably be more convenient to use INI files and Dictionaries, but JSON is better for more complex, structured data.)
SMF spam blocked by CleanTalk