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

#381
Thank you so much Calin! I never dreamed I'd get my module running fullspeed! Now I can use translucent images in my next game without losing any speed!

Now all I have to do is fiddle with it a bit to get it to work all across the spectrum, and possibly convert all the other parts of the module to Lua as well! I am so excited about the possibilities!
(And the CLUT generator definitely, that thing takes like an hour on this computer to render a CLUT.)

Though, now I'm getting this error:

Quote---------------------------
Adventure Game Studio
---------------------------
An internal error has occurred. Please note down the following information.
If the problem persists, post the details on the AGS Technical Forum.
(ACI version 3.3.0.1148)

Error: [Lua] [string "local select = select;local error = error;l..."]:1: bad argument #2 to 'setter' (number expected, got nil)

This happens every time there's an unclean crash in the AGS engine or editor. The project is thereafter ruined, even if the code is okay.
#382
Not yet, but I can quickly set something up in 3.2.1.

EDIT: Okay, tried it. Nothing happens. No crashes, but nothing happens.

I packaged both the 330 and 321 one in this zip: https://dl.dropboxusercontent.com/u/50882197/Game/Paltest.zip
#383
EDIT: Okay, no more crashes, as I fixed some of the syntax, but still, nothing happens when I run the Lua version of the code, where it DOES work with the AGS version.

My code looks like this:

Code: AGS
function ProcessTranslucency(DynamicSprite* sprite, DynamicSprite* background, int ld, int sd, int trans)
{
  LuaValueList *list = Lua.NewValueList();
  list.Add(sprite.AsLuaValue());
  list.Add(background.AsLuaValue());
  list.Add (Lua.IntValue (ld));
  list.Add (Lua.IntValue (sd));
  list.Add (Lua.IntValue (trans));
  Lua.Call("ProcessTranslucency", list); //This is line 156
}

function noloopcheck DrawObject(this DrawingSurface*, Object *theObject) {
  if ((theObject == null) || (!theObject.Graphic) || (!theObject.Visible)) return;
  DynamicSprite *sprite;
  int graphic;
  if (objecttransparent [theObject.ID])
  {
    graphic = objecttruesprite [theObject.ID];
  }
  else graphic = theObject.Graphic;
  if (theObject.View) {
    ViewFrame *frame = Game.GetViewFrame(theObject.View, theObject.Loop, theObject.Frame);
    if (frame.Flipped) {
      sprite = DynamicSprite.CreateFromExistingSprite(frame.Graphic, true);
      sprite.Flip(eFlipLeftToRight);
    }
  }
  int scale = GetScalingAt(theObject.X, theObject.Y);
  if ((!theObject.IgnoreScaling) && (scale != 100)) {
    if (sprite == null) sprite = DynamicSprite.CreateFromExistingSprite(graphic, true);
    sprite.Resize((Game.SpriteWidth[graphic] * scale) / 100, (Game.SpriteHeight[graphic] * scale) / 100);
  }
  if (sprite != null) graphic = sprite.Graphic;
  {
    int ox = theObject.X;
    int oy = theObject.Y - Game.SpriteHeight[graphic];
    DynamicSprite *bgcopy = DynamicSprite.CreateFromDrawingSurface (this, ox, oy, Game.SpriteWidth [graphic], Game.SpriteHeight [graphic]);
    origspr[theObject.ID] = DynamicSprite.CreateFromExistingSprite (graphic);
    int sd = smallest_digit (objecttransparent[theObject.ID]);
    int ld = largest_digit  (objecttransparent[theObject.ID]);
    ProcessTranslucency(origspr[theObject.ID], bgcopy, ld, sd, objecttransparent[theObject.ID]); //Line 225. This function replaces the much slower code below.
    /*
    DrawingSurface *Surface = bgcopy.GetDrawingSurface ();
    DrawingSurface *OSSurface = origspr[theObject.ID].GetDrawingSurface ();
    int i;
    int j;
    
    int OSpixel;
    int BGpixel;
    while (j < origspr[theObject.ID].Height)
    {
      while (i < origspr[theObject.ID].Width)
      {
        OSpixel = OSSurface.GetPixel (i, j);
        if (OSpixel != COLOR_TRANSPARENT)
        {
        OSpixel = AbsInt (OSpixel); 
         BGpixel = AbsInt (Surface.GetPixel (i, j));
                  if (objecttransparent[theObject.ID] > 90)
                  {
                    
                    bool alternate = true;
                    if (alternate == false)
                    {

                              OSSurface.DrawingColor = clut [ld -1].data[(BGpixel << 8) + OSpixel];
                              OSSurface.DrawPixel (i, j);
                              alternate = true;
                    }
                    else if (alternate == true)
                    {
                      OSSurface.DrawingColor = OSpixel;
                      OSSurface.DrawPixel (i, j);
                      alternate = false;
                    }
                  }
                  else if (objecttransparent[theObject.ID] > 10) 
                 {

                      if (Random (sd) < sd)
                          {
                                        OSSurface.DrawingColor = clut [ld].data[(BGpixel <<8) + OSpixel];
                                        OSSurface.DrawPixel (i, j);
                          }
                      else 
                          {
                  
                                        OSSurface.DrawingColor = clut [ld-1].data[(BGpixel <<8) + OSpixel];
                                        OSSurface.DrawPixel (i, j);
                          }
                 }
                 else     {
                              if (Random (sd) < sd)
                              {
                    
                                              OSSurface.DrawingColor = clut [0].data[(BGpixel <<8) + OSpixel];
                                              OSSurface.DrawPixel (i, j);
                              }
                              else {
                                              OSSurface.DrawingColor = COLOR_TRANSPARENT;
                                              OSSurface.DrawPixel (i, j);
                                   }
                          }
        }
        i++;
      }
      i = 0;
      j++;
    } 
    Surface.Release ();
    OSSurface.Release ();
    */
  }
  this.DrawImage(theObject.X, theObject.Y - Game.SpriteHeight[graphic], origspr[theObject.ID].Graphic, theObject.Transparency);
  if (theObject.IgnoreScaling && objecttransparent[theObject.ID]) { theObject.Graphic = origspr[theObject.ID].Graphic; objecttranssprite[theObject.ID] = origspr[theObject.ID].Graphic; }
}


Code: Lua

function GetCLUTForRoom ()
    local i,x,y,cdata = 0,0,0,0
    local CLUTSPR = ags.DynamicSprite.CreateFromExistingSprite (ags.GetRoomProperty ("TransCLUTSlot"), false)
    local surface = ags.CLUTSPR.GetDrawingSurface ()
    while (i < 8) do
        clut[i] = clut[i] or {} -- make a new table if one doesnt exist or clut[x][y] will fail because clut[x] is nil.
        while (cdata < 65536) do
            clut[i][cdata] = ags.surface.GetPixel (x, y)
            if (x == 255 and y <2047) then
                y = y + 1
            end
            if (x < 255) then
                x = x + 1
            else
                x = 0
            end
            cdata = cdata + 1
        end
        i = i + 1
        cdata = 0
    end
    ags.surface.Release()
    ags.CLUTSPR.Delete()
end


function ProcessTranslucency(ds,bg,ld,sd,trans)
    local OSSsurface = ds:GetDrawingSurface()
    local BGSurface = bg:GetDrawingSurface ()
    for y=0,ds.Height - 1 do
        for x=0,ds.Width - 1 do
        local OSpixel = ags.OSSurface.GetPixel (x, y)
        if (OSpixel > 0)
            then
                  local BGpixel = ags.BGSurface.GetPixel (x, y)
                  if (trans > 90)
                    then
                          if (alternate == nil)
                            then
                                alternate = 0
                            end
                    
                          if (alternate == 0)
                              then
                                  ags.OSSurface.DrawingColor = clut [ld -1][bit.blshift(BGPixel,8) + OSpixel]
                                  ags.OSSurface.DrawPixel (x, y)
                                  alternate = 1;
                          else if (alternate == 1)
                              then
                                  ags.OSSurface.DrawingColor = OSpixel;
                                  ags.OSSurface.DrawPixel (x, y)
                                  alternate = 0;
                              end
                     end
                  else if (trans > 10) 
                    then

                          if (ags.Random (sd) < sd) then
                               ags.OSSurface.DrawingColor = clut [ld][bit.blshift(BGPixel,8) + OSpixel]
                               ags.OSSurface.DrawPixel (x, y)
                          else 
                               ags.OSSurface.DrawingColor = clut [ld-1][bit.blshift(BGPixel,8) + OSpixel]
                               ags.OSSurface.DrawPixel (x, y)
                          end
                    else
                          if (Random (sd) < sd) then
                               ags.OSSurface.DrawingColor = clut [0][bit.blshift(BGPixel,8) + OSpixel]
                               ags.OSSurface.DrawPixel (x, y)
                          else
                               ags.OSSurface.DrawingColor = 0
                               ags.OSSurface.DrawPixel (x, y)
                          end
                    end
               end
            end
        end
    end
    surface:Release()
end

-- stuff
---function ColouriseArea(ds,bg,ld,sd)
--    local surface = ds:GetDrawingSurface()
--    local bgsurface
--    for y=0,ds.Height - 1 do
--        for x=0,ds.Width - 1 do
--            --Do stuff with pixel here
--        end
--    end
--    surface:Release()
--end


--function ColouriseSprite(ds,bg,ld,sd)
--    local surface = ds:GetDrawingSurface()
--    local bgsurface
--    for y=0,ds.Height - 1 do
--       for x=0,ds.Width - 1 do
--            --Do stuff with pixel here
--        end
--    end
--    surface:Release()
--end


What thing did I do wrong? I'm a little confused.

EDIT EDIT:

Quote
Illegal exception
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x01EB6D93 ; program pointer is +1004, ACI version 3.3.0.1148, gtags (0,50)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and post the details on the AGS Technical Forum.

in "PAlgorithms2.asc", line 151 (list.Add(sprite.AsLuaValue()); )
from "PAlgorithms2.asc", line 225
from "PAlgorithms2.asc", line 837

I have no idea what's going on.
#384
Okay, I've been pottering around in Lua for a bit, it's not as daunting as I thought it would initially be. I managed to convert a function from AGSScript to Lua, and Lua, having 2D arrays, seems to be a better fit for it:

Code: lua


function GetCLUTForRoom () 
    clut[0][0] = 0;
    local i,x,y,cdata
    x=0
    y=0
    i=0
    cdata = 0
    local CLUTSPR = ags.DynamicSprite.CreateFromExistingSprite (ags.GetRoomProperty ("TransCLUTSlot"), false)
    local surface = ags.CLUTSPR.GetDrawingSurface ()
    while (i < 8)
    do
        while (cdata < 65536)
        do
            clut[i][cdata] = ags.surface.GetPixel (x, y)
            if (x == 255 and y <2047) then 
                y = y + 1 end
            if (x < 255) then 
                x = x + 1 
            else x = 0 end
            cdata = cdata + 1
        end
        i = i + 1
        cdata = 0
    end
    ags.surface.Release()
    ags.CLUTSPR.Delete()
end


And the syntax checked out! Hopefully I'm not doing this terribly wrong. I'll continue to convert some other functions later, and look up specific syntax when needed.
#385
That's cool. While I'm more experienced with AGSScript, I may as well learn some Lua syntax and try that out. The plugin appears to be open source, so porting games made with it to other platforms can't be that hard.

If the speed of it is all that it's cracked up to be, this is exactly what I've been looking for! Though, it may take me some time to get used to it. At least it won't require me to wrangle with VS anymore! Ahaha. Does the Lua plugin have a manual I can look up to see how calling functions differs from AGSScript?
#386
Interesting! I'm learning a lot here that I didn't know before.

I think, going forward what would be better is for me to try and implement the main bulk of my image processing (that is, the giant loops that iterate through the entire image and change it pixel by pixel) in the plugin. It'd be less flexible, but probably a lot faster for what I'm trying to do with it. Since it's basically just substituting values based on other values (in a look up table), and returning the resulting sprite, it might be easier to do, as well!

(I probably need to look up some more books on the language if I'm to fully understand what I'm doing.)
#387
That's pretty lame. I was hoping to make a pretty generic function so I could do much of the calculations in AGSScript and just convert it back and forth from array and sprite as needed. But if I really have to do it in-plugin, I probably could handle that given some practice.
#388
I'm trying to write a plugin to speed up pixel level functions in AGS, by converting an image into a string (AGS has the String.Chars[] array, which would be much faster to manipulate than Get/SetPixel). I hope to fake a kind of array setup when manipulating pixels, so I can speed up my translucency and colourisation functions for my next game, and maybe even write some more graphics programming type stuff.

I am ludicrously underskilled in C++. I did a bit of C in the old DOS days, but nothing fancy. I at least managed to get the plugin to compile in VS2008 Express. I suppose I gotta start somewhere!


Here's the code I wrote.
Code: C++
const char SerialiseSprite (int id)
{
	unsigned char serialised_image;
	serialised_image = new signed char [engine->GetSpriteWidth (id) * engine->GetSpriteHeight (id)];
	BITMAP *temp = engine->GetSpriteGraphic (id);
	serialised_image = engine->GetRawBitmapSurface (temp);
	engine->ReleaseBitmapSurface (temp);
	return engine->CreateScriptString (serialised_image);
}

int UnSerialiseSprite (const char string, int width,int height)
{
	int sprite = engine->CreateDynamicSprite (8,width,height);
	BITMAP *temp = engine->GetSpriteGraphic (sprite);
	unsigned char imagecontent = engine->GetRawBitmapSurface (sprite);
	imagecontent = string;
	engine->ReleaseBitmapSurface (sprite);
	return sprite;
}

void DestroySprite (int id)
{
	engine->DeleteDynamicSprite (id);
}


Quote.\dllmain.cpp(96) : error C2440: '=' : cannot convert from 'signed char *' to 'unsigned char'
1>        There is no context in which this conversion is possible
1>.\dllmain.cpp(98) : error C2440: '=' : cannot convert from 'unsigned char **' to 'unsigned char'
1>        There is no context in which this conversion is possible
1>.\dllmain.cpp(100) : error C2664: 'IAGSEngine::CreateScriptString' : cannot convert parameter 1 from 'unsigned char' to 'const char *'
1>        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
1>.\dllmain.cpp(107) : error C2664: 'IAGSEngine::GetRawBitmapSurface' : cannot convert parameter 1 from 'int' to 'BITMAP *'
1>        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
1>.\dllmain.cpp(109) : error C2664: 'IAGSEngine::ReleaseBitmapSurface' : cannot convert parameter 1 from 'int' to 'BITMAP *'
1>        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast

This is the error it kicks out. I know this is simple stuff, but I don't understand it at all. Stuff I take for granted in AGSScript doesn't seem to carry over to C++, and it's a little embarrassing. Especially the "char" types. I'm not sure how to fix this?

Thankyou in advance :)
#389

HEATWAVE

You are but mere words.
Would you speak as with that mask,
With what lies underneath?





Heatwave is a short story set in the same world as Death Wore Endless Feathers. It takes place in a future California, where Dai Araiguma is playing a VR game in the middle of an abnormally tenacious heatwave.

Originally developed as a MAGS game, it took way too long, so I decided to extend it a little and give it a lot of polish. It features a full soundtrack and quite a few animations. I hope you all enjoy it!

ZIP VERSION
SELF EXTRACTING EXE


The game's entry in the archives.
#390
This one stands out to me.
#391
Oh! I missed that. Replace

AudioClip.Play ();
with
this.Play ();

When referencing stuff you declare with the this keyword, use this inside the function, instead of the class.
#392
If you're using the this keyword, shouldn't it be:

Code: AGS
aSilence.keymash(380,  177,  21,  4);


Instead? You seem to have inadvertantly made an extender function.
#393
That's good news! I'll finish off everything that needs doing apart from the syncing in 3.2.1, and make a copy to try out 3.3.0 and finish it off there.

Hopefully if I can quickly resync the cutscenes, the game should be ready for release this week!
#394
I'm trying to polish up my game, and in order to sync some animation to music, I count game frames (I increment an integer every frame when the music starts and count what number it is). I have VSync on (turning it off sometimes makes the cutscene skip way far ahead), and have set my game's speed to 60, but I'm having some really spotty syncing issues.

Sometimes the music will get a second ahead of the action, and that feels awful and clunky, and all the action gets the life sucked out of it. And sometimes it'll go TOO fast.

Is there a way to consistently know how much time has passed since the song has begun in smaller increments than a second? I don't want some people getting the outro cutscene how it should be, and some people getting a desynced mess. I know 3.3.0 has PositionMs for tracker music, but I'm wary of using a beta for a final release.
#395
I had this same problem with my other game - where functions called in repeatedly_execute would continue to be called even though there's no reason for it.

I'm loathed to do it, but I could package up my game project files and PM you a link so you can see the code in action. You may be able to figure out whether it's just my poor coding or an actual bug. (it's most likely my poor coding).

EDIT: Okay, fixed it, it was an unrelated on_event call I hadn't checked properly. I was using it to put items down in empty slots. Everything works as planned now.
#396
No, that can't be it, as you lose your ActiveInventory in a seperate conditional branch to the "pick item up" branch.


Code: AGS

      if (player.ActiveInventory != null)
          {
                //player's Active Inventory is removed in this branch.
          }
      else if (player.ActiveInventory == null)
         {
                //Player's active inventory is updated in this branch.
         }


Somehow, both branches are being run one after the other, on the same click. I checked it with the commented out Displays, when you click on the same inventory item that you're carrying, it sets the item down and then runs the lower branch immediately afterward. Is this just a bug in the repeatedly_execute code?
#397
That's the double click part of the inventory interaction. Basically, the code does this:

1) Player clicks the mouse.
2) Game sets a timer, which when it ends, the single click code will run.
While the timer is going on:
3a) The player clicks the mouse again.
4a) Game sees that the timer is going on, and runs the double click action.
or
3b) Player does not click the mouse.
4b) Timer runs out and runs the single click code from repeatedly_execute.

It works in all cases but the player single clicking the Active Inventory slot.
#398
Like that? I edited it.
#399
Okay, so I'm trying to emulate the Discworld inventory system using AGS, and it's running pretty smoothly. I have double clicks, inventory items being takeable from the inventory, putting down items and picking them up again. But there's one thing, in my awful, awful code that I cannot get it to do for some reason, and it's been bugging me for the entire time I've been working on the game.

And that is, when I click on a space in the inventory occupied by the active inventory (the inventory slot while you have it active is blanked out, making it look empty) the item gets put down and immediately picked back up again, and I'm not sure why this is happening. I can't give the entire project, as it's so close to completion now, but here's the click code I'm using:

Code: AGS

int mx, my, lastclick;
int clickdelay = 15;
bool itemvisible;
bool inventoryvisible;
int clicktype;
int clickbuffer;
InventoryItem* itemclicked;
 int itemtimeout;

function left_click(bool single, ClickType type) 
{
  if (single && type == eClickField) 
  {
    // single-click on field code. not important to the example.
  }
  else if (!single && type == eClickField)
  {    
    // double-click on field code. Also not important
  }
  else if (single && type == eClickInventory && clickbuffer == 0) //Single Click on inventory.
    {
      bool newitem = false;
      InventoryItem* item = itemclicked;
      if (player.ActiveInventory != null)
          {
            if (item != player.ActiveInventory) newitem = true;
            ReturnInventory ();
            if (newitem)
                {
                  //Display ("NEWITEM");
                  player.ActiveInventory = item;
                  gItem.BackgroundGraphic = item.CursorGraphic;
                  item.Graphic = 32;
                  if (mouse.x - 16 > 0 ) gItem.X = mouse.x - 16;
                  if (mouse.y - 10 > 0 ) gItem.Y = mouse.y - 10;
                  gItem.Visible = true;
                }
            item = null;
            itemtimeout = 50; //To stop the lower conditional from being run, but doesn't work.
            return;
          }
      else if (player.ActiveInventory == null) //Should be run only when you don't have an inventory item, and have clicked on one.
          {                                        //For some reason, it's run directly after the above conditional?????
                //Display ("NO INV");
                if (itemtimeout) return; //This should stop the player from picking up the item right back up again, but it doesn't work!
                else
                    {
                      player.ActiveInventory = item;
                      gItem.BackgroundGraphic = item.CursorGraphic;
                      item.Graphic = 32;
                      if (mouse.x - 16 > 0 ) gItem.X = mouse.x - 16;
                      if (mouse.y - 10 > 0 ) gItem.Y = mouse.y - 10;
                      gItem.Visible = true;
                    }
          }    
     }
  else if (!single && type == eClickInventory && clickbuffer == 0)
    {
         if (player.ActiveInventory != null)
             {
                   if (inventory [game.inv_activated].IsInteractionAvailable(eModeUseinv))
                        {
                              inventory [game.inv_activated].RunInteraction (eModeUseinv);
                        }
         else unhandled_event (5, 3);
     }
   else 
         {
            if (inventory [game.inv_activated].IsInteractionAvailable(eModeInteract))
                  {
                    inventory [game.inv_activated].RunInteraction (eModeInteract);
                  }
            else unhandled_event (5, 1);
         }
    }
}

function repeatedly_execute() {
  if (lastclick>0 && lastclick<=clickdelay) lastclick++;
  else if (lastclick>clickdelay) 
    {
        lastclick=0;
        left_click(true, clicktype);
    }
  
  if (itemtimeout) itemtimeout --;
}


function on_mouse_click(MouseButton button) 
{
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  
    if (GUI.GetAtScreenXY (mouse.x, mouse.y) != gInventory && gInventory.Visible == true) 
        {
              gInventory.Visible = false;
              inventoryvisible = false;
        }

    else if (button == eMouseLeft) 
        {
               int mxdist = AbsInt(mouse.x - mx);
               int mydist = AbsInt(mouse.y - my);
    
               if (lastclick>0 && mxdist < 3 && mydist < 3) 
                    {
                          lastclick=0;
                          left_click(false,  eClickField);  
                    }
                else 
                    {
                          lastclick=1;
                          mx=mouse.x;
                          my=mouse.y;
                          clicktype = eClickField;
                    }
        }
    else if (button == eMouseRight)
        {
              if (player.ActiveInventory != null) 
                  {
                        if (player.ActiveInventory != iWires) ReturnInventory (); //Special dispensation for game entity that isn't actually an inventory item.
                        else 
                              {
                                    player.Say ("I'll just put these back.");
                                    ReturnInventory ();
                                    player.LoseInventory (iWires);
                              }
        
                  }
              else ProcessClick (mouse.x, mouse.y, eModeLookat);
        }
    else if (button == eMouseLeftInv && itemtimeout == 0)
        {
            //Display ("Clicking Inventory");
            if (GUIControl.GetAtScreenXY (mouse.x, mouse.y) == invInventory)
                {
                    int mxdist = AbsInt(mouse.x - mx);
                    int mydist = AbsInt(mouse.y - my);
    
                    if (lastclick>0 && InventoryItem.GetAtScreenXY (mouse.x, mouse.y) == itemclicked) 
                        {
                            lastclick=0;
                            left_click(false, eClickInventory);
                            itemclicked = null;
                        }
                    else 
                        {
                            lastclick=1;
                            mx=mouse.x;
                            my=mouse.y;
                            clicktype = eClickInventory;
                            itemclicked = InventoryItem.GetAtScreenXY (mouse.x, mouse.y);
                        }
                  }
         }
    else if (button == eMouseRightInv)
         {
               InventoryItem* itemlook = InventoryItem.GetAtScreenXY (mouse.x, mouse.y);
               itemlook.RunInteraction (eModeLookat);
         }
}

function ReturnInventory ()
{
  aDrop.Play (eAudioPriorityHigh, eOnce);
  InventoryItem* item;
  item = player.ActiveInventory;
  item.Graphic = gItem.BackgroundGraphic;
  gItem.Visible = false;
  itemvisible = false;
  player.ActiveInventory = null;
}


Again, everything BUT putting items back in their own slot works fine. If you try and put the item back in it's own slot, it just pops back onto the mouse again, or it stays in the inventory randomly if you double click or quickly move the mouse away.

The behaviour I want is this: When you single click on an item when you have an active inventory item, it swaps that item with the one you're holding. If you click on an empty space OR the space where the Active Inventory actually is (and invisible), it returns your active inventory to the inventory window and leaves you with nothing.

The current behaviour is this: When you single click on an item when you have an active inventory item, it swaps that item with the one you're holding. If you click on an empty space, it returns your inventory. If you click on the space your item is in normally, it puts the item down and immediately swaps it with itself, leaving you with the exact same item in hand.

There's got to be something simple I'm just blind to.

I have no idea what I'm doing wrong. I'm like 3 days from releasing this game and this bug is being nigh impossible to crush!

Thankyou for any help at all.
#400
Quote from: Khris on Sat 16/11/2013 18:28:41
The only workaround I can see would be to replicate the engine's rendering of the screen to a DynamicSprite (including drawing all GUI elements manually, etc), at which point coding a plugin instead is much more feasible.

You know what would be a really useful thing here? A plugin that takes a Sprite, and spits out an array, and can take arrays and build them back into sprites. I've been thinking about pixel-level graphical functions for a long while, and AGS could probably handle most of it itself, it's just the actual sprite drawing that's super slow. GlaDOSik has most of the work for their filter done - if it could be done to an array instead of a drawing surface AGS could handle it super easily with minimal loss of FPS. Heck, I'd find it useful too, I've just not been able to figure out how to handle arrays in plugins. The general nature of the plugin, that is, that it performs one function and one function only, would allow a wide variety of effects to be made super easily in-script without the need of bespoke plugins and the ability to program in C++, though it might suffer a tiny bit in performance.

I've been stifled many times by AGS' slow pixel level drawing functions.

Edit: Since AGS doesn't support returning arrays from functions, why not use Strings instead? It'd be easily to serialise that way, and a string is just a 1D array anyway. You could use GetChar to populate an array - with 8-bit being single characters, 16 bit being 1 character bitshifted to the left 4, and added to the second character's value, and so on.
SMF spam blocked by CleanTalk