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

#141
When running a game in window mode, how can I detect if the mouse cursor has been positioned outside the AGS game window?   
#142
Advanced Technical Forum / Pointer Question
Sat 12/03/2005 22:06:23
If "control" is null then the following test generates a runtime error. 
   if (control.OwningGUI.Controls[0].AsButton!=null) {
      // Do Something
   }

So then is it necessary to use a nested if statement to check each portion of the path for null or is there a better way?
   if (control!=null) {
      if (control.OwningGUI!=null) {
         if (control.OwningGUI.Controls[0]=null) {
            if (control.OwningGUI.Controls[0].AsButton!=null) {
               // Do Something
            }
         }
      }
   }

Is it the case that AsButton or Controls{x} generates the runtime error and if so perhaps just returning null would be a better choice, since the result of those operations is a pointer.  Runtime errors would ultimately be generated if such a null pointer is subsequently used in a context that warrants it?

This seems to me to be very reminiscent to the recent discussion about lazy evaluation. 
#143
I recently came across the need to determine what kind of control, to which a GUIcontrol pointer points, while trying out the new V2.7 GUI stuff.   

I am making a generic GUI click handler where I pass the control pointer and mouse button to the handler.  To handle the click it's necessary to extract text from the control, however, it is necessary to know what kind of control it is.  For example, you would use GetText if it were a button and GetItemText if it were a listbox.

So I wonder if it would be reasonable to add a ControlType property to GUI controls in some future version of AGS?

#144
General Discussion / Cybernetic Name Generator
Sun 27/02/2005 02:11:00
Just came across this name generator.  It's kind of fun amd who knows you may even be able to use it to think of a name for a game character or something. 

http://www.cyborgname.com/

I put in mine and Sqinky's name just for fun and here's what I got ... as you can see, he is a bit more advanced than me  :-[ 



#145
I could have sworn that I've seen an AGS function that returns the number of pixels it takes to display a given string and font, but I'll be darned if I can find it now.  Anyone know the name of this function or WITFN it is?  have any clues how to find it.   :=  Thanks...
#146
(Edit by strazer: Thread was split, don't be confused.)

Module Programming Conventions
I had a go at documenting the conclusions reached in the discussion below.  I will update these as the discussion progresses. 

  • Module Programming Guidlines
  • Module Script Template
  • Module Header Template



    Here are some questions that came to mind during development of the IniFile module.  Let me know your thoughts or perhaps you may have other questions.   

    Documentation
    I embedded tutorial and reference docuemnts in the header file because I thought that, that documentation should always stay with the module and a seperate/external file wouldn't be as tightly bound as  the header would be.  However, after finishing the documentation, it seems to me that it is too large to be embedded in the header and that this would probably be generally true for most all modules (unless of course the author neglected to produce any documentation).   Ok, so then where should the documentation reside, if not in the header file?  External txt file?   Should we ask CJ to add a text document to the module mechanism?  What other alternatives are there?   

    Programming Conventions
    What programming conventions do we need to recommend so that modules from multiple authors and times can be used together in the same game.  For example inIniFile the module name is used to define a struct (i.e. OO Object) and to prefix #define definitions to ensure these definitions would be unique and not interfere with other modules.   So if there is only one module named IniFile imported into the game there shouldn't be a problem. 
       struct IniFile {
          :
       }
    
       #define INIFILE_BUFSIZE 500
          :
    

    So what other, if any, conventions are necessary to avoid such incompatibilities?   

    Publishing, Licensing, etc
    I think we should recommend some publishing guidelines to make the module feature as useful as possible for as many people as possible.   Should it be native scm format or compressed into zip.  If the latter what other, if any, files should be included in the zip.  What kind of license should we recommend?   I used GPL for the time being for lack of better ideas.   Probably we could come up with something the is much briefer and serves the purpose of giving people permission to use the module in their games.   Any ideas?    I think also we should recommend which "permissions" should be enabled in the Module Manager.   These recommendations would of course be for module authors wishing to publish their work for use by the AGS community.  If someone had a reason to do something different they could elect to do so.   Such recommendations would be a common starting point for all and would encourage consistency.   What should be recommended?

    Announcing, Reviewing, Release Module List
    How should new modules be announced and reviewed?  Should this be done in the AGS forums, if so which one(s)?  Where can we keep a list of released modules - maybe a sticky or somewhere else?

    Edit 2006-04-27:

    A short summary of the guidelines can now be found here.
#147
Modules, Plugins & Tools / MODULE: IniFile
Thu 27/01/2005 18:24:15
AGS v2.7+ has a new feature allowing script modules to be created and used in a fashion similar to plug-ins.  So I took the liberty of making a module that provides support for reading INI configuration files, similar to the acsetup.cfg file AGS uses.  This was brought up a couple of months ago in a thread by Radiant.

Here is a link to the module.  I have included my test game for convenience.  Just unzip it to a game folder and open it with the AGS editor and do a Game->Test.  Have a look and let me know what you think.  Also please also comment on coding, documenting,  and publishing modules and in general.

Download here
Mirror

Are any other features needed or desired?  If so what?  Any bugs or incorrect operation?   Any incorrect or confusing documentation?   Current documentation is a bit redundant.  I prefer not to write about the same things in multiple places because it is nearly impossible to keep everything upto date. Any ideas about how to clean this up?
#148
I did a bone head thing that took me a couple of days to figure out.  The story goes something like this.  I made a function called Delete(string section, string option) that deletes a single option value pair from an ini type configuration file.  If option is a blank string it deletes the entire section.   Delete calls nextopt(string option, value) functions which finds the next option in the file and copies the option name to OPTION and the value string to VALUE.  Ok, so far so good.   Now I make a test and call Delete("mysec", ""), so when nextopt() copies the option name to its parameter OPTION it actually is being copied to "".   After this really bizzare things start to happen making it difficult to find out what is actually going on. 

So I am wondering if it would be possible or practical for the compiler to check for someone writting to constant strings that are automatically created by AGS (i.e. "", "constant string created by AGS", etc).   So that if you did a StrCopy("", "#hit happens") there would be an error message telling that you can't write to a constant string.   

Late last night I began composing a bug report but decided not to post it when I wrote "I'll probably regret posting this in the morning...".    Were I in a different state of mind (no I don't mean inebriated  := but this problem did make me wish I was ...) or  had less programming experience I am certain I would have pressed the post button. 

Although this suggestion doesn't seem, to me, to be a high priority item, it could potentially save future headaches for all concerned.  I thought I would share my expreience and make this suggestion for whatever it is worth.     

#149
I recently installed a number of extensions in my Firefox browser and they are terrific.  The extension manager is great and the extensions are really small in file size. 

I am using and highly recommend the following Firefox extensions.

  • Image Zoom -  Right click any image and zoom in/out

  • downTHEMall - Download all images, links, mp3's or whatever from the current page.  Really cool...

  • Disabl Targets for Download - Gets rid of that blank page you somtimes get when downloading a file to disk.

    If anyone else has some favorite Firefox extensions list them here.  Cheers!

  • AniDisable - Right click to enable/disable gif animations


    I have installed these but haven't had much chance to try them out yet

  • fireFtp - Puts an ftp client in a browser window or tab.  Lacks ability to store login info at the moment but this is on a todo list.  When this get's implemented I'll start using it more often. 

  • ScrapBook - Same and manage web page collections on your hard disk. 

  • Bookmarks Synchronizer - Upload and download bookmatks to a WebDAV server.
#150
Would it be possible to specify a scale factor in the Room Object Editor  if the "Use Walkable Area Scaling" box is unticked?  If it was ticked then the scale factor would come frm the walkable area.   

Also could there be an option to ignore walkbehind areas?   Currently an object such as a door that's not in pixel perfect alignment with a walkbehind is partially hidden.

Does anyone else thinnk these would be useful?
#151
I thought it was possible to do this but haven't found anything in the manual.  Is it possible to change the sprite number assigned to a view/loop/frame from a script at runtime?  

#152
This works just fine ...
StrFormat(output_path, "%s\\%s\\%s", repository, docname, output_type);


But when I try to append a trailing back-slash like this ...
StrFormat(output_path, "%s\\%s\\%s\\", repository, docname, output_type);

I get a compile error as follows:  Error (line: 514) undefined symbol 'filename'.  

Here is the function's script.  There are a number of string  variables defined elsewhere in other functions but not this one.
string output, repository, docname;

function apGetOutputPath(string output_type, string output_path) {
   
   // Determine if output is in document sub-directory or in output sub-directory
   if (StrComp(output,".")==0) {
      StrFormat(output_path,"%s\\%s\\%s\\",output, docname, output_type);  
   }
   else {
      StrFormat(output_path, "%s\\%s\\%s\\", repository, docname, output_type);
   }
}   


If this a bug or am I making a bone-headed error ??
#153
When importing sprites it's difficult to position the import/extent box at the upper right hand corner of the image without having the cursor move out of the import window.

Would it be possible to position the mouse cursor at the bottom right hand corner of the import/extent box?  In this  way the extent box would lock into the upper left hand corner while the cursor still has a number of pixels left to travel before leaving the import window.  

I think this would make it a lot easier to import sprites, especially tiled ones.  


#154
While playing Kairus' new Garfield game I discovered my PC was infected with a virus.  I got a weird message saying something about needing to "run the AGS editor and save a file or something" whenI tried running the game.exe.   It had worked previously so I tried reinstalling the game (unzipping it basically).  When I did so, I noticed that several of the files were now a bit bigger than they were in initial installation.  Viloa!! No! I mean #$#@$@, I have  virus...

Ok, so my idea is to include a purposeful test in the runtime engine to see if the exe has been modified and then displaying a relevant message.   In this way games created with AGS and distributed on the net would remain virus free.   The test could be some kind of a CRC check or even something as simple as a "file size" check, or other alternatives, I suppose.  

Well, I just wonder what everyone else thinks.  
#155
Is it possible to get the AGS Version the game was compiled under rom script?  If not could this be added without too much trouble?   Maybe something like a variable system.version or a constant #define AGSVERSION.  

This would make it very easy to put the correct Version in the credits and help of a game.  If someone had trouble playing it in the future they would know for sure which AGS version the thing was made with.    

It would also be helpful to have a mention of the AGS version in the help file.

Thanks.
#156
The help file says that only BMP and PCX files can be loaded using the LoadImageFile() function.  Is this correct or is it possible to load PNG files since they are now also supported by the editor?  
#157
I upgraded to cable modem recently and so consequently I will need to move my AGS creations (3) to a new web location. I am not sure I remember all the passwords to be able to edit  the relevant bits.  In the past I sent off a PM and to ask that it be reset.    Anyway my current situation and previous experiences have inspired this idea:

Would it be a good idea for each author to have a single username and password?   Maybe have it so that an author could login to the games page once and have access to all of his or her games without re-enterng passwords?  Maybe have a list of the author's games as well?  

Admittedly this seems to be a fairly low priority function.   However, if the rest of the group thinks it's a good idea and if we can sketch out how it should work, then maybe it could go on a future todo list or someting.  

#158
If you are a Star trek fan you may want to check this out!!! A fan made internet series.....



http://www.5yearmission.com/
#159
General Discussion / VoIP Phone Service
Mon 16/02/2004 22:27:02
I have been looking into VoIP phone companies recently. They fall generally into 2 categories:

  • PC to PC - generally free
  • Phone to Phone - generally monthly fee

    Phone to Phone
    There are a number of paid services that can actually replace traditional telephone service.  With one of them, Vonage - http://www.vonage.com/,  you can even keep your existing phone number.   Generally speaking, many features are provided free of charge as well as free or deeply discounted long distance.

    PC to PC
    I found several of these as well including this one from the 2 KaZZa developers http://www.skype.com/.  

    ======================
    I was wondering if anyone has any recent experience with VoIP or what if any gossip anyone has heard about this.

    I am seriously considering using something like Vonage and telling the phone company to come and take the wires off my house.  But before I do that I think I will try something like Skype to see how it works.  

    Anyone want to try experimenting with Skype (or others) ?
#160
CJ I am really impressed the latest enhancements of the script editor.  I of course really like the autocomplete and the popup help, really nice.

I have recently discovered that if you select a block of stuff and press tab the whole block is tabbed over, really cool.  The only thing is that the tab setting is something like 8 spaces over.  

What I was wondering is this:  In the future would it be possible to expose the editor's config file so that we can modify it  or alternatively would it be possible to publish the lang/config file that contains the auto-complete stuff so that we could use Scite as our external editor and still have the auto-complete features?  

I think that something similiar to what I have suggested would address many feature requests from advanced scripters.  

Really nice work Chris.  It's greatly appreciated.
SMF spam blocked by CleanTalk