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

#661
Character.FollowCharacter() is what you are probably wanting.  There's a good description and example in the help file.

[edit]
http://www.adventuregamestudio.co.uk/manual/Character.FollowCharacter.htm
#662
I don't fully understand  precisely what you are trying to accomplish  but I can help with a couple of points.

Dialogs
I am not sure but I don't think the builtin dialog system uses the Say(_) function.   Any commonality they have is likely at amuch lower level and only accessable from within the AGSruntime itself.

Extender Functions
There is a feature called extender functions.  There are good examples in the manual.  Essentially you create a function like this:
Code: ags

*** Script Header ***
function SayIt(this Character*, String text);

import 
*** Global Script ***
function SayIt(this Character*, String text) {
   // put any code you want here to get or manipulate the string
   String it = String.Format("It says: %s",text);
   
   // The "this" pointer accesses what ever character is talking
   this.Say(it);
}

*** Room Script ***
function some_functio_or_another() {
   // Make ego say "It says: Hello world"
   cEgo.SayIt("Hello world");
}


The parameter declaration "this Character*" is a pointer to the character who is talking. This function can then be used just like any other Character function (or moreproperly method).   When the functionis called in the room script as shown above  pointer parameterisfilled in automatically by ags.

Conclusion
I'm not sure what you are trying to do exactly but it will probably entailcreating a custom dialog system.
#663
General Discussion / Re: andLinux.org?
Tue 06/10/2009 13:01:21
I have really good success with kubuntu and virtualbox.  Set it up in seamlees mode and it works great.

But if you really must use windows then you may want to checkout the windows version of KDE.
http://windows.kde.org/
#664
You will probably have to do some error checking on the index bounds etc.   You can try making the following modification to see if that helps.

Code: ags

else if (button == eMouseWheelNorth) 
{ 
	if (gSave.Visible)
	{
                if (stSaveGames.SelectedIndex>0) {
                   stSaveGames.SelectedIndex--;
                   if (stSaveGames.SelectedIndex<stSaveGames.TopItem) { 
      		      stSaveGames.TopItem = stSaveGames.SelectedIndex;
                   }
                }
	}
}
else if (button == eMouseWheelSouth) 
{
    	if (gSave.Visible)
    	{
                if (stSaveGames.SelectedIndex<stSaveGames.ItemCount)  {
                   stSaveGames.SelectedIndex++;
                   if (stSaveGames.SelectedIndex>(stSaveGames.TopItem+stSaveGames.RowCount)) { 
       		      stSaveGames.TopItem = stSaveGames.SelectedIndex - stSaveGames.RowCount;
                   }
                }
    	}
}
#665
You need to change the SelectedIndex property to scroll the selection.  You can then manipulate the TopItem property to move the listbox window's position so that the selected item remains visible.   

Themodified script below ought (it's untested) to let the selection scroll up/down the listbox window,  When it reaches the top of bottom of the window then the entire list will scroll up/down.    You can of course modify this behavior any way you want.  For example the listbox widow could be  positioned so the the selection is displayed in the center of the window.

Anyway I think the example belowought to give you an idea of how to do these things.

Code: ags

else if (button == eMouseWheelNorth) 
{ 
	if (gSave.Visible)
	{
                if (stSaveGames.SelectedIndex>0) {
                   stSaveGames.SelectedIndex--;
                }
                if (stSaveGames.SelectedIndex<stSaveGames.TopItem) { 
    		   stSaveGames.TopItem = stSaveGames.SelectedIndex;
                }
	}
}
else if (button == eMouseWheelSouth) 
{
    	if (gSave.Visible)
    	{
                if (stSaveGames.SelectedIndex<stSaveGames.ItemCount)  {
                   stSaveGames.SelectedIndex++;
                }
                if (stSaveGames.SelectedIndex>(stSaveGames.TopItem+stSaveGames.RowCount)) { 
    		   stSaveGames.TopItem = stSaveGames.SelectedIndex - stSaveGames.RowCount;
                }
    	}
}
#666
Put Gilbet's function in the Global Script.  Then if you put the following line in the Script Header you should be able to call the function from any room script.

import function RemoveTask(String sss);
#667
Cool! I exported the entry and got a .reg file with following contents ..

Quote from: FixSecurityWarnings.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
"LowRiskFileTypes"="\".exe;.bat;.reg;.vbs;\""

I suppose one could create a text file, paste this stuff in there and save it as a .reg file and double click it to make the entry?
#668
The following modification of the windows registry eliminates the warning message.

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
"LowRiskFileTypes"=".exe;.bat;.reg;.vbs;"

I found this solution here:
http://www.sevenforums.com/system-security/8642-how-get-rid-open-file-security-warning.html

I used REGEDIT from the command lineto makethe change.   Just for the sake of being thorough isn't there a way to make this change using a script file? 

Anyway thanks to everyone for your help.   
#669
Quote
So, what would you have done?
This looks like a job for Mr. Hatchet!
#670
Ok, found the Acwin.exe unblock button and clicked it as instructed.

Problem still exists when gameis created and run on  network mapped drive.    WinXP is running in VirtualBox and mapped drive is a shared folder between host and guest OSes. 

Looks like a Windows problem rather than an Ags one.  I tried fiddling around with security settings but haven't stumbled upon the correct combination.  Any further advice will be greatly appreciated.
#671
Will this work on an 64-bit AMD machine?
#672
I recently upgraded my AGS workstation to WinXp  := and now I notice that whenever I run/test a game from within the AGSeditor a security warning dialog pops up asking if it's Ok to run the exe.   

It's annoying after the first time and I would like to turn it off.  I am guessing there is a simple and obvious answer that eludes me at the moment. Any advice and/or enlightenment would be appreciated.  Thanks.     
#673
OK, something like a palette from which you can select the desired color?   The easiest way is to use a GUI with a bunch of buttons; one for each color.   Then have a collection of solid colored, same sized,  rectangular sprites; one for each possible color.  The Sprite numbers are then associated with specific colors.   Use the "player enters room" event handler to load the colorss intothe buttons (i.e. modify the button graphic to contaon the sprite corresponding to the desired color.   When the button is clicked the sprite/graphic id can be retrieved to determine the color.

In a more sophisticated version of this you could have just one set of sprites and then use the drawing surface functions to fill them with the desired color.  This would allow the uswer to create custom colors.   
#674
Quote
I got a code on the internet that said something about making a character called cAnimintial, have him run the scene and have him play on the level of the cutscene. I tried this and it did not work. ... Sorry I couldn't get the actual code but I deleted it-
All I can do is guess that either you made an error in copying that code or that it's author make an error when he posted it.  ;)

Quote
I want a room where the cutscene plays as an intro, then after the gameplay starts.
Seems like you had something working at one point but it was going too slow.   I gave you some ideas of how to investigate why this was happening and the kinds of information to collect so that someone on the fourm would be able to help.  I have a suspicion that you were starting the character to animate in the repeatedly execute event handler probably along with a wait(15) or some other incorrect coding scenario.  But of course I have no way of knowing idf this is so or not and can only guess.  Sorry but that's the best I can do with the information provided.

Quote from: AGS MAnual
// Start animation like this
cEgo.LockView(5);
cEgo.Animate(3, 1, 1, eNoBlock);

// Stop animation  like this
cEgo.Animate(3, 1, 0, eBlock);  // or cEgo.StopMoving()
cEgo.UnlockView();
#675
I think this is what you want ...

Quote from: AGS Manual
String.Truncate(int length)

Returns a version of the string that has been truncated down to length characters.

NOTE: The new string is returned from this funcAtion; it does NOT modify the original string.

Example:

String mystring = "Hello World!";
String truncated = mystring.Truncate(4);
Display("Original: %s, Truncated: %s", mystring, truncated);

will display "Original: Hello World!, Truncated: Hell".

See Also: String.Append, String.Substring
#676
Quote
... so you'd have to have some pretty strict browser requirements for visitors ...
This isn't as much of a problem as it seems.  The project is a long term one (1-2 years) and the target audience is a pool of subcontractors for whom I would be booking appointments.  The way it's done now by competitors is that they call each other up on cell phones and fax sheets of paper back and forth.   I think there is a better, paperless, phone call less way of doing this.  Initially I'll be working with one subcontractor, my wife.  When I have something that works well and is scalable then I will begin expanding.

[edit-1]
For anyone interested here are links to GWT Designer
http://www.instantiations.com/gwtdesigner/index.html

and to  GWT
http://code.google.com/webtoolkit/

[edit-2]
Also I was wondering what concerns are there keeping and manipulating business data (i.e. billing and other financial transaction) on the same server as the web portal?  How is this usually done?   Is it conventional wisdom to keep the business data and logic on a separate, non-web server and limit communication to/from webserver?


#677
I believe, historically, the name of the game folder and game are one and the same.   You could probably just rename the game folder and delete the contents of the compiled directory and everything would work fine.  I've never experienced a problem not being able to rename a game; likely I am lucky and just happen to do everything required. 
#678
Quote from: Calin Leafshade on Fri 25/09/2009 10:12:23
Quote from: RickJ on Fri 25/09/2009 09:49:53
Programatically Sending Fax
How to generate and send a fax from a webserver or the server upon which the webserver is running?  Is it necessary that I have a phone line/modem connection to send the fax?
There are web APIs that allow you to send faxes via the interwebz but they tend to be expensive. On the plus side they are very easy to implement.
Thanks for letting me know where to look.  Found a bunch of google links; one company offers fax service for $24/month, the same cost as another phone line with my internet phone company, packet8.     

Quote
Quote
Signature Capture
I imagine there would be a web form with a signature box.   A click in the box could bring up a signature window or just send focus to the webform's field where the users's pen strokes would be recorded in a png or svg file.   How would you suggest that this be done?    I found an example of a sketch program that uses HTML5 and  Canvas; is this the way to go?  Will I need to deploy an exe on the cell phone to make this happen or can I do it all on the server side?
Canvas might be a good thought but do any cellphones fully support HTML5 yet?.. mine doesnt even support flash.
I think the Nokia N900 does or is gong to support HTML5?   There is also a device called CrunchPadthat could possibly be used instead.
[/quote]

Quote
Quote
GWT and GWT Designer
Is there anyone using AJAX and if so what tools are you using?  I am thinking about using the Google Web Toolkit and GWT Designer which is a third party IDE; any opinions?
Im not sure really what you mean by tools... AJAX is just javascript calling a PHP script really. In all the cases i've used AJAX its just been a matter of using a script to call a PHP script to retrieve from/write to a database.
All i used is notepad :p
GWT is a framework for creating AJAX applications.  There is a collection of widgets that are coded in Java.  There is a compiler that converts the Java into the required JSP, PHP, HTML, etc.   There are a number of other frameworks as well.  GWT Designer is and IDE for GWT.  It allows GUI elements to be created visually and then  connected to the the appropriate event handlers.  Similar to Borland and AGS for that matter.
[/quote]

Quote
Quote
HTML5-Canvas or other
This is a bit unrelated to the above project but is it possible to make a web page (thinking AJAX) that would allow a visitor to compose an image by selecting multiple Alpha-PNGs and overlaying them the same way Photoshoppers use layers to  build up an image.  Once completed then I would like to create a single PNG from the composite.  How would one go about implementing a thing like this?
I would simply compose the image server side and provide a download link to the composed image.. instead of using client side script.

So you would have a system whereby the user can upload all their pngs. Then the server runs an image manipulation script (with GDlib probably) and returns a link to the composed image.
I was thinking about making a 2D character generator something like CHARAS  except for adventure games.  The user would first select a module which consists of a base and a number of components (i.e. Layers) Such as body parts, clothing , etc.  For each component there would be one or more variations from which the user could select.  When the character design is complete a definition file could be generated and fed into a client side compiler that would fetch all the necessary images and generate the specified composite for each frame in each loop.   The result could be a collection of PNG/Sprite files that can be imported into AGS  and perhaps some kind of def file that could be used by an AGS editor plugin to automatically import the character sprites, define the view(s), loops, frames, and AGS character.

Anyone would be able to upload new options for existing components.  The model author would be able to add new components  and would have moderator power over submissions. 
[/quote]

Thanks for the info.
#679
I am thinking about doing a project for my wife sometime in the future and I have a few questions that perhaps someone can answer or offer an informed opinion.  I would basically be building a web calendar/appointment scheduler that would be accessible from her cell phone.   I know there are web calendars out there already but out of the box they do not have some features I need.  For example when an appointment is made specific data would need to be entered and save in a database record.  From the cell phone she would be able to select the day and time of the appointment and then display this data in a sensible format.   There would need to be a way of capturing a signature from the cell phone's touch screen and entering additional data to the existing record.  There would need to be a way (button click) to send everything back to the web server/database.  Eventually a report of that record would need to be generated and faxed to a predefined phone number.  Now that you have an idea of what I would like to accobplish here are my questions:

Programatically Sending Fax
How to generate and send a fax from a webserver or the server upon which the webserver is running?  Is it necessary that I have a phone line/modem connection to send the fax?

Signature Capture
I imagine there would be a web form with a signature box.   A click in the box could bring up a signature window or just send focus to the webform's field where the users's pen strokes would be recorded in a png or svg file.   How would you suggest that this be done?    I found an example of a sketch program that uses HTML5 and  Canvas; is this the way to go?  Will I need to deploy an exe on the cell phone to make this happen or can I do it all on the server side?

GWT and GWT Designer
Is there anyone using AJAX and if so what tools are you using?  I am thinking about using the Google Web Toolkit and GWT Designer which is a third party IDE; any opinions?

HTML5-Canvas or other
This is a bit unrelated to the above project but is it possible to make a web page (thinking AJAX) that would allow a visitor to compose an image by selecting multiple Alpha-PNGs and overlaying them the same way Photoshoppers use layers to  build up an image.  Once completed then I would like to create a single PNG from the composite.  How would one go about implementing a thing like this?

Comentary
Any commentary, opinions, or questions are welcome.  I am interested mostly in what technology or tools would be needed and what conceptual approach would be best or easiest to implement.  Additional detail is also welcome of course. I know we have some experts lurking about so I thought I'd ask for some advice.  Thanks.   
#680
Quote
If I am going to use objects and there are multiple pages(ie Rooms) and each room would come close to the object limit.
How much would this affect performance, in other words would I have quite a bit of slowdown?
1.  Only one room is loaded into memory at a time so the number of rooms would have absolutely no effect.

2.  I wouldn't thing the number of objects would have much effect either.  You would only be tinting one object at a time right?

Quote
Would it be possible to handle the colors as Inventory items instead of a gui?
Not sure how you would do this or waht you may have in mind? 
SMF spam blocked by CleanTalk