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

#1021
Fair enough, didn't know it was known. ;)
#1022
I want to declare a number of pointer variables.   So normally  I would write somthing like this. 
Code: ags

	Button 	*First;
	Button	*Prev;
	Button	*Next;
	Button	*Last;


This works just fine.  But being the lazy sort I am,  I sometimes will put it all on one line like this. 
Code: ags

	Button 	*First,  *Prev,  *Next,  *Last; 


But the compiler throws the following error when it's written that way. 
Code: ags

Failed to save room room0.crm; details below
BluBox.ash(255): Error (line 255): '*' is already defined

--------------------- BluBox.ash -----------------------------------
255:	Button 	*First,  *Prev,  *Next,  *Last; 


One other thing I noticed is that when it's written as shown below it apparently works just fine.   There are no compiler errors and I am able to use the Prev, Next, and Last variables as I would any other pointer variable.    It's as if the first"*" is applied to subsequent variables defined on the same line. 
Code: ags

	Button 	*First,  Prev,  Next,  Last;


This doesn't seem to be correct to me.
#1023
Also it is not necessary to disallow event handler functions in the global script.  It may be desirable to allow them in the global script to maintain compatibility. 

Also it would perhaps be worth considering inclusion of a GUI header file as well. 
#1024
The only thing that need be duplicated is the actual event handler function itself.  The actual parser code could be off in the global script or a module and just called from both places.  Having a GUI tightly coupled to it's event handlers is an advantage and not a disadvantage, IMHO.
Code: ags

*** GUI-1 Script file
function txtGui1Parser_Activate(GUIControl *control) {
  Parser.ParseText(control.AsTextBox.Text);
}

*** GUI-2 Script file
function txtGui2Parser_Activate(GUIControl *control) {
  Parser.ParseText(control.AsTextBox.Text);
}
#1025
I did like JPSoft's idea of a text file containing  notes such as todo lists or other handy info that would be useful to a developer.  Perhaps this is better done separately from the start page where a number of text files could be opened from within the editor.

#1026
I think this is a good idea but why not just put the GUI script under the GUI to which it applies.   The GUI editor would then work similar to the room editor.  The GUI scripts would just be appended (actually or virtually) to the end of the global script at compile time and would require no other  changes to the scripting system.  When the GUI is exported whatever is in it's script file would go with it, including code not contained within an event handler function.   The navigation tree would end up looking something like the following.

General Settins
Colors
Sprites
Text Parser   
Lip Sync
GUIs
     GUI-1
          Edit Gui
          Script
     GUI-2
          Edit Gui
          Script
Inventory Items
Dialogs
Views
Characters
     Character-1
          Edit Character
          Script
     Character-2
          Edit Character
          Script
Mouse Cursors
Fonts
Global Variables
Scripts
Plugin
Rooms
Translations
#1027
Thought some of you may be interested in this.  Here is a link to a brief description.

http://www.groklaw.net/article.php?story=20080811180231923
#1028
General Discussion / Re: Russia and Georgia.
Mon 11/08/2008 19:02:43
Quote
The Russian government is not the same as it were back during Glasnost and before.
Well I suppose all of the ex-party members and their bureaucratic accomplishes are sitting on a beach somewhere in the south of France or collecting unemployment back in mother Russia.  ;)   
#1029
Quote
All science is from a human point of reference; uncertainty is a fundamental property of the perspective from which we observe the universe. That perspective is the limit of our possible knowledge, so we often generalize it to be the absolute truth, but it's not and that's the point.
Could you please explain what this has to do with Heisenberg's Uncertainty Principle other than you and he have used the word "uncertainity"? 

[edit]
Well said Eldkatt ;)
#1030
Quote
. Uncertainty (e.g. Heisenberg's, which I probably should have mentioned above) as an intrinsic, inevitable property of the relationship between humans and the rest of the universe
Heisenberg's Uncertainty Principle has absolutely nothing to do with human beings or measuring devices.  It is a fundamental property of the universe and to date there have been no evidence to suggest otherwise. 
#1031
General Discussion / Re: Russia and Georgia.
Sun 10/08/2008 19:28:58
Well in the case of Palestine the Britts were the legitimate owners.  They got it from the Turks who got it from all those other guys a 1000+ years ago.  They  involved themselves in a war (WWI) which they and their allies lost.  The price they paid for peace and to keep their home country, Turkey,  was to break up the rest of their empire and give it to the victors.   (see Wikipedia here and here for references)
#1032
I haven't watched the Olympics in a long, long time because of the way the coverage dwells on the non-sports competitions.   Way back before most of you can remember were born it was possible to follow such things as boxing, water polo, wrestling, hockey, etc.  You know the kinds of sports were the opponents have simultaneous participation and it doesn't matter how cute people think they look when they are doing it.   

If they have to hold up signs to see who won then it ain't no stink'in sport as far as I'm concerned.   I think such things would be more correctly called performance art. 

I think the Olympics, or at least the TV coverage part of it, have degenerated into a mass soft porn show and is less entertaining than the current batch of reality TV shows, in which I also have no interest.   Bah!!!  ;)

[edit]
About the Nazi thing ... I got it and I thought it was a pretty cutting critique of China by comparing them to where Nazi Germany was just a few years before WWII.  For the uninformed Nazi Germany hosted the 1936 Olympics.  Hitler was espousing the superiority of the master race in this time frame. 

Unfortunately Jesse Owens, a black American,  won four gold medals including one in the long jump, something he had never lcompeted in before the olympics.  It's my understanding that one of the USA long jumpers was unable to participate and Owens was asked to take his place.  He agreed to do it even though he didn't know anything about it.   One of the German athletes gave him some pointers and he went on to win the gold medal in that event.

This belied the myth of the master race and Hitler left the stadium before or during the awards ceremony.   It was a big deal then and for a long time after.
#1033
Quote
I'd like to second ProgZMax's request (previous page) for a name property to be added to Gui controls....
I also second Progy's suggestion of adding some kind of descriptive text property to gui controls.  A module would be able to scan a gui for controls having specific text tags and then connect to them automatically. Anyway, thats what I would use it for.   
#1034
Quote
Can you post the new error message? You shouldn't be getting an identical error any more, though you may be getting a very similar one.
Sure thing.  Here is an error dump from trying to run the compiler.

Code: ags

Error: There are no more files.

Version: AGS 3.1.0.53

System.IO.IOException: There are no more files.
 ---> System.IO.IOException: There are no more files.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at AGS.Editor.Components.MusicAndSpeechComponent.CompilePAMFiles(CompileMessages errors)
   at AGS.Editor.Components.MusicAndSpeechComponent._agsEditor_ExtraCompilationStep(CompileMessages errors)
   at AGS.Editor.AGSEditor.CompileScripts(Object parameter)
   at AGS.Editor.BusyDialog.RunHandlerOnThread()
   --- End of inner exception stack trace ---
   at AGS.Editor.BusyDialog.Show(String message, ProcessingHandler handler, Object parameter)
   at AGS.Editor.AGSEditor.CompileGame(Boolean forceRebuild, Boolean createMiniExeForDebug)
   at AGS.Editor.Components.BuildCommandsComponent.CompileGame(Boolean forceRebuild)
   at AGS.Editor.Components.BuildCommandsComponent.CommandClick(String controlID)
   at AGS.Editor.GUIController._mainForm_OnMenuClick(String menuItemID)
   at AGS.Editor.MainMenuManager.MenuEventHandler(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

#1035
Well the obvious thing (at least to me) is to have the "Look at apple" handler set a String variable ( String it_pronoun; for example) to "apple".  Then when "it" is encountered in the next input replace "it" with the contents of the variable it_pronoun. 

In a generalized solution there would probably two static String variables  ParserNoun and ParserPronoun, which would get populated by a call to a parser function made from the "Look at apple" event handler.

String ParserNoun, ParserPronoun. 

So in the lookat event handler you would have something like this ...

function lookat_Apple() {
   ParserNoun("Apple", "it");
   player.Say("It's a big juicy apple,..");
}

#1036
Not really a bug but I just noticed that the Textbox control does not have it's TextColor property exposed in the script.  It's useful for module/GUI designer who is using TextBox in conjunction with Buttons to make multiple input fields.   
#1037
Quote
Quote
Error: There are no more files.
System.IO.IOException: There are no more files.
Hmm, this seems to be a bug in the .NET Framework, but I've put a workaround into beta 6 -- please let me know if it works.
It doesn't seem like it works.   Everything under the Build menu and create new game causes the error for me still.   Thanks for th quick response ;)
#1038
I have been heavily using the beta version in Linux (via VirtualBox) for the last week or so and it is working great.  Here are a couple things I noticed though...

GUI Editor
I have seen the GUI editor coordinate problem previously reported and would add that the GUI background color is draw at twice the actual size (the border is drawn correctly).  When new controls are created they appear to be draw at coordinates half the distance from where ther where created. I know this is already reported and just adding my brief observation in case it may be of help. 

Problem Using  Mapped Drive
VirtualBox creates a virtual disk for drive C.  Windows 2000 and AGS are installed on virtual drive C.  I have setup VirtualBox for seamless integration where I have the windows menu/taskbar at the top of my screen and the linux KDE menu/taskbar at the bnottom of my screen and my combined linux and windows desktop displayed on the remainder of the screen.  Start AGS and it runs in a windows style window.  Start Linux apps and the run in KDE style windows.

Games that reside on drive C can be edited and tested without any problems the same as on a native windows machine.  Linux apps, however,  can't access the virtual C drive.  Windows runing within birtualBox can however access the Linux file system using "net use" to map all or a portion of the native Linux file system to a windows drive letter (i.e. F:/ ).   There are many obvious advantages to keeping and working with AGS's game files on the native Linux file system rather than virtual drive C which is in actuality OBFF  (one big f#@king file) in the native file system.   

AGS is able to open, edit, and save game files residing on a mapped drive (mapped via "net use") without any problems.  However, all of the command under the Build menu cause AGS to crash with the " There are no more files." error shown below. 

Since it's possible to edit/save files  on a mapped drive then it would seem possible fix this problem.  If this little thing gets fixed, then I would say that the new AGS editor runs flawlessly in Linux (via VirtualBox).  Please take a look and let me know if fixing this is possible and if it's worth your effort.  I am planning on publishing a How-To in the near future on the forum for my other fellow Linux users and would want to make it consistent with your response.  Thanks.

Code: ags

Error: There are no more files.

Version: AGS 3.1.0.52

System.IO.IOException: There are no more files.
 ---> System.IO.IOException: There are no more files.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, ...
              Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at AGS.Editor.Utilities.AddAllMatchingFiles(IList`1 list, String fileMask, Boolean fullPaths)
   at AGS.Editor.Components.MusicAndSpeechComponent._agsEditor_ExtraCompilationStep(CompileMessages errors)
   at AGS.Editor.AGSEditor.CompileScripts(Object parameter)
   at AGS.Editor.BusyDialog.RunHandlerOnThread()
   --- End of inner exception stack trace ---
   at AGS.Editor.BusyDialog.Show(String message, ProcessingHandler handler, Object parameter)
   at AGS.Editor.AGSEditor.CompileGame(Boolean forceRebuild, Boolean createMiniExeForDebug)
   at AGS.Editor.Components.BuildCommandsComponent.TestGame(Boolean withDebugger)
   at AGS.Editor.Components.BuildCommandsComponent.CommandClick(String controlID)
   at AGS.Editor.GUIController._mainForm_OnMenuClick(String menuItemID)
   at AGS.Editor.MainMenuManager.MenuEventHandler(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
#1039
When creating modules for use by others it is best to follow the Module Guidelines contained in the Modules, Plugins and Technical FAQ sticky or from the AGS Wiki .

The guidelines address the issues you raise and others.  There are templates for the
Module Header file and for the Module Script file that make it easy to implement the guidelines.   

Generally speaking the purpose of the guidelines is to increase the likely hood that modules created by multiple authors at different times can be combined without problems.  For example Lyaer suggests that you put the following in your module header.

Code: ags

enum Alignment {
  eAlignJustified,
  eAlignLeft,
  eAlignChaoticNeutral
};


The problem with this is that some other module may have one the same thing.  After all left and justified alignments are a fairly common concept.   The module guidelines suggests that instead you prepend the module name on all entities that are publicly exposed. 

Code: ags

enum Alignment {
  eMyModule_AlignJustified,
  eMyModule_AlignLeft,
  eMyModule_AlignChaoticNeutral
};


To answer your specific questions ....

1 Using GUIs with Modules
At the time the module guidelines were being discussed and written the GUI system was being OOized and so the guidelines are a bit silent about this.  However, since things have stabilized it has been common practice to do the following:

1.  Create public handler functions in the module.
     
Code: ags

fucntion MyModule_Save(...) {
   :
}


2.  Create GUI(s) specific to your module.  Strazer suggests perpending the module name to the GUI name.  I personally have mixed feelings about this because there is a length limitation on the GUI name.   Since there is not yet a consensus you can do this or not.  So in your example you could either name the GUI MYMODULE1, Save or MyModuleSave.   

The save button would then be named MYMODULE1_bSave, Save_bSave or MyModuleSave_bSave.   

3.  Create the event handler functions in the global script in the normal way.
Code: ags

function MyModuleSave_bSave_on_click(MouseButton button) {
   MyModule_Save(button, ...);
} 


4. Export the GUI and distribute it with your module.  When someone imports the GUI the event handler will also be imported into the global script.

2 Public Enums with Modules
I guess I already cover this.  One other advantage of prepending the module name is that that auto-complete will list the enums, functions, or whatever that are specific to your module making it easier for others to use.
Code: ags

enum Alignment {
  eMyModule_AlignJustified,
  eMyModule_AlignLeft,
  eMyModule_AlignChaoticNeutral
};

#1040
Thanks for the offer.  Send me a PM and we'll find something interesting to do. 

SMF spam blocked by CleanTalk