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

#241
General Discussion / --NVM--WTFH?--NVM--
Sat 01/04/2006 00:07:41
Uh..why is everything Wintermute?  Fecking haxors.

[EDIT:]

Whoops.  I jumped to conclusions.  Just...okay.  I'll go off to my corner now.
#242
Using RestartGame my game keeps crashing with the following error:

Quote---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x00460E09 ; program pointer is +6, ACI version 2.72.908, gtags (2,12)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.



Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
---------------------------
OK   
---------------------------

Not really sure what I've done.  It just doesn't seem to like me trying to restart the game.

Edit by strazer:

AGS v2.72 Beta 6:
* Fixed crash if you used Restore or Restart within a script module event handler.
#243
Okay, so Edmundo posted a shameless plug the other day, and for fear that it would ever be lost, I hosted the page myself.  Only the host I normally use was down for some time...so I looked for another one.

I found one, and it seemed to be okay...until...I viewed the page and to my horror found...A BANNER AD!!!

Scary I know.  But fear not.  My mad CSS skillz protected me as I insanely shoved that stupid advertisement off to the side (to be exact, 1073741824 * (the square root of 2) pixels from the top left corner of the page (1073741824 from the top, 1073741824 from the left)).  I also helped it along by setting most of the banner to not show up at all (width: 0px; height: 0px; ), but some of the tags had specified their height and width and were nonremovable (moveable yes, just not removable).

So...what have you done to get rid of pesky banner ads?

Oh...and BTW, I turned scrolling off (body { overflow: hidden; }).  We wouldn't want people going scrolling off for 1073741824 * (the square root of 2) pixels just to see part of a banner ad now would we? :=
#244
In my "Digital Graphics and Animation" class, we were supposed to make a collage with Photoshop that told a little bit about who we were.  Most of the guys in the class used cars.  Not sure about the girls.  But not me...I made this.

I was trying to do something quick and easy and took about an hour on it (mostly on deleting excessive color and fixing transparencies).  Oh, and I would have hosted it myself, but the school's firewall has this block on all sites labeled as "free hosts".  So it's on the American Girl Scouts site.
#245
Advanced Technical Forum / Global functions...
Wed 15/02/2006 22:40:38
I don't suppose it's possible to import a function into one header (a script header) and actually define it in a different script?  It's giving me errors when I try to do this.  Any help would be appreciated.
#246
Okay, I'll admit...I'm revising Akumayo's weather module...but it's being bothersome...I have the following in the module header:

Code: ags
struct WeatherEffects {
  import static void Start(int fallingspeed, int windspeed, int slot_a, int slot_b = 0, int slot_c = 0, int slot_d = 0, int slot_e = 0, int slot_f = 0, int slot_g = 0);
  // ...
  };


Then in the module script I have this:

Code: ags
static void WeatherEffects::Start(int fallingspeed, int windspeed, int slot_a, int slot_b, int slot_c, int slot_d, int slot_e, int slot_f, int slot_g/*, int slot_h, int slot_i, int slot_j, int slot_k, int slot_l*/) {
  // ...
  }


This all compiles and works fine.  Seeing as I'm using the default template and was too lazy to import any rain or anything, I just have some keys (7) raining all over the Caribbean.

As you probably guessed by the commented part of the function definition, I am trying to add more optional slot parameters.  Unfortunately, if I add the additional parameter (slot_h) to the declaration (in the header), so that it looks like this:

Code: ags
struct WeatherEffects {
  import static void Start(int fallingspeed, int windspeed, int slot_a, int slot_b = 0, int slot_c = 0, int slot_d = 0, int slot_e = 0, int slot_f = 0, int slot_g = 0, int slot_h = 0);
  // ...
  };


And then I add (uncomment) the parameter in the definition (in the script):

Code: ags
static void WeatherEffects::Start(int fallingspeed, int windspeed, int slot_a, int slot_b, int slot_c, int slot_d, int slot_e, int slot_f, int slot_g, int slot_h/*, int slot_i, int slot_j, int slot_k, int slot_l*/) {
  // ...
  }


The game crashes with the following error:

Quote---------------------------
Adventure Game Studio
---------------------------
Script link failed: Runtime error: unresolved import 'WeatherEffects::Start^10'

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

Am I doing something wrong here?  If I need to I can upload a copy of the game...but for now I have to go...school tomorrow *cries*...
#247
During my game, keypresses should not be ignored during speech, so I'm looking to an alternative to on_key_press.  I have the following script:

Code: ags
#sectionstart on_key_press_always  // DO NOT EDIT OR REMOVE THIS LINE
function on_key_press_always(int keycode) {
  // called when a key is pressed. keycode holds the key's ASCII code
  if ((keycode >= 97) && (keycode <= 122)) keycode = CharToUpper(keycode);
  if ((IsGamePaused()) && (keycode != 32) && (keycode != 366) && (keycode != 23) &&
  (keycode != 3) && (keycode != 17) && (keycode != 324) && (keycode != 434) &&
  (!gPaused.Visible) && (!gRestart.Visible) && (!gWin.Visible) && (!gQuit.Visible) &&
  (keycode != 45) && (keycode != 61) && (!gVolume.Visible))
    keycode = 0;
  if (keycode==363) SaveGameDialog(); // F5
  if (keycode==365) RestoreGameDialog(); // F7
  if (keycode==367) RestartGame(); // F9
  if (keycode == 434) {
    SaveScreenShot(String.Format("guibuilder%03d.bmp", Screenshot));  // F12
    Screenshot++;
    }
  if (keycode==19) Debug(0,0); // Ctrl-S, give all inventory
  if (keycode==22) Debug(1,0); // Ctrl-V, version
  if (keycode==1) Debug(2,0); // Ctrl-A, show walkable areas
  if (keycode==24) Debug(3,0); // Ctrl-X, teleport to room
  if (keycode == 32) gPaused.Visible = (!gPaused.Visible);
  if (keycode == 366) gRestart.Visible = true;
  else if ((gRestart.Visible) && (keycode == 89)) RestartGame();
  else if (gRestart.Visible) gRestart.Visible = false;
  if (keycode == 23) gWin.Visible = true;
  else if ((gWin.Visible) && (keycode == 89)) {
    gWin.Visible = false;
    Display("YOU WIN!"); // pseudo-interaction
    // go to -you-win-room-
    }
  else if (gWin.Visible) gWin.Visible = false;
  if ((keycode == 3) || (keycode == 17) || (keycode == 324)) gQuit.Visible = true;
  else if ((gQuit.Visible) && (keycode == 89)) QuitGame(0);
  else if (gQuit.Visible) gQuit.Visible = false;
  if (keycode == 13) {
    if (GetLocationType(mouse.x, mouse.y) == eLocationNothing) {
      GUI* guiat = GUI.GetAtScreenXY(mouse.x, mouse.y);
      if (guiat != null) {
        GUIControl* controlat = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
        if (controlat != null) interface_click(guiat.ID, controlat.ID);
        else on_mouse_click(eMouseLeft);
        }
      else on_mouse_click(eMouseLeft);
      }
    else on_mouse_click(eMouseLeft);
    }
  if (keycode == 9) {
    if (GetLocationType(mouse.x, mouse.y) == eLocationNothing) {
      GUI* guiat = GUI.GetAtScreenXY(mouse.x, mouse.y);
      if (guiat != null) {
        GUIControl* controlat = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
        if (controlat != null) interface_click(guiat.ID, controlat.ID);
        else on_mouse_click(eMouseRight);
        }
      else on_mouse_click(eMouseRight);
      }
    else on_mouse_click(eMouseRight);
    }
  if ((!gPaused.Visible) && (!gRestart.Visible) && (!gWin.Visible) && (!gQuit.Visible) &&
  (!gVolume.Visible)) {
    if (keycode == CharToUpper(eLucasKeycode_Give)) {
      mouse.Mode = eModeUseGive;
      GiveMode = true;
      }
    if (keycode == CharToUpper(eLucasKeycode_Open)) mouse.Mode = eModeOpen;
    if (keycode == CharToUpper(eLucasKeycode_Close)) mouse.Mode = eModeClose;
    if (keycode == CharToUpper(eLucasKeycode_Pickup)) mouse.Mode = eModePickup;
    if (keycode == CharToUpper(eLucasKeycode_Lookat)) mouse.Mode = eModeLookat;
    if (keycode == CharToUpper(eLucasKeycode_Talkto)) mouse.Mode = eModeTalkto;
    if (keycode == CharToUpper(eLucasKeycode_Use)) {
      mouse.Mode = eModeUseGive;
      GiveMode = false;
      }
    if (keycode == CharToUpper(eLucasKeycode_Push)) mouse.Mode = eModePush;
    if (keycode == CharToUpper(eLucasKeycode_Pull)) mouse.Mode = eModePull;
    }
  if ((keycode == 45) || (keycode == 61)) {
    gVolume.Visible = true;
    Wait(5);
    if ((sldVolume.Value > 27) && (sldVolume.Value <= 99) && (keycode == 45))
      sldVolume.Value -= 9;
    if ((sldVolume.Value >= 27) && (sldVolume.Value < 99) && (keycode == 61))
      sldVolume.Value += 9;
    SetMusicMasterVolume(sldVolume.Value);
    }
  }
#sectionend on_key_press_always  // DO NOT EDIT OR REMOVE THIS LINE

int GetKeyPress() {
  int i = 0;
  while (i < 434) {
    if ((IsKeyPressed(405)) || (IsKeyPressed(406))) {
      int j = 65;
      while (j <= 90) {
        if (IsKeyPressed(j)) return j - 64;
        j++;
        }
      }
    if (IsKeyPressed(407)) {
      int j = 65;
      while (j <= 90) {
        if (IsKeyPressed(j)) return j + 236;
        j++;
        }
      }
    if (IsKeyPressed(i)) return i;
    i++;
    }
  return 0;
  }

int RunKeypressTimer = 0;

#sectionstart repeatedly_execute_always  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute_always() {
  // put anything you want to happen every game cycle here
  if (RunKeypressTimer == 0) {
    on_key_press_always(GetKeyPress());
    RunKeypressTimer = 2;
    }
  else RunKeypressTimer--;
  }
#sectionend repeatedly_execute_always  // DO NOT EDIT OR REMOVE THIS LINE


The code works okay for single keypresses (I wouldn't say great because it's still responds more than I would like it to, but setting RunKeypressTimer to 3 makes it too unresponsive), but key combinations are giving me some problems.

For example, I press 324, and the QUIT GUI turns on, but it instantly goes back off again...even if I mash the buttons and release as quick as I possibly can...and even if I increase the timer to make it less responsive.

Does anyone have any suggestions on how I can fix this?
#248
I'm working on the next version of the QueuedSpeech module, and I was trying to test it on 2.7, but every time I tried saving, it crashed the game with the following error:

QuoteWe're sorry, the AGS editor has encountered a serious error and must shut down.  You will have lost any changes made since you last saved your game.

(Exception 0x00000000 at EIP=0x00000000, AGSEDIT v2.70.599, SIP=26)

Please note down the numbers above, and what you were doing when this error occured.  If it happens repeatedly, please inform CJ of this error by visiting the AGS Technical forum and providing any information that you can.

Ctrl+C didn't work, so i had to type that out, but it is verbatim.

By commenting out the entire module script, then uncommenting small blocks and saving, I was able to narrow it down to the exact line that is crashing the editor:

Code: ags
QueuedSpeech_MessageType QueuedSpeech_Buffer;


QueuedSpeech_MessageType is a struct defined as:

Code: ags
struct QueuedSpeech_MessageType {
  char Text[QUEUEDSPEECH_STR_LEN]; // _STR_LEN = 20000
  }


I've encountered a similar problem before, and the solution provided was this:

Code: ags
QueuedSpeech_MessageType QueuedSpeech_Buffer[1];


Making an array with one item out of the struct.  Now, I wouldn't be reporting this, except I was curious...has this been fixed?  (I would look at the change logs, but I wouldn't be sure what to look for)
#249
The past few days my parents have both made several references to something called "memory space."  I don't know about you, but I've never heard of such a thing.  Does it mean RAM?  Or is it something to do with the hard drive?

The questions flooded my mind, but I'm not Noah, and I forgot to build an ark.  So I'm here drowning in my thoughts...and they keep talking about it.

"The reason that computer runs so slow is because it doesn't have enough memory space..."
"Michael, if I buy an external hard drive, would that fix the problem of her memory space being almost full?...Well...she probably doesn't have enough memory space to plug it in."
"You need to quit installing all those games or you're going to run out of memory space..."

I figured, maybe some of the brilliant minds around here can help me.  Please...if you know what memory space is...tell me.  I would really love to know what my parents are talking about.  All this time I thought I was the computer literate one in this household (my brother is computer literate, but he's out on his own)...and I don't even know what memory space is, while my parents so obviously do.  I'm begging you.  Tell me what this thing is.

:=
#250
Okay, a while back someone posted in regards to making background speech stay on the screen longer than the default time.

Well, I set up a script in repeatedly_execute_always to call Character.SayBackground until the time had expired ([integer] timer == 0).  That works fine...but the problem is...the game appears to become partially paused.  The characters can still walk around, but the interface is disabled.  I was just using the default game template for testing, so it's not any code that I've typed to disable the interface...

I was just curious why the interface would be disabled if the game wasn't paused.  It doesn't happen if I just use background speech outside of rep_ex_always (i.e., in on_key_press)...

Of course I realize that doing this, Overlays would be getting created and destroyed like crazy, but if I wait until the original Overlay is no longer Valid, then the text blinks.  And I'm not sure if that disables the interface as well, I hadn't looked.
#251
It's been a while since I wrote the first version of this "tutorial-kind-of-thing," and I felt it was time for an update. Some revisions, some new content, and a cover image!


Feel free to comment or ask any questions!
#252
Most of you won't get the email I've sent out recently, but it's far too long to post here.  I guess the easiest way to do this would be to quote my most recent, and probably last, email to McKenzie Mitchell, the girl that I love:

QuoteYou told me you wanted to be friends.  But then it's my fault isn't it?  I told you it would probably be best if I could forget about you.  I told you that I wished I could.  You told me "F*CK OFF."  You told me "I WILL NEVER TALK TO YOU AGAIN."  Then you said "BYE." and left.  If you think that you're helping me, then thanks for trying.  If you hate me and never want to talk to me again, then I would appreciate a reason, but don't expect one.  But it doesn't matter.  It's too late for us to even be friends now isn't it?  I've just made a beautiful mess out of all of this now haven't I?  Well, it doesn't matter.  Whether I kill myself five minutes from now, or remember this day as the worst day of my life for my next 80 years, it doesn't really matter.  You don't want to hear from me ever again.  I just wish I knew why.  I wish I could go back in time, stop myself from doing all those stupid things that I did.  But I can't.  Nothing I can do can take back what I did.  What I said.  It's too late, and you hate me now.  I wish you the best in everything you do McKenzie Mitchell.  I always have, and I always will love you with all of my heart.  I'll miss you.

So this Christmas the girl that I love got me a very special gift:  A broken heart.  I'm not really sure why I'm posting this here, but it seems like a good idea to talk about it.  I'm such an idiot.  I've really screwed myself this year.  What a wonderful Christmas Eve this is.

Anyway, I guess I'm seeking some sort of comforting or some crap like that, I don't know.  I just...I don't know what to do.

Well...have a Merry Christmas everyone.
#254
I couldn't find anything similar to this in a brief forum search or in the tracker, so I figured I would suggest it.  Recently there have been some reports of warnings being generated due to DynamicSprites not being deleted before the game is ended.

If a module creates DynamicSprites, but the user fails to delete them before they quit the game, these warnings will be generated.  So, to prevent this, I'm proposing that a new value be added to EventType, eEventQuitGame.  That way module creators could call DynamicSprite.Delete() for all of their DynamicSprites before the game exited, which would stop these warnings from being generated.
#255
I was looking these functions up to help somebody on the Beginner's Forum (here) and I noticed that the manual says that the value for the maximum number of allowable topics can be found in the Room Editor.  Clearly that's not right...it's the Dialogs pane of the Game Editor...however you want to word that...
#256
I've been trying to make my QueuedSpeech module 2.7 AND 2.71 compatible (one version compatible with both).  I used the #define AGS_NEW_STRINGS to check if 2.71 was being used, used Strings if it was, and strings if it was not.  I got all that worked out, and I got it to compile on both 2.7 and 2.71 fine.  And it runs on 2.71 without a problem.  However, when I try to run it off of 2.7, the game crashes whenever I try to add speech to the queue.  It appears to be an instantaneous crash, and AGS supplies no error message, except "The game terminated unexpectedly.  If the problem persists post it on the Tech Forum." or some such (after the Windows XP message telling me that the program unexpectedly terminated).  I've uploaded the game here for somebody to look at.  I'm not worried about taking anything, as I plan to release the module as open source anyway, so anybody can feel free to take a look.  I've searched over the code several times and I can't find what's making it crash, so if anyone wants to help me out here, it would be greatly appreciated.

Thanks.

[EDIT:]

I removed the Compiled folder and all of the *backup.* files from the rar, so if I need to upload those...I can try...but my internet is screwed up.  I can't maintain a steady connection.  We're supposed to be throwing away this satellite and getting DSL (the modem comes Friday, activation Monday...a week :'().  So, if you want me to sent that along, I probably won't be able to for a week.
#257
It would make it a lot easier to access the views for animations and things if we actually had access to them.  Basically I'm thinking something along the lines of:

Code: ags
managed struct Loop;
managed struct View;

managed struct Frame {
  readonly import attribute int Graphic;
  readonly import attribute int Delay;
  [readonly] import attribute bool Flipped;
  readonly import attribute Loop *OwningLoop;
  [import void SetGraphic(int sprite);]
  [import void SetDelay(int delay);]
  };

managed struct Loop {
  readonly import attribute Frame *Frames[];
  readonly import attribute int FrameCount;
  readonly import attribute View *OwningView;
  readonly import attribute int ID;
  };

managed struct View {
  readonly import attribute Loop *Loops[];
  readonly import attribute int LoopCount;
  readonly import attribute int ID;
  };


Yeah...I've only been thinking about this for a while.  That sounds pretty good to me though.  Regarding the stuff in brackets in the Frame structure, I think it would probably be okay to allow the user to change some stuff dynamically.  Unless that would create major complications within AGS (like for example if the user tried to change the currently displayed sprite...so maybe it wouldn't work).  But it's just something I've had on my mind for a little while...

[EDIT:]

I forgot the ID attribute for Loops.  Of course the ID attributes of Views and Loops would mainly be for backwards compatibility.
#258
Disregarding the module that SSH made (:P), I've modulized Scorporius's queued background speech code:

1 October 2016: Thanks cat for pointing out some heinous coding on my part, I've uploaded v4.1 with a bugfix. Everything else is the same, see thread for details.

27 January 2015: I have updated this module to v4.0, with a revised interface and dynamic queue sizing. This allows you to add basically as many items to the queue as you want at one time (*current maximum is actually 1000000, but queue is dynamically sized to preserve memory). The new version also has improved handling if the character speaking in the background starts moving - they will be released from their speech view and continue their movement.

Example:

Code: ags
void InitializeBackgroundDialogue()
{
  QueuedSpeech.ClearQueue();
  QueuedSpeech.Looping = true;
  QueuedSpeech.Paused = true; // don't start the queue right away
  cEgo.SayQueued("Gee, I wonder where Bob wondered off to...");
  cEgo.SayQueued("When I find him, I'm gonna knock his block off.", null, 120); // add a delay to this message
  cEgo.SayQueued("That'll show him.");
}

function room_Load()
{
  InitializeBackgroundDialogue();
}

function hRug_Interact()
{
  QueuedSpeech.Paused = false; // start thinking about Bob
}


Requires AGS 3.4.0.3 or higher!

Download v4.1

25 January 2013 Four years later... Updated the module to work with the new-style audio clips. If you want to use the old-style audio system then just stick to v3.0 because v3.5 isn't backwards compatible. See the included documentation for full changelog. Notably, the Character.SayQueued method now requires an AudioClip* for voice speech, instead of formatting it into the message string.

08 January 2009 After nearly a full three years since the last update to this thread...I figure it's time to get this download back up. And I had a bit of fun toying around with making a demo. Hijacked RON sprites and all. Oh, and Microsoft SAM speeching!
#259
Just curious what the size of the String type is (in bits).

I have a struct that I set up with two String arrays (each of 200 units), and then I need about 30 - 35 thousand of those (roughly -- spread over 5 arrays).  The problem is that when I compile these arrays that my game (which I am using the Empty Game Template for ATM because I'm developing a new secret module), explodes in size.

80 MB is a bit much.  With those lines commented out it comes up to 1.31 MB.  I could technically cut the need back to about 16000 objects of the type, but then it still comes up to 25 MB.  But enough about that.  I'll figure that much out myself.  I was just wondering about the size of the String type.

Thanks.
#260
The manual currently states that an import is a reference to a function (or variable) that is external to the current script.  This isn't always the case, and could cause some confusion when the user wants to create an optional parameter to a local function.

I discovered while writing the ScrollingDialog Script Module, that you can in fact import a function to the script that it is declared in.  You can't call it between the import and the definition, so the reason for doing this might not be apparent, but if you want an optional parameter, it's essential to define the default value in the function declaration (import).  You can't do it in the definition.

So, if the user wants to create a local function with optional parameters, they could do the following (I'll use an example from the manual):

Code: ags
import void AddInvAndPlaySound(int inventoryItem, int sound = 5);

void AddInvAndPlaySound(int inventoryItem, int sound) {
  player.AddInventory(inventory[inventoryItem]);
  PlaySound(sound);
  }


That way the user can specify a different sound for different items, without having to make the function global to do so.

Yes, I suppose it's sort of a nit-pickish thing, but it would be nice to know about.
SMF spam blocked by CleanTalk