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 - Monsieur OUXX

#21
You go get them tiger! I predict this game will be super fun.
#22
Quote from: morganw on Wed 20/05/2020 16:00:58
It is probably worth noting that recent builds of Windows 10 come with a version of curl, and that AGS doesn't change the working directory when it starts, so potentially you may actually be running a separate copy and not the one which you have supplied. Also this shouldn't be confused with the curl alias in Powershell, which is a horrific attempt to map the symbol 'curl' to Powershell's web request functions (which are dependent on other system/IE components, which are potentially not operational).

Is curl a standard program in Linux and/or MacOS? It would be cool if I didn't have to ship it with any of my game's ports.
#23
So I've tried this and it seems to work on Windows 10, AGS 3.5.0.24 (aka "patch 2") using curl 32 bits :
Code: ags

  ShellExecute("", "curl.exe", "\"https://www.raidersofthesevencities.com/stats-startup.html\"");


I've simple put all files from curl's "bin" folder into my AGS game's execution folder
Code: ags

curl.exe
curl-ca-bundle.crt
libcurl.dll


Me happy.

I'm very happy that I can just download the binaries for Curl on other systems (MacOS) right off the website.
I'm less happy that I only have the sources to ags_shell and that I need to build them myself for MacOS or Linux. But, oh well. I can't really compain about that.

#24
Quote from: Khris on Wed 20/05/2020 10:46:57
(Also, maybe a mod can split off the https messages and move them to the technical forum?)

Nah, it's really not AGS, just me not understanding internet protocols.
If ShellExecute("", "http://google.com", "") works, I don't need more. Again, I don't need to parse the result, I just need the http server to know that someone hit that page.
Nope, that's no good. It does switch out from the game and open the page in a browser. I want to silently hit the page. I'll try curl.
#25
Quote from: Khris on Wed 20/05/2020 08:30:31
Not sure, but you can use curl instead.

And here's the plugin: ags_shell

It will be a better solution, because this causes the page to open in a browser, which I don't want :
Code: ags

ShellExecute("open", "rundll32.exe", "url.dll,FileProtocolHandler http://www.google.com");
#26
Quote from: Khris on Wed 20/05/2020 07:59:12
ags_shell.
A few months ago I was trying to remember that plugin and couldn't find it. Thanks! I'll try. Maybe I can do everything through the shell, with Powershell commands. Will it pop up a shell terminal?
#27
Quote from: Khris on Tue 19/05/2020 19:56:05
Anyway, the socket plugin has no built-in support for https, all it does is open connections. You would have to implement the entire ssl protocol yourself.

OK but before it sends encrypted stuff there has to be a way for me to simply get a "you hit the right page, thank you" answer, without any encryption-related code? I humbly confess I don't know enough.
#28
I'm trying to get an HTTP response from a https page, using AGS (ags sockets plugin)
I don't really care bout the content, I just want an HTTP 200.

When I try with postman this is what it sends to the server :

Code: ags

GET https://www.raidersofthesevencities.com/stats-startup.html

User-Agent: PostmanRuntime/7.24.1
Accept: */*
Host: www.raidersofthesevencities.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive


Nothing fancy.

Here is how I try to replicate it :
Code: ags

  String host = "www.raidersofthesevencities.com";
  String path = "/stats-startup.html";

  SockAddr *ip = SockAddr.CreateIP(host, 80); //Only 80 works, 443 doesn't return anything

  state.server = Socket.CreateTCP();
  state.connected = !state.server.Connect(ip);
  state.server.blocking = false;

  if (state.connected) {
    String completeTarget = String.Format("https://%s%s", host,  path); //  https://www.raidersofthesevencities.com/stats-startup.html
    
    String command = "";
    
    command = command.Append(String.Format("GET %s HTTP/1.1\r\n", completeTarget )); //I tried removing HTTP/1.1, I get "bad request"
    command = command.Append(String.Format("Host: %s\r\n", host));
    command = command.Append("Connection: keep-alive\r\n");
    command = command.Append("Accept: */*\r\n");
    command = command.Append("Accept-Encoding: gzip, deflate, br\r\n");
    command = command.Append("User-Agent: AGS (Windows NT 5.1; U; en)\r\n\r\n");
    
    state.server.Send(command);
  }


Yet when I try that, I get a "301 permanently moved". And the response contains :
Code: ags
Location: https://www.raidersofthesevencities.com/stats-startup.html

As you know this is the server's subtle way of telling you that you're a silly goose and that you should have gone straight away to HTTPS instead of starting with HTTP. Except... I did start with https, with exactly that URL.

What am I missing?
#29
I'm still interested in the MacOS executable though, even with the colors issue  :=
I can act as a tester if you guys wish.
#31
Time to beg!  :=
Do you think you guys could upload the 3.5.0.x engine executable for MacOS somewhere? And since you're there, maybe also the Linux one? (I'm guessing they're not too different but maybe I'm wrong).
Asking for my personal sanity. The learning curve for compiling on Mac is just too much.
#32
A small improvement but very convenient :

VerbsGui.ash

Code: ags

enum eObjectType {
  eGizmo, //use this type for regular-sized objects. Usually, objects that the player could physically pick up but doesn't need.
  eHeavy,  //use this type for objects that are too heavy to pickup/push/pull
  eCharacter, //appropriate responses to silly attempts like "opening" a human being.
  eDoor //similar to eHeavy but slightly more specific in regards to open/close/use
};

  // START MODIFICATION
  //import static void Unhandled(int door_script=0);
  import static void Unhandled(eObjectType objType = eGizmo,  int door_script=0); //I've put the new parameter first because you use it much more often
  // END



VerbsGui.asc
Code: ags

// START MODIFICATION
//static void Verbs::Unhandled(int door_script) 
static void Verbs::Unhandled(eObjectType objType, int door_script) 
// END
{


Then of course don't forget to update any call to Verbs.Unhandled in the template. When in doubt use eGizmo.
And of course don't forget to add all the new strings to verbsData.unhandled_strings. To sort them easily, you may get inspiration from these values :

Your own module
Code: ags

bool moduleInitialized = false;


String defaultSentence_Pull     ;
String defaultSentence_Push     ;
String defaultSentence_Give     ;
String defaultSentence_Interact ;
String defaultSentence_Look     ;
String defaultSentence_PickUp   ;
String defaultSentence_Talk     ;
String defaultSentence_UseInv   ;
String defaultSentence_Open     ;
String defaultSentence_Close    ;


function InitializeModule() {

  //unfortunately AGS script does not allow to initialize a default
  //String's value at declaration. We are forced to do it here
  
  //universal sentences for any object in the entire game
  defaultSentence_Pull     = "I can't pull that.";
  defaultSentence_Push     = "I can't push that.";
  defaultSentence_Give     = "That just won't work.";
  defaultSentence_Interact = "I don't know what to do.";
  defaultSentence_Look     = "I see nothing special about it.";
  defaultSentence_PickUp   = "Why would I want to pick that up?";
  defaultSentence_Talk     = "I shouldn't start talking to things.";
  defaultSentence_UseInv   = "That won't work.";
  defaultSentence_Open     = "I can't open that.";
  defaultSentence_Close    = "I can't close that."; 
    
  moduleInitialized = true; //make sure we don't call it again
}


//makes sure that all the relevant module stuff is initialized
function checkInitialized() {
   //at first call
  if (!moduleInitialized) 
    InitializeModule();
  
}

String FindWontWorkSentence() {
  String wontWork[10];
  wontWork[0] = "That won't work.";
  wontWork[1] = "I don't think that will work.";
  wontWork[2] = "Nu-uh.";
  wontWork[3] = "No.";
  wontWork[4] = "Nope.";
  wontWork[5] = "That's silly.";
  wontWork[6] = "Why would I try that?";
  wontWork[7] = "I'll have to think of something more useful.";
  wontWork[8] = "No way.";
  wontWork[9] = "I can't figure it out.";  
  
  return wontWork[Random(9)];
}


String FindWontGiveSentence() {
  String wontGive[4];
  wontGive[0] = "I'd rather keep that to myself.";
  wontGive[1] = "I won't give that away.";
  wontGive[2] = "Bad idea.";
  wontGive[3] = "Let's keep that to myself.";
  
  return wontGive[Random(3)];
}

String Sentence(Action_7CoG mode, eObjectType objectType) {
  checkInitialized();
  
  String sentence = "ERROR : no sentence returned.";
  
  if (objectType == eGizmo) { //See the definition of "eGizmo" in the Enum declaration
    if (mode == eGA_7CoG_Pull) sentence = defaultSentence_Pull;               //Pull
    else if (mode == eGA_7CoG_Push) sentence = defaultSentence_Push;          //Push
    else if (mode == eGA_7CoG_GiveTo) sentence = FindWontGiveSentence();          // Give
    else if (mode == eGA_7CoG_Use) sentence = FindWontWorkSentence();  // Interact
    else if (mode == eGA_7CoG_LookAt) sentence = defaultSentence_Look;        // Look
    else if (mode == eGA_7CoG_PickUp) sentence = "I don't need that.";        // Pickup
    else if (mode == eGA_7CoG_TalkTo) sentence = defaultSentence_Talk;        // Talk
    else if (mode == eGA_7CoG_UseInv) sentence = FindWontWorkSentence();      // Useinv   
    else if (mode == eGA_7CoG_Open) sentence = defaultSentence_Open;          // Useinv   
    else if (mode == eGA_7CoG_Close) sentence = defaultSentence_Close;        // Useinv  
    else sentence = String.Format("Unknown mode : %d",mode);
  } else if   (objectType == eHeavy) { //See the definition of "eHeavy" in the Enum declaration
    if (mode == eGA_7CoG_Pull) sentence = "It's too heavy to pull it";                  //Pull
    else if (mode == eGA_7CoG_Push) sentence = "It's too heavy to push it";             //Push
    else if (mode == eGA_7CoG_GiveTo) sentence = FindWontGiveSentence();                    // Give
    else if (mode == eGA_7CoG_Use) sentence = "Let it be.";                        // Interact
    else if (mode == eGA_7CoG_LookAt) sentence = defaultSentence_Look;                  // Look
    else if (mode == eGA_7CoG_PickUp) sentence = "I can't pick up something that big!"; // Pickup
    else if (mode == eGA_7CoG_TalkTo) sentence = defaultSentence_Talk;                  // Talk
    else if (mode == eGA_7CoG_UseInv) sentence = defaultSentence_UseInv;                // Useinv   
    else if (mode == eGA_7CoG_Open) sentence = defaultSentence_Open;                    // Useinv   
    else if (mode == eGA_7CoG_Close) sentence = defaultSentence_Close;                  // Useinv   
    else sentence = String.Format("Unknown mode : %d",mode); 
  } else if   (objectType == eCharacter) { //See the definition of "eHeavy" in the Enum declaration
    if (mode == eGA_7CoG_Pull) sentence = "Violence is not a solution here.";               //Pull
    else if (mode == eGA_7CoG_Push) sentence = "I don't just push people around.";          //Push
    else if (mode == eGA_7CoG_GiveTo) sentence = FindWontGiveSentence();                      // Give
    else if (mode == eGA_7CoG_Use) sentence = "I don't randomly touch people.";        // Interact
    else if (mode == eGA_7CoG_LookAt) sentence = defaultSentence_Look;                      // Look
    else if (mode == eGA_7CoG_PickUp) sentence = "Yes, why don't I just carry everybody around on my back?";      // Pickup
    else if (mode == eGA_7CoG_TalkTo) sentence = defaultSentence_Talk;                      // Talk
    else if (mode == eGA_7CoG_UseInv) sentence = defaultSentence_UseInv;                    // Useinv   
    else if (mode == eGA_7CoG_Open) sentence = "You mean, open that person with a knife or something?";      // Useinv   
    else if (mode == eGA_7CoG_Close) sentence = "That doesn't make sense.";                 // Useinv   
    else sentence = String.Format("Unknown mode : %d",mode);
  } else if   (objectType == eDoor) { //See the definition of "eDoor" in the Enum declaration
    if (mode == eGA_7CoG_Pull) sentence = "It's too heavy to pull it";                  //Pull
    else if (mode == eGA_7CoG_Push) sentence = "It's too heavy to push it";             //Push
    else if (mode == eGA_7CoG_GiveTo) sentence = FindWontGiveSentence();                    // Give
    else if (mode == eGA_7CoG_Use) sentence = "Let it be.";                        // Interact
    else if (mode == eGA_7CoG_LookAt) sentence = defaultSentence_Look;                  // Look
    else if (mode == eGA_7CoG_PickUp) sentence = "I can't pick up something that big!"; // Pickup
    else if (mode == eGA_7CoG_TalkTo) sentence = defaultSentence_Talk;                  // Talk
    else if (mode == eGA_7CoG_UseInv) sentence = defaultSentence_UseInv;                // Useinv   
    else if (mode == eGA_7CoG_Open) sentence = defaultSentence_Open;                    // Useinv   
    else if (mode == eGA_7CoG_Close) sentence = defaultSentence_Close;                  // Useinv   
    else sentence = String.Format("Unknown mode : %d",mode); 
  } else { //the most possible generic sentences
    if (mode == eGA_7CoG_Pull) sentence = defaultSentence_Pull;               //Pull
    else if (mode == eGA_7CoG_Push) sentence = defaultSentence_Push;          //Push
    else if (mode == eGA_7CoG_GiveTo) sentence = FindWontGiveSentence();          // Give
    else if (mode == eGA_7CoG_Use) sentence = defaultSentence_Interact;  // Interact
    else if (mode == eGA_7CoG_LookAt) sentence = defaultSentence_Look;        // Look
    else if (mode == eGA_7CoG_PickUp) sentence = FindWontWorkSentence();      // Pickup
    else if (mode == eGA_7CoG_TalkTo) sentence = defaultSentence_Talk;        // Talk
    else if (mode == eGA_7CoG_UseInv) sentence = FindWontWorkSentence();      // Useinv   
    else if (mode == eGA_7CoG_Open) sentence = defaultSentence_Open;          // Useinv   
    else if (mode == eGA_7CoG_Close) sentence = defaultSentence_Close;        // Useinv   
    else sentence = String.Format("Unknown mode : %d",mode);
  }
  
  return sentence;
}




#33
A minor bug in the custom dialogs : There's no "scroll to top" after selecting a dialog option. Which means that if you click on, let's say, option 5, then the next time some options are displayed they will still be scrolled down. It's a bit awkward.

I fixed it like this (by the way, somehow the RunActiveOption was filtered out for the mouse wheel scrolling but not the plain old mouse click scrolling. I changed that too)

Code: ags

function dialog_options_mouse_click(DialogOptionsRenderingInfo *info, MouseButton button)
{

  CDG_Arrow uparrow;
  CDG_Arrow downarrow;
  int i;

  // Up-Arrow coordinates
  uparrow.x1 = info.X + CDG_options.uparrow_xpos;
  uparrow.y1 = info.Y + CDG_options.uparrow_ypos ;
  uparrow.x2 = uparrow.x1 + Game.SpriteWidth[CDG_options.uparrow_img];
  uparrow.y2 = uparrow.y1 + Game.SpriteHeight[CDG_options.uparrow_img];

  // Down-Arrow coordinates
  downarrow.x1 = info.X + CDG_options.downarrow_xpos;
  downarrow.y1 = info.Y + CDG_options.downarrow_ypos ;
  downarrow.x2 = downarrow.x1 + Game.SpriteWidth[CDG_options.downarrow_img];
  downarrow.y2 = downarrow.y1 + Game.SpriteHeight[CDG_options.downarrow_img];
  
//MODIFIED BY SEVEN CITIES - START
  bool isClickScrollUp = ((mouse.x >= uparrow.x1 && mouse.y >= uparrow.y1) &&
                         (mouse.x <= uparrow.x2 && mouse.y <= uparrow.y2))||
                         (button == eMouseWheelNorth && CDG_options.mousewheel);
       
  bool isClickScrollDown = ((mouse.x >= downarrow.x1 && mouse.y >= downarrow.y1) &&
                          (mouse.x <= downarrow.x2 && mouse.y <= downarrow.y2)) ||
                          (button == eMouseWheelSouth && CDG_options.mousewheel);
//MODIFIED BY SEVEN CITIES - END

  // scroll up
  if (isClickScrollUp) {
        i=0;
        
        while (i<CDG_options.scroll_rows)
        {
          if (CDG_options.scroll_from >1) CDG_options.scroll_from --;
          dialog_options_render(info);          
          i++;
        }
  } 
  // scroll down
  else if (isClickScrollDown) {
      
      i=0; 
      while (i<CDG_options.scroll_rows)
      {      
        if (CDG_options.scroll_to != CDG_options.active_options_count-1) {
          dialog_options_render(info); 
          CDG_options.scroll_from ++;
        }
        i++;
      }
  }

  info.Update();
  
  
//MODIFIED BY SEVEN CITIES - START
  //if (button != eMouseWheelSouth && button != eMouseWheelNorth) info.RunActiveOption();
  
  if (!isClickScrollDown && !isClickScrollUp){
    CDG_options.scroll_from = 0; // Scroll to top
    info.Update();
    info.RunActiveOption();
  }
  
//MODIFIED BY SEVEN CITIES - END
}

#34
Encoding issue.

So, I know that the .TRS of AGS are supposed to be ANSI. But somehow at some point I f***ed up and my file probably did a little trip to UTF-8 and back.
And now it's "corrupt".

Consider this as a riddle :

My file contains this sequence of characters (in hexadecimal ) :  EF BF BD and I know for a fact that it's supposed to be Ö (capital ö, decimal ascii : 214)

Can you :
- find an automated process to restore it properly to ANSI? (at the moment I cant figure out how to display it as Ö even by toying around with the encodings) (by automated, I mean fix an entire file with just a few clicks in Notepad++ or Visual Studio Code or whatnot)
- maybe guess what bad encoding/actions could have led to the faulty encoding? (so that I don't do it again). Did I do that by saving an ANSI file to UTF8?


=== EDIT ===

So apparently I have this issue : https://www.w3.org/International/questions/qa-utf8-bom.en.html
I'm still not sure what I did wrong, or how to fix it.


=== EDIT ===

I've given up and luckily found a backup.
On a general note I think the TRS files should now be UTF-8 from the start, and then throw an error message at translation-compile time if they contain a character that's too fancy.
#35
@Vikram Vicky : Thanks a lot.

===========

Moving on : Is anyone up to trying loading and executing an AGS game into Godot 3.2 (or even better: the Vulkan branch) ?
It's a hard task. But if you're crazy then let's try together.
#36
Quote from: Ali on Mon 03/02/2020 16:16:04
Great stuff, my module is getting pretty old. I've put a link to this one on the first post.

Your module was awesome, but it's nice to have a module made for 3.5 natively.
#38
Can you describe how your module differs from the SmoothScrolling module, which offered smooth scrolling & Parallax (by Ali) and foreground+background parallax too?
#39
Quote from: abstauber on Fri 27/12/2019 19:43:15
I just noticed that I am maintaining these templates for over 10 years  :shocked:

And you're doing a great job. You've saved me tens of hours of coding, for a sexy result.

I want to report that in font "tumbletext" (and TumbleTextOutline I imagine), special character "ç" is misaligned vertically. The "c" should be aligned like a normal c, and the thingie should dangle underneath it, lower than the line. A bit like a "j".
#40
Quote from: morganw on Tue 06/08/2019 18:43:57
The person who made Camp 1 also ported the whole thing directly to Godot, I think. I got the impression they just made their own small framework to do it and didn't have too many issues.

OK. Thanks for the tip. I'll contact them and see what's their advice.
I really really wanted to try Escoria and it annoys me that it crashes straight away.

Also, Problem is indeed unreachable at the moment.
SMF spam blocked by CleanTalk