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

#1261
You could try running some newspaper ads in the town where she last lived.   Rent a mail box so that you don't bring every freak in the UK to your doorstep.  Failing that, hire an investigator.   A good one could porbably find her in an afternoon.   
#1262
Quote
I do not know what to do with this code snip ??
What does a star mean? How do I declare, define, adjust my function??
The star '*' means that the variable is a pointer.    In this case it is a pointer to the overlay.   You can think of the overlay as consisting of several variables, such as font, color, width, text, etc.    In general when you define  "Overlay *TextOverlay;"  then you can use things like "TextOverlay.Font=1" to access these different variables.   These variables can be published in which case you can access them otherwise they are private and hidden from you.  Sometimes you can just acces them as a variable and sometimes you need to use a function to access them as in "TextOverlay.SetText("Hello");.

Quote
Any help would be greatly appreciated since I have stumbled over this before.
I was quite fluent in the old script, but now I get confused over and over again....
But I'll learn how to overcome  :-P
It will take a little getting used to but in the long runn you will realize that the new way is much simpler.  I have taken the liberty of converting the code snippet to AGS 2.72 but I haven't had a chance to test it, so there is a good chance of bugs. 

Code: ags

Overlay *TypeLine(String line, int vspacing){
 
   int length=0;
   int i = 0;
   String displayedline;
   int textid = 0;
   Overlay* textoverlay;

  length = 0; 
  i=0;
  displayedline = " ";
 
   textoverlay = Overlay.CreateTextual(xpos,50,400,font,color,displayedline);

   length = line.Length;  //set string length
   while(i<length){
   
       displayedline = displayedline.AppendChar(line.Chars[i]));
       SetTextOverlay(textid, 10,vspacing,400, font, colour, displayedline);
       myoverlay.SetText(400,font,colour,displayedline);

      if line.Chars[i]== ' ') {
         Wait(10);
      }
      else{
         PlaySound(1);
         Wait(5);
      }
      i++;
   }
   return textoverlay;
}


The function used to return the overlay's numerical id but now it returns a pointer to the overlay.  I'm guessing that there is a RemoveOverlay() function elsewhere in your script.  So what you would do there is  something like this.

Code: ags

// At the top of the script
Overlay *textoverlay;
:
// Somewhere in your script
textoverlay = TypeLine(String line, int vspacing);
:
// Somewhere else in the script
textoverlay.RemoveOverlay();


Try this out and let me know if it works for you.  If not I'llwork on it more tomorrow.

Cheers
RickJl
#1263
In the case where a main game hase several mini-games then the save game space is shared.  It's necessary to show the proper list of games for restore functionality depending upon which game is running.  It's not really necessary to add the optional parameters as I believe the list can be built otherwise but I thought it would be worth mentioning.   I think it would be of more benefit to novice and beginner scripters than to those of us who have a bit more experience.   I surmise this is the reason the fill function was created in the first place.

So then does FillSaveGameList list all of the save games or only the first 20 or 50.  If not then to what does the 20 save game limit refer exactly?   

#1264
I have a couple of quick listbox questions.  It seems like I must have know the answers to these at one time or another but am drawing a blank at the moment. 

  • Listbox Limits - What is currently the max number of items or characters that can be contained in a list box?  Is this documented somewhere?  I've looked in the manual under "System Limits", "Constants", and "AddItem".  Does AddItem() returnan error or null when the listbox is full? 

  • FillSaveGameList - The manual says "The save game list can only hold 20 save games. ".  Does this refer to the list that FillSaveGameList creates or something else?   I believe that this number has been increased to 50 now (Btw, manual still says 20).    I know that it's easily scriptable but perhaps FileSaveGameList should have a couple of optional parameters,  to specify the first save game slot where the list should begin and the number of save slots to include in the list?

    That's it!  Thanks..



#1265
General Discussion / Re: --NVM--WTFH?--NVM--
Sat 01/04/2006 01:03:34
Hehe, The forum looks crappy and it's hard for me to read.  Probably I'm to old or something.   :- 

[edit]
Oh, Btw you may want to have a look at this to get an idea of what's to come.
#1266
I started down that road once and abandoned it because of the extra hassel.  I may revisit that before I'm done and see what I can do using the "another GUI" technique.
#1267
It looks like to me that there is only one event being generated.  So when the mouse moves away only one of the GUI's gets signaled to close.  You could set bot of them to normal and then control them yourself, something like this:[/pre]
function repeatedly_execute() {

     // Turn on/off IconBar
     if (mouse.y<13) gIconBar.Visible = true;
     else gIconBar.Visible = false;

     // Turn on/off Statusline
     if (mouse.y<1) gStatusline.Visible = true;
     else gStatusline.Visible = false;

}[/pre]
#1268
You haven't said how you are setting the view but it is necessary to set the view by executing an instruction.  In the script you must use the following function to set the view before animating an object.

Object.SetView(int view, optional int loop, optional int frame)

I you're doing everything from the interaction editor then you must do "Objct - Set View Number" and then specify the correct veiw number in the form.

Hope this helps.
#1269
General Discussion / Re: Content advisor
Thu 30/03/2006 21:17:26
To keep the AGSishness just use the blue cup and roger color scheme's.  We could also make larger versions of the sprites and use them for inventory or other objects in the demo game?   
#1270
General Discussion / Re: Content advisor
Thu 30/03/2006 04:11:01
Quote
[joke]Maybe you think in violence because she is lesbian? Do you want to punch her? Homophobic!!![/joke] 
Hehe, No Farl, she looks like she could kick all of our butts!  ;D
#1271
General Discussion / Re: Content advisor
Wed 29/03/2006 19:08:02
Quote from: Farlander on Wed 29/03/2006 13:06:57
...And here is an alternative version for the "sex" icon that I like a lot...



Hehe, It's a better fit to replace the violence icon  ;D
#1272
I'm making a GUI module that supports multiple text input fields by dynamically sizing and positioning the textbox control over the button used to implement the field.   The problem is that whenever a new field (i.e. buton) is added to the GUI the textbox control must be deleted and then re-entered so that it overlays the field.  Otherwise it it's hidden behind the button.   

Would it be reasonsable/possible  to have the ability to set a control's z-order either at run-time or during edit, by other than the "deletion/re-entry" method?   

[edit]
I see that it's already on the tracker so I would like to add my above comments in support of this feature and perhaps bump the priority a tiny bit.   ;) 

http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=497
#1273
I'm sure there will be plenty of people willing to help you learn scripting.    The one advice I will give you at this point is to keep your script as organized and documented as possible.    To this end you should adopt some conventions for naming variables and functions and stick to it throughout your project.    There probably nearly as many programming conventions as there are programmers.   

For example I noticed that you are using the MS style of naming variables (hungarian notation?)  where an abbreviation of the data type is prepended to the descriptive part of the name.    I have a slightly different preference for naming Ags gui controls.   Ags automatically names each Gui by prepending a lower case 'g' to each Gui name.   Names given to controls are global in scope.  This means that these names must be unique and not defined anywhere else.  The way I choose to avoid having two things with the same name was to prepend the Gui's name to the control's name.   So, for example, instead of "lblStatus"  I may have used "gGuinameStatus".    Asking which one is best is a futile question, sort of like asking "Which is better a fork or spoon?".   Just pick the one you like.     

You may want to have a look at the current demo game and the programming conventions it uses.  They can be can be found here:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=23083.0

The reason I said that declaring variables within a conditional code block is not a very good practice is because doing this makes for difficult to read, difficult to debug, and error prone script.    Robust software is written to be changed and maintained over time.   Being unnecessarily clever is frowned upon, if you ever had to cleanup after a "clever programmer" you would know exactly what I mean.   Just because you can do something isn't necessarily a good reason to do it. 

I hope this is helpful to some folks.
#1274
Take a look at the RunAGSGame() function in the manual.  YOu could do just as you describe with this.  The first game you would distribute the exe file.  Subsequent installements could be distributions of .ags files.   
#1275
I believe that you could also just do this.   
Quote
if (mouse.Mode == 4) {
  lblStatus.Text = String.Format("Use %s on @OVERHOTSPOT@", player.ActiveInventory.Name);
}

Note: Also, I don't think it's a good practice to declare variables within conditional statements.  I like to do it at the beginning of the function declaration or at the top of the script.  Variables declared within a function are temporary and exist only as long as the function is executing.  Variables declared at the top of the script file remember their values permanently (even after game save/restore).

#1276
Thanks.  The first is probably more important/needed than the second item.  Your proposal for the second item sounds reasonable. 
#1277
Quote
I suggest you in the future replace "religion" with "people".
Why?  It's a direct quotation of what judge Ansarullah Mawlazezadah has said.  Are you suggesting that people ignore the man's actual comments and pretend that he has said something more to you're liking?
#1278
 ;) Yeah, that's how they work.  I brought this up a long time ago and it's in the tracker.  Anyway, what I do is use a button control for the input field.  When the button is clicked I make the text box visible, resize, and position it over the button, copy the button text to the textbox text, and erase the button text.  The textbox event handler then copies the text from the textbox back to the button and makes the textbox invisible.   With this method you can have as many input fields as you want. 
#1279
I enjoyed the last discussion about the death penalty immensly and thought I would give everyone another opportunity to opine about this new case I read about on the ABC News Website.  Click on the link to read the full story.  Here are my favorite parts:


ABUL, Afghanistan, March 22, 2006 â€" Despite the overthrow of the fundamentalist Taliban government and the presence of 22,500 U.S. troops in Afghanistan, a man who converted to Christianity is being prosecuted in Kabul, and a judge said Sunday that if convicted, he faces the death penalty.
:
:
Relatives denounced him as a convert during a custody battle over his children, and he was arrested last month. The prosecutor says Rahman was found with a Bible.
:
:
Presiding judge Ansarullah Mawlazezadah tells ABC News a medical team was checking the defendant, since the team suspects insanity caused Rahman to reject Islam.
:
:
The post-Taliban constitution recognizes Islam as Afghanistan's religion, and decrees that Islam's Sharia law applies when a case is not covered by specific legislation. The prosecutor says under Sharia law, Abdul Rahman must die.
:
:
The judge, however, holds hopes for a solution.  "We will ask him if he has changed his mind about being a Christian," Mawlazezadah says. "If he has, we will forgive him, because Islam is a religion of tolerance."
:
:

#1280
As was previously stated the manual is in th windows standard html-help format (i.e chm) and the viewer is supplied as part of windows.  There are perhaps two possibilities:

  • Corrupted Help File - Some how the chm file you have is corrupted and the help viewer can't open it.  You could try downloading it again to see if that works. 

  • Bad Help Viewer - There may be something wrong with y our help viewer.  Try to open any other chm files on your computer.  Just search for "*.chm".  You can get the MS HTML Help Workshop here: http://go.microsoft.com/fwlink/?LinkId=14188

SMF spam blocked by CleanTalk