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

#21
Sorry, I posted the .dmp file first.  Here is the error message:

Code: ags

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x0041DB91 ; program pointer is +2051, ACI version 3.3.3.0, gtags (15,7)

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.


The issue resolved when I changed the dsinv[] array from a dynamic array to an array with a fixed size, so I'm assuming the issue was in the way I declared the size of the array. 

Thanks.

#22
Update: I think I found the piece of code that is causing the issue.  I have a dynamic array of DynamicSprite pointers that I'm using for inventory objects:

Code: ags

DynamicSprite* dsinv[];

export dsinv; 

void LoadInventorySprites() {
  dsinv = new DynamicSprite[Game.InventoryItemCount+1]; 
    int i=1; 
      while (i <= Game.InventoryItemCount) { //loop through and create sprites
        dsinv[i] = DynamicSprite.Create(invInventory1.ItemWidth, invInventory1.ItemHeight); 
          DrawingSurface *drinvsp = dsinv[i].GetDrawingSurface(); 
            drinvsp.Clear(50712); 
            String s = inventory[i].Name; 
              drinvsp.DrawingColor = 0; 
              drinvsp.DrawString(5, 5, Game.NormalFont, s); 
                drinvsp.DrawingColor = 33808; 
                drinvsp.DrawLine(2, dsinv[i].Height, (dsinv[i].Width-2), dsinv[i].Height, 2); 
                  drinvsp.Release(); 
                  
                    inventory[i].Graphic = dsinv[i].Graphic; 
                    
                    i++; //next index
      }
        
}


That command is called on game_start.  If this command isn't called, the game restarts without issue.  The initial startup goes fine either way. 

I can see a few ways to fix this problem, but it's probably happening because I don't understand the engine well enough.  Any thoughts on what I'm doing wrong? 

Thanks.
#23
Hi all -

My game has started crashing with a fatal exception error whenever I call the "game restart" function.  Here is the crashdump report:

Code: ags

---------------------------
Adventure Game Studio
---------------------------
An error occurred whilst trying to load your game. The error was: 



Data at the root level is invalid. Line 1, position 1.

Error details: System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

   at System.Xml.XmlTextReaderImpl.Throw(Exception e)

   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)

   at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()

   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()

   at System.Xml.XmlTextReaderImpl.Read()

   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)

   at System.Xml.XmlDocument.Load(XmlReader reader)

   at System.Xml.XmlDocument.Load(String filename)

   at AGS.Editor.AGSEditor.LoadGameFile(String fileName)

   at AGS.Editor.Tasks.LoadGameFromDisk(String gameToLoad, Boolean interactive)

   at AGS.Editor.InteractiveTasks.LoadGameFromDisk(String gameToLoad)
---------------------------


I've seen that these exceptions can be triggered by problems with sprite handling, and just before this issue occurred the game crashed while running an animation (which had previously run without issue).  I suppose I can start by reimporting some of my sprites and see if that helps.

Any other thoughts?

Thanks.
#24
Sorry for a such a basic question, but I'm clearly missing something.  I have an array of the struct Cstat, which contains some character stats for my game.  For simplicity's sake, I'll focus on "int aggression." 

I have a command to return aggression, which works fine:

Code: ags

int Aggression(this Character*) {
return Cstat[this.ID].aggression;
}

if (this.Aggression() > 10) this.Attack(); 


If I want to increase the character's aggression level I know how to use the script o-name:

Code: ags

Cstat[this.ID].aggression ++; 


What I don't understand is how / if I can write a custom function allowing me to do this:

Code: ags

this.Aggression ++; 


I assume I have to use a method within the struct, but I'm a novice coder and the wiki/manual aren't 100% clear on implementing methods within structs. 

I'm using AGS v 3.3, BTW.

Thanks.
#25
Thanks, CW, that's what I assumed.  One of the fun things about this whole process has been looking into design approaches from the 8- and 16-bit eras, but doing that gives you a slightly different view of memory limits. 

Also, to be clearer, the actual number of objects/characters in the game is going to be much smaller than the number of descriptions available for them, so that the descriptions change with each playthrough.  The real area of concern is whether anyone will play the game more than once.  :wink:
#26
I realize this is a silly question, but I'm new at this and trying to get a better handle on the AGS engine:

I'm making a game that randomly selects descriptions of Hotspots/Characters from arrays of Strings.  On game start I have a series of commands that populate the arrays, and the game will probably need at least 1,000 descriptor Strings to play the way I want it to.

I know Strings are "large" relative to other data types, but I assume that they're still tiny relative to the memory pool in a modern PC.  Is it possible to get performance issues with all of those strings sitting in the memory? 

In my day job I work with some statistical software that has serious issues with file bloating and memory use when it tries to load text, which put this question in my mind. 
#27
Know the feeling - I started planning a game around 2007, and I'm finally feeling confident enough/have the time and energy to generate content.  I definitely agree to start with the online tutorial in the manual (there are also tutorials on YouTube, I believe) and then start building the simplest parts of the game.  For me, it was something like:

1) Pick a resolution (320x200, in my case)
2) Decide how the interface should work
3) Make a few basic sprites and see if they do what you want them to do.

Obviously those three steps take some time and effort, but actually seeing your work on the screen helps keep the momentum going. 

I've never used Twine, but I'm guessing there will be a learning curve in terms of switching that script over to AGS (discomfort with scripting was what kept my game in limbo for so long).  Once you start, though, the forums are incredibly good for answering specific questions. 
#28
Thanks everyone.  Understand more about overlays and string formatting now. 
#29
Re: script calling the overlay:

function room_Load()
{
Overlay.CreateGraphical(160, 110, 11, true);
}

I've tried it with transparency being true and false - it doesn't make a difference. 

Re: my use of String.Format - that's just an amateur coding issue.  i.Name includes things like "Wallet" and "Map." 

Right now I'm doing a workaround using a transparent GUI with the "overlay" on it, which gives no issues. 
#30
Hopefully this is the right board...
In one of my rooms, I have a graphical overlay that I'm using as a piece of the foreground.  I've run into an issue where this overlay disappears whenever I open my Inventory GUI.  The other GUIs do not cause this issue, so I'm trying to pin it down. 

1) The user presses "Mouse Middle" or "I" to open the Inventory - the issue occurs regardless of which button is pressed
2) The GUI becomes visible using this code:

Code: ags
function OpenInventory() {
    if (!IsGamePaused() && gMap.Visible == false) { //Only open the inventory if the game is not paused and the map is not open
    if (gInv.Visible == false) { //Open the Inventory if it's closed
    gInv.Visible = true;
    boxIDesc.Text = "";
    lblIName.Text = "";
         }
    else { //Close the inventory it's open
    gInv.Visible = false;
    boxIDesc.Text = "";
    }}}


3) While the GUI is open, this script runs under "repeatedly_execute" - to label each inventory item when you hover over it, and also control the visibility of the arrow buttons:

Code: ags
if (gInv.Visible == true) {
  InventoryItem *iscreen = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
  if (iscreen != null && iscreen != iToken) { //The iToken cannot be activated by the mouse
  i = iscreen;
[b]lblIName.Text = String.Format(i.Name);[/b]
  if (i != i2) { //Clears the description if you hover on a new item
    boxIDesc.Text = "";
  }  }
  else {
    lblIName.Text = "";
    boxIDesc.Text = "";
  } 
  if (boxInv.TopItem > 0) { //Activates the Scroll Up arrow if the list is scrolled down
    btnInvUp.Enabled = true;
    btnInvUp.Visible = true;
  }
  if (boxInv.ItemCount > 9) { //Activates the Scroll Down arrow if the list contains >9 items
      btnInvDn.Visible = true;
      btnInvDn.Enabled = true;
    }  }


EDIT: I went through the "repeatedly_execute" section, and it appears that any lines of code that set the "lblIName" or "boxIDesc" text will also remove the overlay.  Any thoughts on why (and how to fix it)?
#31
thanks, i figured i was missing something fundamental like that.
#32
this is an awfully simple question, and i'm actually a little embarrassed that i can't solve it. 

i made a gui that follows the mouse, displaying the name of the object under the cursor.  it works fine, but i only want this function to work in certain rooms.  so i set gFloatText.Visible=false; in the game_start function of Global.asc.

right now i'm just doing a single room to experiment with the program, and i want said gui to be visible in this room.  so at the top of the room script i added  a function that includes gFloatText.Visible = true; . 

when i test my game however, the gui is not visible.  i assume i'm missing some fundamental detail here, but i have no idea what. 

#33
i bore with you, and it works like a charm.  thanks.
#34
hello -

i'm very new with ags, and i've run into a problem with what seems like a simple task.

after running any interaction i'd like the mouse cursor to automatically set itself to "walk."  is there a way to do this without manually adding "mouse.Mode=eModeWalkTo;" at the end of every interaction in the game?

i tried editing the on_mouse_click function to change the cursor after processing the mouse click, but doing so cancels the intended interaction. 

any suggestions?
SMF spam blocked by CleanTalk