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

#321
I could see how it could be useful, so my question would be how difficult would it be to add this as a feature. As you said, the engine can already read files from the package or directory, so it seems it wouldn't be too much work from the engine side.

As for the API, perhaps a Resource class could be introduced with a static method for look-up, and a global indexer:

Code: ags
static Resource* Resource.GetResource(const string resourceName, [i]optional[/i] ResourceLocation=eResourceGameOrDirectory);
static int Resource.ResourceCount;
static Resource* Resources[];


This would avoid flooding the global namespace with more script o-names. The Resource* could then be used for:

Code: ags
File* Resource.Open();
readonly int ID;
readonly ResourceLocation Location;
readonly String Name;


Of course, with the asset manager the way it is it might make more sense (i.e., be simpler) to avoid having instances of resources altogether and just have a static Open method which returns null for non-existent resources. Just thought this type of API might give a better end-user representation of the resource files in the script (similar to how audio clips are represented).

Regarding what you said about populating the resources outside the editor, it would be relatively simple to add a Resources branch in the project tree, and a leaf could be added by selecting a file which would be cached in a similar fashion to AudioClips. The properties pane could be used to assign copy behavior (game or directory) and a name (defaulted to file name).

Overall it doesn't sound like a terrible addition to me. I was just thinking of a way the editor could allow the user to specify arbitrary files to copy to the Compiled folder (perhaps specifying platform too). This would definitely prove handy for that.
#322
Dunno why it didn't occur to me before, but since this has an official (non-functioning) open-source stub, I have now uploaded the binaries for the FULL (functional) AGSteam via the stub's downloads page. The DLL is for Windows, of course, and the two SO files are for Linux (the ".32" version being the 32-bit variant, the other being the 64-bit variant).
#323
Engine Development / Re: AGS engine Linux port
Fri 16/01/2015 15:45:37
Further testing proved that 3.3.0-final did actually have the audio issue, it was just far less prevalent when the game was launched from the Steam for Linux client. When launching the game directly from the OS (using the exact same SH script), the issue occurred almost every time. >:(
#324
Engine Development / Re: AGS engine Linux port
Wed 14/01/2015 16:04:54
The previous build of TCL was done with a beta of 3.3.0, IIRC.




Edit: I don't seem to be able to find compatible shared libraries to build 3.3.0-beta, but I confirmed that the issue exists in 3.3.0-hotfix3. Honestly, I haven't tested the older build of TCL on this system/set-up, which is a new computer and I am running Linux Mint in VirtualBox. Previously I was booting directly into Linux. I will now go ahead and download the older build from Steam and see if the results are the same.

Edit v2.0: Okay, I have confirmed that the old build of TCL did NOT have the audio issue and was built with AGS 3.3.0.1156. By 3.3.0.1164 (hotfix 3) the issue was introduced. As I said, I can't seem to get a fresh build of 3.3.0-beta because it is complaining about incompatible shared libraries (i386 versions of Allegro libraries on 64-bit Linux Mint 17). In any case, it looks like 1156 was 3.3.0-final (initial "final" release, prior to the hotfixes). I will test later and see if I can narrow it down further (there were a total of 44 commits between 3.3.0-final and 3.3.0-hotfix3).
#325
Engine Development / Re: AGS engine Linux port
Wed 14/01/2015 14:44:25
Was there ever any solution to the audio problem? I'm trying to submit a bug fix for The Cat Lady on Steam, and I don't recall this issue being present before... I might have to revert back to an older build if I can't find a better solution. :-\
#326
My recommendation for that would be to check that your ItemHeight and ItemWidth are set properly for your InvWindow. This can change in the editor as well as in the script.
#327
I'd first like to say that I don't necessarily think abandoning ship is always best or necessary. I'd be interested in determining if there is a bug in the template. However, it might be easier for you to restart with a less bloated template that better fits your needs.

You should be able to:

- Create a new project based on another template.
- Copy (don't "Cut", just in case something goes wrong) all of the room CRM files from your old project folder into your new project folder (do NOT replace existing rooms this way, rename the room files from your old project as needed).
- Open the new project in AGS, right click on "Rooms" and select "Import existing room". Do this for each room you are bringing in from the old project.
- Now you can delete unused rooms and/or change room numbers.

Characters and GUIs should can also be exported and imported between projects.
#328
Yeah, I hadn't really realized how large and unwieldy this template is. Looks like Lemonhead actually merged several modules together into a single script...ugh.

Okay, at this point we really have to narrow down where the problem is occurring at. Toward the end of that function, I want you to add a little test.

Code: ags
        if ((IsInteractionAvailable(mouse.x, mouse.y, mm) == 1) && (player.Room != MAPROOM)) {
                if (!GotThere()) {
                        Display("Going to (%d, %d) with hotspot ID = %d", mouse.x, mouse.y, lid); // ADD THIS LINE
                        GoThereA();
                        if ((tgx != 0) && (tgy != 0)) return;
                }
        }


I want you to see if that line consistently appears and that the coordinates that appear actually match where your hotspot is at and you are clicking. The last bit should be the ID of the hotspot, so make sure that matches the hotspot you clicked on as well.

If that doesn't appear every time you click on the hotspot then we know that the problem lies earlier in the code.

P.S. This isn't happening in room 3, is it? (MAPROOM is defined as 3 by default, and it handles map room clicks differently)
#329
That's the right function, yes, but it looks like you didn't copy the whole function? This portion only refers to clicks on an inventory item...

You don't need to copy the entire GlobalScript, but if you could provide that function in its entirety, that seems the most likely culprit for your issues.
#330
It was true at least once... (roll)

[/off-topic]

Right, if you're using the same hotspot and it's definitely enabled and the event is listed then it sounds like it's either a cursor hotspot issue or an issue in your on_mouse_click (which you still didn't provide! :-X).

Cursor hotspots can be moved on a per-cursor basis by opening the cursor in the editor. AFAIK you should be able to drag and drop the crosshairs or manually position it in the properties pane. This will affect the portion of the cursor icon you use to click on things.

The on_mouse_click function (GlobalScript) typically just calls ProcessClick (Room.ProcessClick in newer versions), but there could be other code in there that is preventing the Interact mode from working properly. If you're using any script modules they may also have their own on_mouse_click function.
#331
Things to check:

- Make sure that the event ("hBedroomSuitcase_Interact") is listed in the Events pane for the hotspot (hBedroom).
- Check the cursor hotspot coordinates of your eModeInteract cursor.
- Make sure that the hotspot is enabled (i.e., check that you aren't disabling it anywhere, or check Hotspot.Enabled from on_mouse_click perhaps).

If none of that fixes the problem:

- Post your on_mouse_click code and a list of any script modules you are using.
#332
Quote from: AJA on Tue 06/01/2015 13:56:25Known issues:
- If you re-export a dialog that is already open in AGS (but is not the current active editor pane), the ui is not updated. Instead you need to close and reopen the dialog pane. I didn't find a way to fix this with the current editor plugin API since it has no way of accessing all the open editor panes. The active editor pane (if it's the dialog you're re-exporting) should be correctly updated.

I submitted a fix to the plugin API for this. It was fixed after the AGS 3.4.0.3 alpha, but anything from AGS 3.4.0.4 (doesn't exist as of this writing, but that should be the next build number) or higher should allow you to access IGUIController.Panes, a read-only list of the currently open panes (as ContentDocuments).
#333
No one was surprised? You mean the way that we have repeatedly asked for complete code? Are you the same person on two accounts? First look only at what is needed then give advice?

First look at screw yourself, then RTFM. The MouseButton parameter is eMouseLeftInv, eMouseMiddleInv, or eMouseRightInv when clicking on an inventory item. Don't sit here and say that code that was never provided doesn't work properly and then blame those that are trying to help you FFS.
#334
Interesting way to misquote me. Well, I tried. I honestly gave it a shot.

P.S. This type of newbie coder question belongs in the other help board.
#335
You probably want a Label, not a TextBox. And not intentionally screwing up the automatic indenting is probably a good idea if anyone is ever meant to see, read, understand, or otherwise use your code.

Where are you setting the ActiveInventory property at? You haven't provided complete code. If this is all the code you have then your problem is that you are never assigning the active inventory item.

I probably shouldn't, so as to not cause confusion, but I'll also point out that anyone using default names like TextBox1 is doing it wrong, and you should be using player.ActiveInventory.Name instead of manually setting the string "key" in your script.
#336
It seems to me that perhaps the issue is that you are trying to set coordinates for the mouse that are out-of-bounds and so the engine is (silently) forcing it back into bounds which your code isn't accounting for. I slightly modified your code to the following, and both the visible feedback and the log I'm writing look fine:

Code: ags
float sensitivity = 2.0;
float ox;
float oy;

bool IsNullOrError(static File, File *file)
{
  return ((file == null) || (file.Error));
}

void LogCoordinates(this Mouse*)
{
  String fileName = "mouse.log";
  File *f;
  if (Game.DoOnceOnly("Create mouse log"))
  {
    f = File.Open(fileName, eFileWrite);
  }
  else f = File.Open(fileName, eFileAppend);
  if (File.IsNullOrError(f)) AbortGame("Error opening mouse log!");
  f.WriteRawLine(String.Format("Mouse: (%d, %d)", this.x, this.y));
  f.Close();
}

function repeatedly_execute_always()
{
  if ((mouse.x != FloatToInt(ox, eRoundNearest)) || (mouse.y != FloatToInt(oy, eRoundNearest)))
  {
    // Mouse has moved
    // Work out the mouse movementinteger
    if (Game.DoOnceOnly("set_fx"))
    {
      ox = IntToFloat(mouse.x);
      oy = IntToFloat(mouse.y);
      mouse.Visible = false;
      return;
    }
    float x = IntToFloat(mouse.x);
    float y = IntToFloat(mouse.y);
    float nx = ox + ((x - ox) * sensitivity);
    float ny = oy + ((y - oy) * sensitivity);
    int xx = FloatToInt(nx, eRoundNearest);
    int yy = FloatToInt(ny, eRoundNearest);
    if (xx < 0)
    {
      xx = 0;
      nx = 0.0;
    }
    if (xx > System.ViewportWidth)
    {
      xx = System.ViewportWidth;
      nx = IntToFloat(System.ViewportWidth);
    }
    if (yy < 0)
    {
      yy = 0;
      ny = 0.0;
    }
    if (yy > System.ViewportHeight)
    {
      yy = System.ViewportHeight;
      ny = IntToFloat(System.ViewportHeight);
    }
    mouse.SetPosition(xx, yy);
    mouse.Update();
    mouse.LogCoordinates();
    bmouse.Visible = true;
    bmouse.NormalGraphic = mouse.GetModeGraphic(mouse.Mode);
    bmouse.SetPosition(mouse.x, mouse.y);
    // Set old location ready for next time
    ox = nx;
    oy = ny;
  }
  game.debug_mode = true;
  Debug(4, 1);
}


In particular, note that I have checked that the results of IntToFloat(nx, eRoundNearest) and IntToFloat(ny, eRoundNearest) fall within the bounds of 0..System.ViewportWidth and 0..System.ViewportHeight, respectively, and if not that I have forced nx and ny into the proper bounds.
#337
Monsieur OUXX, yes, that's precisely what the shell plugin is for. Al Emmo, for example, used the shell plugin in the demo to open a browser window to buy the full game.

This is why I wrote the open-source replacement, but it is still only designed to operate on Windows.
#338
Quote from: SpeechCenter on Sat 07/04/2012 16:44:06The tree is trickier, I believe each component updates this manually, so I don't think there is an official way to do this. You can try to force a refresh...

Since July 2013 there has been the IRePopulatableComponent interface which is implemented by editor components which can have their child nodes repopulated (e.g., the DialogsComponent). They are not currently exposed, but the IDs for the built-in components are constant and should not ever change, so it's safe to use them directly in your plugin. Together with the IAGSEditor.Components property, you could do something like this:

Code: csharp
public class DialogDesignerComponent : IEditorComponent
{
    private const string DialogsComponentID = "Dialogs"; // AGS.Editor.ComponentIDs.Dialogs
    private IAGSEditor _editor;
    private IRePopulatableComponent _dialogs;

    public DialogDesignerComponent(IAGSEditor editor)
    {
        _editor = editor;
        // ...
    }

    internal IRePopulatableComponent DialogsComponent
    {
        get
        {
            if (_dialogs == null)
            {
                foreach (IEditorComponent component in _editor.Components) // the editor stores these by the base interface, so the very first time we'll need to look up the component
                {
                    // NOTE: using
                    //     foreach (IRePopulatableComponent component in _editor.Components)
                    // will compile, but will throw an InvalidCastException, you have to do it this way instead
                    if (component.ComponentID != DialogsComponentID) continue; // make sure we have a matching component ID
                    _dialogs = (component as IRePopulatableComponent);
                    if (_dialogs != null) break; // and a matching interface, then we're done
                }
            }
            return _dialogs;
        }
    }

    internal void RefreshProjectTree()
    {
        DialogsComponent.RePopulateTreeView();
    }

    internal void RefreshProjectTree(string selectedNode)
    {
        DialogsComponent.RePopulateTreeView(selectedNode);
    }
}


This will force the Dialogs branch to update safely. Note that it will also collapse any folders, so you shouldn't call it unless you are actually adding/removing items. There might be some way to expand the folders from plugins, but I haven't looked into that (yet).




Quote from: AJA on Sun 04/01/2015 01:49:00Not sure if I messed with all the correct switches to make it public: https://bitbucket.org/AJA/dialogdesigner

Yes, I can see it. ;)

Quote from: AJA on Sun 04/01/2015 01:49:00...up-to-date binaries are included in the bin\Release directory.)

You shouldn't put the compiled binaries into the repository -- you should actually add the bin folder to your .gitignore file and upload the binaries separately. BitBucket actually has a "Downloads" page for each repo specifically for hosting these binaries. I had to learn all this the hard way, but if you put the binaries into source control then it keeps every build you commit, bloating the overall size of your repo when other people want to clone it. Instead, keep the source and compiled binaries separate so that cloning the repo is relatively small. Once cloned, anyone can revert their local copy and rebuild or choose to download your prebuilt binaries for older versions.
#339
The issue with the manual actually sounds like a known issue with Windows' overprotective security settings. If you go to the properties of the CHM help file (right click on the file, Properties), you'll probably see some warning about it having originated from the Internet.  There should be an "Unblock" button. That should fix it.
#340
Yes, I'm aware of that, but do you really want that floating over the top of your games? I was referring more to how best to bring up the action bar without interfering with gameplay.
SMF spam blocked by CleanTalk