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

#1881
Aurora,

Sorry for taking so long.  I lost this thing twice so I hope you will find it useful.  Gotta go get some sleep now.

Rick


AGS Quick Tutorial: Opening/Closing a Gate
by Rick Jafrate



INTRODUCTION
This tutorial assumes the reader has some familiarity with the operation of the AGS editor. There are other well illustrated tutroials showing how to use the various features of the editor so it makes little sense to cover the same material here in a less adequate text format.  Check the sticky posts in the beginner's forum.


SCRIPTING OVERVIEW

Scripts
A script file contains a collection of statements or instructions that are executed by the AGS Game Engine. Such statements are normally terminated by a semi-colon character, ";". In AGS there is a global script file and one room script file for each room. The global script is always active and only one room script file is active at any given time (i.e. the room script associated with the current room). The AGS scripts are very similar to the "C" programing language,  

Comments
Comments are good things :). Although they don't have any affect on the compiler or game engine they do keep us poor stupid humans out of a lot of trouble. A comment is denoted by the occurance of double slash characters "//". The "//" characters and the remaining portion of the line are ignored by the compiler and are meant purely for human consumption.  

Variables
A variable is a portion of memory that has been given a name and a data type. The name is associated with a physical memory location by th AGS compiler and/or game engine. The data type determines how much memory must be allocated to accomodate the kind of data to be stored here. The most commonly used data types are string, and int.  A string variable is used to store text and an int variable is used to store numeric/integer values. Variables are defined in a script file by first entring th data type followed by the name as follows:  
   int MyVar;


Functions
A function is a container for script statements (or instructions).  Such statements consist of basic constructs such as if/else, assignemnts, integer arithmetic, and calls to other functions. Note: Math is evaluated from right to left in AGS and sometimes produces unexpected results. Functions must be defined before they are used. There are a number of functions that are pre-defined by AGS and are explained in the help document.  Functions return data, by default they return int data.  Because of this they can be used like variables. An example function is defined below that doubles a value and returns the result.
   // This function doubles the value and returns th result
   // The first line defines the name of the function and
   // the parameters that is uses.  In this case DoubleIt 
   // is the function name. It requires one parameter which 
   // is an integer named value.  The curly braces {} are
   // used to enclose the functions contnts.
   function DoubleIt(int value) {

      // Create a variable in which to store th result 
      int temp;

      // Calculate result
      temp = value + value;

      // Return the result
      return temp;
   }
 


Events
The AGS Game Engine executes scripts in response to the player's interactions with the game.  Programmers refer to such interactions as events.  Programs that are executed when an event occurs are referred to as event handlers.
   // Within the bounds of a subsequent event handler function 
   // in the same script file the DoubleIt() function could be 
   // used as follows:

   function room_a() {
      // AGS interaction triggers this function to execute
      Myvar = DoubleIt(10);  // Set MyVar equal to 20
   }


Interaction Editor
Event handler functions are created using the AGS interaction editor.  Select the desired interaction and then click on "Run Script" from the drop menu to create an event handler function.  The function name will be automatically assigned so don't modify the name or definition of such functions.

continued ...
#1882
Hey Squinker,

Object:
You need to use SetObjectViiew() or SetObjectFrame() before you use AnimateObject() or AnimateObjectEx().

Character:
Set the last parameter of AnimateCharacter(), repeat, to a value of 1.  From help:

If REPEAT is zero, the animation will start from the first frame of LOOP, and go through each frame in turn until the last frame, where it will stop. If REPEAT is 1, when the last frame is reached, it will go back to the first frame and start over again with the animation.
#1883
Somewhere on their web page they talk about that.  They said they considered Spock, Kirck, etc to be classic characters in the same sense as are  Hamlet and the like.  They said they wanted to continue the original story and so didn't want to invent new characters.  They also wanted to avoid cheap parodies of the original actors but rather wanted new actors to give their portrails of the characters.  

After awhile I got in to it, except that Kirck sometimes reminded me of Jim Carey.    All in all I thought they did a respectable job seeing as how it was pretty much a volunteer, non-profit effort.  

In any case it's something a Trek collector would probably want to have, IMHO.


P.S. Actually the girl playing Uhura does a pretty decent job of it.  I can't say about Rand because I can't place the character (I remember the name though) in the original series so I have no comment about her for now.
#1884
You need to creat multiple walkable areas.  Disable the walkable area under the gate when it is closed.  Enable it when the gate is open.

[edit]
I just composed a lengthly explanation to add to the above and I just lost it to the big bit bucket in the sky.   I need to go to work just now but I will post a detailed explanation tonight.  Sorry
[/edit]
#1885
You need to creat multiple walkable areas.  Disable the walkable area under the gate when it is closed.  Enable it when the gate is open.
#1886
If you are a Star trek fan you may want to check this out!!! A fan made internet series.....



http://www.5yearmission.com/
#1887
General Discussion / Re:VoIP Phone Service
Thu 19/02/2004 21:43:48
That would be true for the totally free services but if you look closer at Rhino Bell and Zip Global they allow you to call any phone on the regular phone system at pretty good rates ($0.027 - $0.015 / min).    If both parites have access to high speed internet then you really don't need to pay anything for a service provider.
#1888
The problem, demetri, is that it's possible to make a game with AGS without doing any programming at all.  On the other hand, AGS has a very powerful scripting language, a subset of C, makes it possible to do all kinds of sophisticated programming.  

I think AGS would be a good choice for your project provided that you understand your course's rquirements and that you do enough programming to meet those requirements.  

If you need examples of the kind of programming you can do with AGS you can search the Tech and Tech Archiv forums or follow the link in my sig below to the BlueGui open source AGS GUI.  

Good luck with your project...
 

#1889
General Discussion / Re:VoIP Phone Service
Thu 19/02/2004 17:05:06
My pleasure Rode....

You may want to do Google on "VoIP Phone Service"  because you may find better deals for Europe as I wasn't  specifically focused on that.  

Let us know what you comew up with and how it works out.

Cheers
Rick
#1890
General Discussion / Re:VoIP Phone Service
Wed 18/02/2004 07:53:47
Rode,  Here are some other options for calling Europe and other international numbers:

#1891
General Discussion / Re:Squinky under trial
Mon 16/02/2004 23:25:07
Raggit,

Man, I had the same dream! Weird!  From what I can remember,  Squinky was charged with "Promissing to finish Fry-2 and not working on it".  We found him guilty and banned him from wearing clothes.   He started looking like Trap after he took off his clothes.   Then Squinky heard about all those same sex marriages in San Francisco and rushed down there to marry himself.   When he saw Yufster hanging on the outside of a 747 he changed his mind and went back to living happily ever after in Idaho.  

Man what a strange dream you had Raggit.   I hope Squinky doesn't get offfended. ;D

#1892
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) ?
#1893
Hi Timosity,

Great idea!  Thanks for your efforts.  
#1894
You can do something with global structures (i.e. strct) as follows:

Global Script
// Create a custom data type  consisting of AGS built-in data types
struct  CHAR_DEF
{
int  strength;
int  intelligence;
int  whatever;
int  weapon[100];
}

// Declare a variable array named "Character" of type CHAR_DEF defined above.
// Note that variable names are case sensitive so "Character" is a different variable
// than the built-in AGS variable "character".   An array is used so that there will be
// one  array element for each character.  Each element will contain strength,
// intelligence, whatever, and weapons.  The weapons element is also an array.

// Declare variable
CHAR_DEF Character[150];

// Export variable so it can be used globally
export Character;

// I am not exactly sure about the  syntax and I am at work right now, so I can't test
// it out to be sure.  Structs are not an official feature so they may not be in the
// manual.  Perhaps some others who are familiar with them can correct my syntax.


Script Header
// Import variable so it can be used globally
import Character;


Room Script
// Any interaction function
function room_b() {

int room;
int intelligence = 100;
int strength = 50;

// Get the current room number
room = character[EGO].room;

// Initialize extra character attributes
Character[EGO].intelligence = intelligence;
Character[EGO].strength = strength;
Character[EGO].whatever = 0;
Character[EGO].weapon[20] = 100;
Character[EGO].weapon[2] = 100;
}

I think this is what you are looking for.  The custom properties, I think, are more static and are more or less meant to be changed at design time via AGSEDIT.

Hope this is helpful

Cheers
Rick
#1895
Kinoko:  I agree with you about the blue cup 100%.

MillsJROSS:  Hehe.. The plot we have so far is intertwined with that kind of concept.  

Pessi:  The script will be well documented (perhaps overly sometimes) to explain what's going on.  The more advance stuff will be peeled off as seperate mini-games that can be run independently or via RunAGSGame() from the main game.

Klitos:  The plot also includes the steaing of source code (by the bad guys of course).

Petteri:  By all means come back and take a look.  I think you will like how eveything has progressed so far.  We'd love to have you do a couple backgrounds for us.  

[edit]
P.S. Although there is a long list of credits in my post above, as CJ says, people loose interest quickly so there is only a few of us doing most of the work.  So if anyone has  a little desire to get involved please don't be intimidated or think that there are already too many.  Jimi and ZZjZmoz     are newbies but have  contibuted quite a lot to the project.  

#1896
Just to expand upon a few of CJ's observations.

Quote
Yes, I'd agree. This kind of comes back to the whole issue of the demo game again - I think there was a team who were going to take on the demo game, lead by Joseph DiPerla, but I'm not sure what happened to that.
I setup a forum, ftp, and development area to for this project just before mom got sick.     A number of folks contributed to the forum discussions and Peteri (drew a few sketches).  JD never showed up and eventually everyone quit.  Mom got better and I finished the contract I didn't think I could do and recruited a new team who is hard at work as we speak.    

We are hoping to surprise CJ with a private demo, in the near future, for his comment/review/approval before announcing in the forums.

Quote
I think we really need to consider what the purpose of the demo game is.
....

Originally, it was to demonstrate what an AGS-made game was like. However, as MrColossal notes that purpose is no longer necessary, since there are loads of real games that do a much better job.  

....

Therefore, I think the demo needs to be re-focussed to serve as an open-source repository for how to do things - much as the Games Factory part of the current demo does.
This is something similar to our current plan as below.  I hope this fits in with what you have in mind.

1.  The current demo has the problem of having too much stuff in it making the gloabl and other scripts look complicated.  Also it is annoying to have to play through the game to find a demo of something you would like to study or replicate.  So our plan is to split the demo up into modular self contained parts and to use RunAGSGame() as a means of stitching them together.   This would result in a main game demo and a number of modular parts that can be run independently or via game play in the main demo.  

2.  With #1 above in mind we have decided to re-make the original demo into a small-medium adventure with humorous plot, story, etc. The game play would be a metaphor for what we do here on theforums and with AGS everyday and would intoduce newcommers to our little community.  

3. The programming will progress from no scirpting to more complicated techinques as the player progress through the game.   Scripts will be well documented and reviewed so as not to pass on any bad practices.  

4.  Things such as Arcades, alternative GUI's, etc are be to be implemented in seperate mini-games.  It will be possible to launch these mini-games independently or from the main demo.  The main purpose of  the mini-games is to  "serve as an open-source repository for how to do things", while the main purpose of the main demo is to show how much fun we game makers have and how cool AGS is.  


============================================================

If anyone else wishes to participate just sign up to the BluSoft forum and PM me that you wish to work on the new Demo Quest.  

Blusoft Forum - http://www.gaia-spa.com/cgi-bin/blusoft/YaBB.cgi

Here are the people who have helped out so far.  I would like to thank everyone who has made a contribution.  If I have left anyone out please forgive me and PM me so I may correct myself.

Developers
  • Damien (Damien) - Zagreb, Croatia
  • Nick Keane  (ZZjZmoz)
  • Till Winegartner (Totoro)
  • Petter Bergmar (pttr) - Stockholm, Sweden
  • Dan Jones (Jimi)
  • Allan Menefee  (Hollister_Man), Hollister CA - USA
  • Peter (agsking)
  • Richard Jafrate (RickJ), Spokane WA - USA

    Contributors
  • Anthony Hahn (Cornjob)
  • Petteri Aartolahti (Petteri A)

    Special Thanks
  • Joseph Diperla (Joseph Diperla)
  • Miguel
  • Mikko Paajanen (Mikko)
  • Jetxl
  • David Scott (scotch)
  • Barry Craig (Quikstrike)

    =========================================
    Please bear with me as I will not have internet access until monday when I return to work.  It seems my wife Silvia bought a house while I was away on Christmas vacation;  we're moved in but I am building a huge computer room in the basement so I will be out of business internet wise for a while.

    P.S.  The main character is a girl so we could really use a female consultant to keep us out of trouble. :)
#1897
Use the SetLabelTest(...) function.  See online help for more details.  

-----Edited to say Text, not Test
Use the SetLabelText(...) function.  See online help for more details.  
#1898
I think CJ asks the right question:
Quote
Bring this up raises a good point though - with it rapidly approaching 300 games, is the games page now becoming a bit unwieldy; and if so, what should we do about it?

One way to do this would be to implement an advanced search feature that would allow searches based on overall rating, downloads, keywords (i.e. some of the new category sugestions) and also the LSV rating.   Maybe make the keyword list moderated so that it doesn't become useless and is easy to use.  

I would also like to have a keyword or new category for open source games and other resources.  Maybe there could be a "Resources" page that is simliar to but seperate from the games page.   I know there is a "Resources" page already but it's kind of static and is not an adequate link to the many resources people have made available for would be developers.  What I am suggesting would be in addition to the existing resources page or could be made part of the games page.   What I am suggesting is a resources page where peole could make their own submissions the same way we do for completed games.    Oh well enough of ranting here :)
#1899
Quote
...
Thank You. Billy 'Smiles' Evans, The boy with just a head.
... and a burlap sack for a body.

Dear Billy,

Take my advice and quit while you're ahead  :D
#1900
murray:  Just do as TK suggests.  The reason you are getting a warning is that the screen will stay black until after the wait() statement is complete, which is probably b\not what you want.

assination:  I am not certain but I think in the latest AGS you can delete unwanted GUIs.   In versions where the delete function isn't present just delete the GUI objects and leave a blank GUI.  It doesn't hurt anything or take up more than a few bytes of memory.  Likely you will end up using it for something anyway.

SMF spam blocked by CleanTalk