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

Topics - monkey0506

#261
Seeing as my dialog system is now going to be released as three modules, I don't want to have to have a bunch of stuff that is used internally getting imported into every script (the stuff used for setting up the dialog text and user options).  So I figure, if I can put a preprocessor macro in there before the code I want to omit, and then remove it when I'm done with the code, it will free it up (as well as making dialog text readonly at runtime  :o).

I need to get to sleep, but I was messing around with it anyway and I can't seem to make it work...unless I put the macro definiton in a module defined before the module with the code I want to remove, then test it within the module, and remove it in a module after the module in question.  I have three modules...but I really shouldn't put the macro definition in the StrAdditions module as it's not at all related.

So...any help or suggestions?
#262
I'm not sure exactly how line breaks work with labels, but I'm trying to display one in an error message, and my code is taking a beating because of it.  I have a line like:

Code: ags
AbortGame("Invalid parameter 'topic' to function 'ScrollingDialog::GetText'.\
Range: 0 to %d\
Value: %d", eScrollingDialog_MaxTopics, topic);


So this one line of code spans three lines in the editor so that I can put a line break in.  This is causing the editor some difficulties, because I noticed yesterday that I tried to compile some code and got an error saying "Error (line 214): undefined symbol 'topic'" or something to that effect.  However, line 214 (or whichever line it was), contained '}', and that was it.

I scrolled down about 20 - 30 lines and found the culprit of the error, but it was too far down in the actual script.  So, the question was is there a better way to do this?

Or do I need to suggest a better way, or perhaps a bug fix so that the lines will be the same in the error message and the actual script in this case?
#263
General Discussion / Hurricane Coming!!!
Fri 23/09/2005 20:44:59
Well for those of you who have looked on the AGS Member's Map (I don't have time or a good enough connection (I have satellite) to find the link), you'll know that I live in Texas.  About an hour north of Houston.  And for those who watch the news you've probably heard about the largest, most intense hurricane ever tracked (although it has been downgraded, and I believe is currently Category 3).  It's coming my way.  I haven't been able to get a connection for several days, and don't expect one for a while after this.

So...if I'm not around, this might explain why.  I probably won't be dead...but don't rule it out (just don't get your hopes up either :=).  I would ask that you guys pray (or for the non-religious types, think happy thoughts) for me, please.  I've never been through a hurricane, and with what happened with Katrina, and everything I've heard, I'm just a bit freaked.  Well, I better post this before I lose my connection completely.  Later.
#264
Welcome to the ScrollingDialog script module. With this module you can create a scrollable dialog system, something not currently available with AGS's built-in dialog system. This module was started as a template and over the course of the last year has been developed into the module which you can now download here.



Version 1.0 released! Go to its separate thread.



There is also now a demo which you can download which isn't much in the way of a great demo, but it displays a dialog which you can scroll through. Also if you look through the script you can understand how to properly set up your dialogs (as they must be set up in the ScrollingDialog_Setup module through the script, not AGS's dialog topic editor).

Download here
Download the demo
Read the ScrollingDialog Manual

Currently with the module you cannot have dialog options which span more than one line. You can store as much text into each option as you want, however when it is displayed on the GUI you will only see as much as will fit across your Dialog GUI (with an ellipses appended to the end). When you run the interaction for the option or retrieve the text with ScrollingDialog.GetText the full String will be returned.

Currently you can only run one dialog at a time (this means no nested dialog trees). I am working on this and will update the post when I get it worked out.

Implemented as of version 1.2

Requires AGS 2.72 or higher! (Why? Because that's the version I'm using and I don't want to here any complaining if it doesn't work with lower versions. You can try it if you want, and let me know if it works, but I'm off to bed.)

[EDIT:]

31 July 2006 1:48 P.M. - Uploaded v1.1 which adds support for used option colors, setting whether the dialog options go upward on the GUI, and whether the dialog options are numbered. Also included documentation and licensing information, and uploaded a simple demo.

1 August 2006 3:37 P.M. - Uploaded v1.2 which adds support for nested dialogs. You can build up a dialog tree by calling ScrollingDialog.Run several times, however if the topic is already stored in the tree you cannot run it again (i.e., if you run topic 0, then topic 1, then topic 5, you can't run topic 0 after topic 5, you would have to call ScrollingDialog.Return() to work your way backward through the tree). As denoted in the previous example, to return to a previous dialog topic you call ScrollingDialog.Return. If the tree is empty (there is only one topic running) this function will call ScrollingDialog.End. The demo hasn't been updated to reflect the changes, but I might make a small sample game that does more than just shows one dialog scrolling.

1 August 2006 11:59 P.M. - Pushing this in at the last minute...literally...I've uploaded a new version of the demo (same link). It works more like a game, there's actually two characters, and I set it up with the same dialog as the tutorial covers (with the "merchant" selling fine leather jackets :=). I did some of the sprite work myself so some of it's crap although if I had looked I probably could have found the sprites I needed...Anyway, the new demo also includes (imported, not exported) a slightly modified version of the module which doesn't stop you from adding the same dialog to the tree multiple times (i.e., if you run dialog 4, then 5, then 4 (running 4 then 4 would just update 4 (which most of the time should mean absolutely nothing to the user :D))). The modified version also has been fixed to turn the dialog GUIs off while the characters are speaking...I should probably export it as a new version...but I've been updating this a lot lately...it can wait a while. It's worth mentioning again that although the majority of the interaction scripts for the dialog are in ScrollingDialog_Setup, there are some commands in the ScrollingDialog module (which is necessary to link dialog topics together). The dialog is initiated when you talk to the merchant. The new demo doesn't actually demonstrate scrolling...you can add more options to the existing dialogs if you'd like...

15 August 2006 - I'm changing my host, so you may need to right-click and choose "Save as..." (in my experience trying to link directly to the files opens it as if it were a text file). If that doesn't work, feel free to PM me and let me know. I'll try and have this issue resolved as quickly as possible. Thanks. Also, I've finally gotten around to changing the link to 1.21 which basically just allows you to add whatever dialogs you want in whatever order you want instead of preventing you from running a dialog already stored in the tree.
#265
Okay, I've recently encountered an error which seemingly causes the game to fail to start.  Not that I get an error message, the game doesn't even crash.  It just fails to start.  I have stared at a blank screen for more than 5 minutes, and I finally just gave up.

Okay, here's the basic gist of the code:

Code: ags
// SM HEADER
struct ScrollingDialog {
  import static String GetText(int dialog, int option);
  };

// SM SCRIPT

String ScrollingDialog_RETRIEVETEXT;

static String ScrollingDialog::GetText(int dialog, int option) {
  if ((dialog < 0) || (dialog >= ScrollingDialog_MAX_DLGS))
    AbortGame("Invalid parameter 'dialog' to function 'ScrollingDialog::GetText'.  Range from 0 to %d.  Value %d.", ScrollingDialog_MAX_DLGS - 1, dialog);
  if ((option < 0) || (option >= ScrollingDialog_MAX_OPTS))
    AbortGame("Invalid parameter 'option' to function 'ScrollingDialog::GetText'.  Range from 0 to %d.  Value %d.", ScrollingDialog_MAX_OPTS - 1, option);
  String Text = "";
  readonly int strstart = option * 200;
  int i = strstart;
  while (i < strstart + 200) {
    Text = String.Format("%s%c", Text, Dialog[dialog].Text[i]);
    i++;
    }
  ScrollingDialog_RETRIEVETEXT = Text;
  return ScrollingDialog_RETRIEVETEXT;
  }

void InitializeDialogs() {
  SetDialogText(0, 0, "My name's Guybrush Threepwood!  Prepare to die!");
  
  int dialog = 0;
  while (dialog < ScrollingDialog_MAX_DLGS) {
    int option = 0;
    while (option < ScrollingDialog_MAX_OPTS) {
      if (option < ScrollingDialog_NUM_LBLS) {
        Dialog[dialog].Width[option] = GetTextWidth(ScrollingDialog.GetText(dialog, option), ScrollingDialog_DLG_FONT);
        if (Dialog[dialog].Width[option] >= gDialog.Width) {
          string output;
          string tail;
          StrCutByWidth(ScrollingDialog.GetText(dialog, option), gDialog.Width, ScrollingDialog_DLG_FONT, output, tail);
          Dialog[dialog].SetText(option, output);
          Dialog[dialog].SetHalfText(option, tail);
          Dialog[dialog].Width[option] = GetTextWidth(ScrollingDialog.GetText(dialog, option), ScrollingDialog_DLG_FONT);
          Dialog[dialog].HalfWidth[option] = GetTextWidth(ScrollingDialog.GetHalfText(dialog, option), ScrollingDialog_DLG_FONT);
          }
        }
      option++;
      }
    dialog++;
    }
  }


Well I've changed it up a bit to try and make it more like the actual code I used (I've already found a way to fix the problem) when I got this problem, without clogging it down with excessive stuff.  If you want to see the complete code just ask and I'll post it (although it's 270 lines w/o the header).  I fixed the problem by just putting "this.Width[option] = GetTextWidth(text, ScrollingDialog_DLG_FONT);" into the SetText function...

Thanks for any info.

[EDIT:]  Well I've found that my ScrollingDialog::Run(int dialog) function also creates the same error...without calling GetTextWidth.  I'll try to search around and let you know if I find anything...  And just for those who have been keeping an eye out, the ScrollingDialog SM is nearing completion.  As soon as I can get these bugs worked out.  Then all I have to do is write the scrolling functions (which is easy to do with the way I have it set up now).  So once again thanks for any help with this problem!

[EDIT:]  A simple bit of re-scripting seems to have solved the error with the Run function.  One fore-warning to those who plan to use the ScrollingDialog SM though...it's currently taking me about 1 minute to load the game if I start it in a dialog... And thinking back on it, I lied about only having to write the scrolling functions.  I also have to put a cursor in so I can tell it to run the appropriate interaction when the user clicks, I have to make the highlight function to highlight the selected dialog, and then I have to add the scrolling functions...well, at least I've finally made some progress!
#266
Okay, the subject pretty much says what the problem is...so let's jump straight into the code:

Code: ags
#define ScrollingDialog_MAX_DLGS 500
#define ScrollingDialog_MAX_OPTS 30
#define ScrollingDialog_NUM_LBLS 7

enum ScrollingDialogOptionState {
  eScrollingOptionOn,
  eScrollingOptionOff,
  eScrollingOptionOffByScrolling,
  eScrollingOptionOffForever
  };

struct ScrollingDialog {
  protected ScrollingDialogOptionState State[ScrollingDialog_MAX_OPTS];
  protected int ID;
  import void Run(int prevdlg = -1);
  /* a lot of other stuff */
  };

struct ScrollingDialogRunning extends ScrollingDialog {
  protected int Option[ScrollingDialog_NUM_LBLS];
  /* other stuff */
  };

void ScrollingDialog::Run(int prevdlg) {
  /* setup dialog function */
  if (this != RunningDialog) RunningDialog.Run(this.ID);
  else {
    if ((prevdlg < 0) || (prevdlg > ScrollingDialog_MAX_DLGS))
      AbortGame("Invalid call to function 'ScrollingDialog::Run'.  Check the read me file for details.");
    int i = 0;
    int j = 0;
    while (i < ScrollingDialog_MAX_OPTS) {
      if (j < ScrollingDialog_NUM_LBLS) {
        if (this.State[i] == eScrollingOptionOn) this.Option[j] = i; /* HEREIN LIES THE PROBLEM */
        j++;
        }
      /* store running dialog vars */
      i++;
      }
    this.ID = prevdlg;
    while (j < ScrollingDialog_NUM_LBLS) {
      this.Option[j] = -1;
      j++;
      }
    return;
    }
  /* set dialog options on GUI */
  }


Okay, if you read the line if (this.State == eScrollingOptionOn) this.Option[j] = i; /* HEREIN LIES THE PROBLEM */ you will see that I tried to access the Option array of the RunningDialog object (as defined previously).  I know that I am working with RunningDialog because of the initial testing if (this != RunningDialog) RunningDialog.Run(this.ID);.

When I try to compile it, I get an error saying that Option is not a public member of ScrollingDialog.  ARG!!!

Any help greatly appreciated.

EDIT:  3 edits later, and I actually included all the info needed to understand all my variables and things.  Yay!

EDIT:  I figured it was worth a shot to try declaring ScrollingDialogRunning::Run(int prevdlg) separately, but then I got an error to the effect of "ScrollingDialogRunning does not contain a function Run".  Meh.
#267
I would like to suggest that the way struct data members and member functions are handled is somewhat revised.  More specifically I would like the access specifiers revised.  Although the reasons may not be immediately apparent to some as to why, this is the way I would like these specifiers to be handled:


public: NOTE: This specifier implied, not expressed.
These are general purpose data members and/or member functions.  They are accessible from any script where an object of this type (as defined by the containing struct) exist (including static objects). This is the manner public data members / member functions are currently handled in.

protected:
These data members / member functions are not accessible directly from the script, but rather only via member functions.  These should be accessible using the keyword this as well as accessing them from an existing object of this type. This is the manner protected data members / member functions are currently handled in, with the extended possibilty of accessing these members from an object of this type.

private:
These data members / member functions are accessible only from member functions using the keyword thisThis is the manner protected data members / member functions are currently handled in.


As you can see from this, basically I want to create a new access specifier, private, based on the current handling of protected members, and then increase the access of protected members by allowing the user to access them via an object of the new type.

These would be usable as such:

Code: ags
struct MyType {
  int Integer;
  protected int ID;
  private int Size;
  import function my_func();
  };

/* global scope */
MyType MyVar;

function MyType::my_func() {
  MyVar.Integer = 5;
  MyVar.ID = 6;
  // MyVar.Size = 13; /* uncomment for error */
  this.Integer = 3;
  this.ID = 8;
  this.Size = 12;
  }

/* game_start */
MyVar.Integer = 5;
// MyVar.ID = 6; /* uncomment for error */
// MyVar.Size = 13; /* uncomment for error */
// this.Integer = 3; /* uncomment for error */
// this.ID = 8; /* uncomment for error */
// this.Size = 12; /* uncomment for error */


So as you can see, the member ID is accessible only within the function, my_func(), and is accessible as either MyVar.ID, or this.ID.  The member Size is also only accessible within my_func(), however, it is only accessible as this.Size, and not MyVar.Size.

It's a crappy example, but I didn't want to get too detailed as to the exact reason for wanting this.  I wanted to stick more to suggesting that it happens.

So I guess that's it.  I would implore Chris that he either implement this immediately, or upgrade the dialog system, but I'm too tired.  I desperately need one of the two.
#268
I started a topic a while back when I was having some problems with too many while loop iterations, and Chris said something about implementing an option to disable the 150000 loop check.  Well, I didn't want to have to ask him directly about it, so I'm asking here.  Also, I had an idea about it.  Instead of a global option, perhaps it could be a function that would get used like:

function func_name() {
  DisableCheck(eWhileLoop);
  /* blah */
  }

So that the check for while loop iterations would be disabled for the duration of the call to the function.  Or perhaps it wouldn't have to completely disable the check, but just not crash the game because of that check.  Then, if the game did crash it could say something like:  "Game encountered fatal error running function "func_name".  DisableCheck called from within function.  Try removing this line from the function to determine cause of crash." or something...  Thanks for any help on figuring out when this will be implemented.
#269
I don't think that this belongs in the tech forums, so I'll ask it here.  Why haven't the strings been updated to a more OO style like everything else.  i.e., why do we still have to use global functions like "StrCopy(string str1, string str2)" instead of being able to do something like "str1.Copy(string str2)"?  I don't really know what brought it to mind, but I was playing around with it and made up a very simple SM (which just calls the global functions)(also, there was one function I couldn't program into the SM, StrFormat...I couldn't figure out any way of calling StrFormat with the "..." I used as a parameter to String.Format) so that I can do something to the effect of:

String mystr;
mystr.Copy("this is some text");

I'm not planning on using it.  But it got me wondering if there was a good reason why strings seem to be getting left behind in the upgrade race.  It would seem logical to do this IMO.  Just wondering...
#270
I have the following function definition for a member function of a struct I'm using, and the game keeps crashing because it says the while loop isn't updating:

Code: ags
/*protected*/ void ScrollingDialog::SetHalfText(int option, string text) {
Ã,  if ((option < 0) || (option > ScrollingDialog_MAX_OPTS))
Ã,  Ã,  AbortGame("Invalid parameter to function ScrollingDialog::SetHalfText parameter 'option'.Ã,  Range from 0 to %d, value %d.", ScrollingDialog_MAX_OPTS, option);
Ã,  readonly int strstart = option * 200;
Ã,  int cindex = strstart;
Ã,  int tindex = 0;
Ã,  while (cindex < strstart + 200) {
Ã,  Ã,  this.HalfText[cindex] = StrGetCharAt(text, tindex);
Ã,  Ã,  cindex++;
Ã,  Ã,  tindex++;
Ã,  Ã,  }
Ã,  }


I start off by checking that the parameter is within the appropriate range because if it isn't then the array index won't work correctly.Ã,  Then I store the starting position of the string I am storing (in a char array of 6000 members (30 strings)).Ã,  Then I create index buffers, one for the char array index (cindex) and one for the string index (tindex).

As the initial value of cindex is the same as that of strstart, and the loop should only be run if the value is less than strstart + 200, I don't see why this code should run more than 200 times, and it updates the value of cindex with each loop.

Also, I have a similar function, which doesn't crash the game:

Code: ags
/*protected*/ void ScrollingDialog::SetText(int option, string text) {
Ã,  if ((option < 0) || (option > ScrollingDialog_MAX_OPTS))
Ã,  Ã,  AbortGame("Invalid parameter to function ScrollingDialog::SetText parameter 'option'.Ã,  Range from 0 to %d, value %d.", ScrollingDialog_MAX_OPTS, option);
Ã,  readonly int strstart = option * 200;
Ã,  int cindex = strstart;
Ã,  int tindex = 0;
Ã,  while (cindex < strstart + 200) {
Ã,  Ã,  this.Text[cindex] = StrGetCharAt(text, tindex);
Ã,  Ã,  cindex++;
Ã,  Ã,  tindex++;
Ã,  Ã,  }
Ã,  }


I can think of one instance where I called something to the effect of "Dialog[dialog].SetHalfText(option, "");", but it should still only run 200 times.Ã,  Even if it somehow threw the loop bounds way out of proportion it should only be capable of running 6000 times before it accesses illegal array indeces (sp?).

Like I said, I don't see how this could run 150000 times, but it keeps crashing my game (I call the function that calls this function from game_start btw).Ã,  I have to go, and I may not be able to get back on for a week...so, I guess I will be back later.

Any help greatly appreciated.
#271
This code won't work with the way AGS currently works...

I had a crazy idea recently to try writing a function to write a string to a sub-string within a char array.  Basically I have a large array, and versus typing the same code over and over to find the starting point of, and then storing all 30 strings (it's inside of a struct), I wanted to do something like:

Code: ags
void StrCopyToCharArray(string text, string char_array, int start_index, int length, int array_size) {
  readonly int EOS = array_size - 1;
  if (start_index < 0) start_index = 0;
  else if (start_index > EOS) start_index = EOS;
  if (!StrLen(text)) {
    if (length < 0) {
      int end = start_index + length;
      if (end < 0) end = 0;
      while (start_index >= end) {
        StrSetCharAt(char_array, start_index, 0);
        start_index--;
        }
      }
    else {
      if (length == 0) length = EOS - start_index;
      int end = start_index + length;
      if (end > EOS) end = EOS;
      while (start_index <= end) {
        StrSetCharAt(char_array, start_index, 0);
        start_index++;
        }
      }
    return;
    }
  if (length < 0) {
    int end = start_index + length;
    if (end < 0) end = 0;
    int tindex = 0;
    while (start_index >= end) {
      StrSetCharAt(char_array, start_index, StrGetCharAt(text, tindex));
      tindex++;
      start_index--;
      }
    }
  else {
    if (length == 0) length = EOS - start_index;
    int end = start_index + length;
    if (end > EOS) end = EOS;
    int tindex = 0;
    while (start_index <= end) {
      Display("tindex: %d", tindex);
      StrSetCharAt(char_array, start_index, StrGetCharAt(text, tindex));
      tindex++;
      start_index++;
      }
    }
  }

char char_array[6000];

void game_start() {
  StrCopyToCharArray("this is some text.", char_array, 0, 199, 6000);
  }


Don't ask why I used void as the return type for game_start...it's just for testing anyway.  And so is the char array that I created here.  I'm just testing the function now...

Basically the problem is that every time I run the function it crashes the game with the error message:

Quote---------------------------
Adventure Game Studio
---------------------------
An error has occured. Please contact the game author for support, as this
is likely to be a scripting error and not a bug in AGS.
(ACI version 2.70.861)

in StrAdditions (line 374)
from StrAdditions (line 384)

Error: StrSetCharAt: tried to write past end of string

---------------------------
OK   
---------------------------

I've been using Display messages to sort out where the errors were coming from (this isn't the first error out of this code)...and as you can see, I've left one Display message in.

Since I put it in a loop, I get several messages displayed (telling me the value of tindex before trying to store the next character.  Output is displayed from "tindex: 0" through "tindex: 19".  Since the length of "this is some text." is 18 characters, I presumed that this may have something to do with it.

In fact, I just added two more characters and it now produces output through "tindex: 21".  So it definitely has something to do with the string TEXT, but I don't see what as I'm not changing the characters in that string.  Any help in solving this problem would be greatly appreciated.

I tried adding some lines:

Code: ags
/* in game_start */
StrCopyToCharArray("this will go first.", char_array, 0, 199, 6000);
  Display(char_array);


Now "this will go first." is displayed, but it's still crashing on the second statement:

Code: ags
StrCopyToCharArray("this is some text...", char_array, 200, 199, 6000);


This isn't fair!  I have to go...  Thanks for any help!
#272
Advanced Technical Forum / Struct limits....
Fri 08/07/2005 14:20:29
What are the size limits for a struct?  I've encountered an error where it would seem that I need an array of 3000000 chars...o_0.  Or...I've just thought of a way around that, but I'd still like to know what the limits are.  Because trying to create an object with two char arrays of 3000000 objects keeps crashing AGS completely.
#273
monkey_05_06's Self-Help Guide for n00bs:

1. Read the forum rules.*
Not having read the rules is not an excuse for breaking them. When you sign up for the forums, you agree to abide by the rules set in place by the moderators and administrators. Not knowing what they are doesn't exempt you from this agreement.

2. Read the BFAQ.
Other than the forum rules, the BFAQ (Beginner's Frequently Asked Questions) is one of the first things you should read. The BFAQ provides answers to many questions that we receive on a regular basis. Due to the frequency with which these questions are asked creating a new thread on these topics is considered taboo and will result in your thread being locked (or even deleted). If you have questions regarding the answer provided by the BFAQ, be sure to state that you have read the BFAQ and that you are asking for further information on the topic.

3. Read the manual.
Saying that you should read the entire manual before posting any questions is ridiculous. You should however take care to properly research the manual entries regarding your question. This will hopefully help you to find your answer, but if you still have questions, it will show that you have made an effort to find the answer yourself. Showing some effort on your part will make us more likely to show some effort toward helping you.

4. Search the forums.
The forum search feature is there for a reason. Odds are that if you look, you will probably find similar questions to your own. The forum search will help aide you find these similar questions. It will also show an additional effort on your own part which will again increase our willingness to help resolve your issues.

5. Create your thread.
If you have completed the previous steps and still have questions, then it is now safe to create your thread. Be sure to tell us what the problem is as well as where you have looked for answers. Posting in the correct forum is also essential (which is why you should have read over the forum rules first).

6. Do NOT create the same thread multiple times.
Under no circumstances should you ever create multiple threads regarding the same question, unless the issue was previously resolved and is no longer an active thread (i.e., it has been more than a month since the last reply). Creating several threads in the matter of a few minutes will make us far less likely to answer your question, and will incur consequences from the mods/admins.

7. Don't double-post.
Double-posting is defined as the same user posting twice in a row without another user posting in-between. Double-posting is against the forum rules. You can modify (edit) your posts if you need to include more information. The exception to this rule is when you are bumping a thread.

8. Rules for "bumping".
"Bumping" a thread is the act of double-posting for the sake of keeping a thread active. You shouldn't bump a thread after only a few minutes. Though this community consists of members from all around the world, it doesn't mean that you'll always get an answer right away. A good general rule of thumb is to wait at least two or three days after your last post before bumping the thread. Another good rule is that you shouldn't bump a thread unless it is in danger of being pushed to a latter page in the forum where it might not receive the attention an active thread deserves. However, double-posting is against the rules, so you must exert some caution (and a bit of common sense) when bumping a thread.

9. Do not post just to post.
In the more general forums, don't post just to post.  Having a good reason to post is not constituted by coming up with a new idea for your next game, but without actually taking the time to think through what you will really be doing with it, and asking for help with plot and/or graphics.  Nor should you post if you aren't going to post anything of any value.  Posting a thread asking if making a certain game would be a good idea, is not a good idea.  If you want to make it, start the game, start a thread for it, and then see what the people think.  But still, it should be the developer's final say if his/her game is made or not.  Post count won't gain you respect if everyone knows that you got yours just by creating random threads for no reason, telling people asking for help "I really have no idea how to help you.", and things of that nature.  In fact, if you have just signed up, but you post respectively and in a normal manner, you will not only be less likely to get in trouble with the mods, but the forum regulars will be a lot more willing to help you than if you had just played the boy crying wolf asking for help with something that you didn't want it with, just to raise your post count.

10. Pick one project, and stick with it.
In general it's not a good idea to try managing more than one project at once. Those people who try to manage several projects at once are usually those who end up with most or even all of their projects in the AGS Graveyard. Though it's okay to take a break from large, long-term projects, you should be careful not to completely abandon the project in favor of another long-term project. This is the type of behaviour which prevents your games from being released! So though it's okay to have other work on the side, you should only undertake one major project at a time.

*Beginners Technical Questions Forum Rules
Technical Forum Rules
Completed Game Announcements Forum Rules
AGS Games In Production Forum Rules
Adventure-related talk and chat Forum Rules
Critics Lounge Forum Rules
Competitions and Activities Forum Rules
General Discussion Forum Rules


DISCLAIMER: This guide is in no way supported, affiliated, or endorsed by the moderators or administrators of this website or its forums.  It is simply, and nothing more, than a collection of guidelines and suggestions to help new forum members adjust to the community more quickly and efficiently. This guide is provided as-is with no warranty of any kind, either expressed or implied, including, but not limited to, the implied warranty of fitness for a particular purpose.
#274
For some unknown reason I want to create an array based on the value of a function parameter.  I tried:

void Func(readonly int test) {
  int array[test];
  }

But there was a "parse error at 'readonly'".  So I tried this:

void Func(int test) {
  readonly int var = test;
  int array[var];
  }

But then it said "array size must be constant value".  So I figured, perhaps my readonly variable isn't being read as "readonly".  So I tried:

var = 5;

And it told me that "variable 'var' is readonly".  So, I have a constant value, but I can't use it as the size of an array.  Is there any way to base an array's size on the value of a function parameter?
#275
I've found an interesting limit, and no Steve, I didn't just do this to annoy you.  Functions in AGS have a limited number of parameters.  The limit is 14.  This isn't covered in the help manual:

QuoteSystem limits
This section tells you the maximums for various parts of the system. If you have been wondering "How many rooms can I have?" or something similar, chances are this section will answer it.
There are maximum...

   20  objects per room
  100  messages per room
  500  global messages
  299  rooms per game
  300  inventory items
15000  imported sprites
  240  sprites per folder
  600  views
   16  loops per view
   20  frames in each loop
  300  characters
   50  GUIs
   30  controls on each GUI
  500  dialog topics
3000  dialog-script messages
   30  options per topic
   20  screen overlays at a time
  500  script GlobalInts
   50  script GlobalStrings
  100  interaction editor global variables
    5  background frames per room
   20  mouse cursors

If you think any of these limits is a serious problem, contact me and I can probably increase it.

So that's one problem I have.  Another problem is the fact that I actually have a function requiring 16 parameters.  I could of course just separate the functions, but because of it's purpose, it should really remain as one.  It's a function to initialize all the data members of a struct.

I can't really go into too much more detail as I'm kind of working on a secret project.  If it works out, I think you'll like it, but I've just started trying to see if it will work today.

Just for an example:

Code: ags
void Func(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, int n) {
  /* do stuff */
  }


Compiles fine.  With 14 parameters.

Code: ags
void Func(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, int n, int o) {
  /* do stuff */
  }


Does not compile.  I get the following error:

Quote---------------------------
Compile Error
---------------------------
There was an error compiling your script. The problem was:

In: 'Global script'



Error (line 3): too many parameters defined for function



Do you want to fix the script now? (Your game has not been saved).
---------------------------
Yes   No   
---------------------------

And yes, I am serious.  I want a function with 16 parameters.
#276
I have some suggestions for structs, which I personally could make great use of, and was just wondering about implementation:

struct within struct support -- Use of custom struct types inside of other structs.

static variable support -- Custom static variables.  We can have static functions, why not variables?
(Edit by strazer: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=543)

string within struct support -- This would be nice.
(Edit by strazer: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=528)

Well, I guess that's about it.  If not official support, it would be nice to have implemented support (i.e., it works, it's just not "supported") of these features.

Edit:  Ooh... And what about an array of strings?  I could definitely make use of that...
(Edit by strazer: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=111)

Edit:  How about accessing protected members of an object of a struct from a static function of said struct.  For example:

struct MyVar {
  protected import static void SetVal(int value);
  protected int Val;
  import static void Initialize();
  };

MyVar variable;

static void MyVar::Initialize() {
  variable.SetVal(5);
  }

Or something like that.  It's a crappy example, but it kind of displays what I want to do.
#277
General Discussion / Music CDs
Mon 20/06/2005 06:30:29
Why must the .CDA (CD Audio -- This is the file type your music is converted to when you burn it to CD) file type be so huge?  I have 1.14 GB of music (which lasts several days) on my hard drive, which I am backing up to CD (so I can format cause my comp is screwed up) but anyway, I've noticed that if I had tried to save my music as a music CD (one playable from say, a CD player) it would take at least like 5 or 6 CDs (actually, I just calculated it, and it's 12 (11.1-something)), but burning it as a data CD (since it's just a back up), I can fit it onto two.  I think this file format needs a revamping...

Well, I think that's about it.  I'm burning the last CD now, and then I'm going to format.  If you really have to know why, I'll tell you later once I get it running again.  (Which is why I'm taking 4 CDs to make a proper backup of all my stuff.)
#278
Just wondering, are recursive functions implemented?  I can't seem to find documentation on them, yet they seem to compile.  However, they also don't appear to be working correctly:

Code: ags
/* global script */

function doStuff(short doWhat) {
  if (doWhat == 1) return AGS_MAX_GUIS * 3 * AGS_MAX_CHARACTERS;
  else if (doWhat == 2) {
    short prevWhat = doStuff(1);
    return prevWhat * doWhat;
    }
  else {
    return -1;
    }
  }

/* game_start */
  Display("%d ## %d ## %d", doStuff(1), doStuff(2), doStuff(3));
  Display("%d ## %d ## %d", AGS_MAX_GUIS * 3 * AGS_MAX_CHARACTERS, AGS_MAX_GUIS * 3 * AGS_MAX_CHARACTERS * 2, -1);


The problem is well, like I said, it compiles, but it doesn't work.  The values displayed are:

"45000 ## -41072 ## -1"

And

"45000 ## 90000 ## -1"

As you can see, they aren't the same, though they should be.  When the call "doStuff(1)" is made from within the function doStuff(short doWhat), it appears to be return some junk value.  Is this because recursive function's aren't implemented (if so, why do they compile?); or is it something I've done wrong (if so, what?)?

Thnaks for any help.
#279
General Discussion / Palette Quest 2.0!
Sat 04/06/2005 06:34:21
http://www27.brinkster.com/meleepta/AGS/PaletteQuest.zip
(Link outdated).

I don't think this really qualifies as a game, but it kind of is one.  I was just playing around with the CyclePalette and FlipScreen functions.

And I came up with this.  I'm posting here because it's not really a "game" per se, but yet there is a score system, and you can beat the game.  Just listen carefully, and time yourself correctly and you can win (although it's hard).

[EDIT:]

07 July 2006!!!

I warned you people. But you just wouldn't listen. No...you had to go and push me to the EDGE! And I've made Palette Quest 2.0: The Unwinnable Version!

Everything is random from the palette indices used for cycling to the timing of the cycling and of the flipping and the screen shaking...

But you can't actually win this time around. It just creates some nice visuals...as long as you're not prone to epilectic...epopelotic...hiphopotronic...SEIZURE DISORDER WARNING: this game WILL CAUSE YOU TO HAVE SEIZURES!!!

Anyway...new links:

Download the original Palette Quest
Download Palette Quest 2.0 (NEW!)
#280
Advanced Technical Forum / Autocomplete Error
Wed 01/06/2005 17:36:51
I have somehow managed to corrupt Autocomplete on my computer.  The problem is that if I type "Mode = " Autocomplete pulls up a menu of the "eModeXXX" values.

This takes place in every game that I have created with AGS 2.7, even when creating a new game.

I have even gone so far as to delete/rename ALL of my AGS game folders, delete all file type associations associated with AGS, deleting AGS, restarting the computer, redownloading AGS, and reinstalling it.

Nothing seems to fix the problem.  And even though Autocomplete would imply that "Mode" has been declared somewhere, if I type something like:

Code: ags
#sectionstart game_start  // DO NOT EDIT OR REMOVE THIS LINE
function game_start() {
  Mode = eModeInteract;
  }
#sectionend game_start  // DO NOT EDIT OR REMOVE THIS LINE


And then I try to compile the game, I get an error stating that Mode does not exist.  If I choose to "fix it now", Autocomplete will still try to fill in the "eModeXXX" values for a non-existant variable.

Any help would be greatly appreciated.

monkey_05_06

Edit:  Also, if I declare a variable like this

Code: ags
bool Mode = false;


Then save my game, the game compiles, I can exit and restart AGS, then try to change the value of Mode and Autocomplete still pulls up the "eModeXXX" values instead of the bool values (true/false).

Edit:  This error takes place in AGS Versions (on my computer)

2.70.598.0
2.70.599.0
2.70.601.0

In both the Default and Empty game templates.
SMF spam blocked by CleanTalk