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

#1481
I think you could do something like the following:
#define IDLE_VIEW   7
#define IDLE_DELAY  10

int IdleTmr=IDLE_DELAY;

repeatedly_execute() {
   IdleTmr--;
   if (IdleTmr<) {
      Character.SetIdleView(FIRST_VIEW+Random(5));
      IdleTmr = IDLE_DELAY;
   }
}
#1482
When you shrunk the image you the perimiter of the character was anti-aliased. From what you describe it seems likely that the character is on a white background.   If you fill the background with a different color you will be able to see what I mean.

As for your original problem, I can't say for certain what the problem is.  Go back to the original copy of your character if you still have it, otherwise you will need to manually remove the anti-aliasing.   As Pablo says, use PNG because it give much better results.   

Recheck the game's resolution and color depth settings.  Try exporting your character's images with different image settings (i.e. color depth, w/wo alpha. etc).  Let us know what happens.  Cheers.
#1483
Arrrrgh!  I've been Elvised!!  Hehe, thanks Scummy for thinking about me and thanks Squnky for putting me on to it.

Chill a little Ashen, it's Squinky's  thread after all. 
#1484
Yeah, Ive seen you lurking around every once in a while but I meant, you know actually doing AGS stuff.
#1485
The OO versin of the script language has added a number of new reserved words such as "object" etc.    So if these reserved words are used in the script to be upgraded as variable or function names the compiler will report errors.   This is easily fixed by renaming the ofending variables and functions.

The latest beta has added enhanced string support.   The keyword "const" has been added to maintain compatibility with the old style string handling.  As I understand in some instance it may be necessary to add this keyword to function declarations expecting old style string parameters.

There is a check box in the main Game Settings, similar to "enforce strick OO", that if left unchecked will allow the old vesion of the script language to compile. 

If you give it a try just be sure to make a good backup of your game.

#1486
Hey there! Mr Big Stuff   ;)... Good to see you back man.    Thought maybe you and Snake might of got sent up the river for do'in that Sanchez job  :P.   

Anyway Squinky the AGS script language has grown up last spring and now sports many OO features.   Probably the best way to get up to speed is to download the demo.  You can get it from the AGS website or from this thread.   There are pretty good examples of how to use the new language features there.  Also note that the different GUI examples are now implemented as mini-games (i.e. seperate games that are called up using the RunAGSGame() mechanism).   You can also ask Rui which templates he has on Skimbleshanks are updated.   

DemoQuest is currently built with AGS V2.70.  The newest beta has some new string support and other nifty things and is pretty stable.  I don't know if the demo game will compile under the latest beta though.  I think perhaps some of the string things may break when comopileing under the newest beta.

Good luck and good to see you back Squinky....

Cheers
Rick 

#1487
I'm with SSH on this one.  In general I prefer not using the interaction editor whenever possible.   Perhaps at some point in the future the script language could be extended so that interactions could be defined in the room script.  The new OO way of things presents some interesting posibilities for this and perhaps interaction functions could have useful names such as...

Object.LookAt()
Room.PlayerLeaves()
Room.RepeatedlyExecute()
:
etc

The interaction editor or the script editor could then be used to define/modify such interaction functions.

I realize this probably won't make the cut for RC2  :=, but it's something interesting to consider for the future, IMHO.   
#1488
CUrly braces,  "{}", are used to delineate blocks or groups of code.  The are normally used with if, while, and function statements.  So for every opening brace "{" there must be a corresponding closing brace "}".   Such code blocks may be nested so that there are blocks within blocks.

From the text of your  eror message it is likely that you have more closing braces "}" than opening braces. 

These kinds of errors can be very difficult and time consuming to locate because as dkh points out the line which the compiler complains about is seldom the actual culprit.  For example, In you case, the closing brace "}" on line 55 is probably correct and the problem is that you are missing an opening brace on a prior line.   For this reason it is important to keep a good discipline of indenting code blocks.

There is a nifty feature in the script editor that allows you to find matching braces.  Simply place the cursor just befor the opening brace and press ctrl-B and the cursor will be positioned over the matching closing brace.

Review your code from the beginning of the global script to see where you are missing an opening brace.  You are missing one somewhere befor line 55 where the error occurs.  If you can't find it post the first 55 lines of your global script here.  Use the [ pre ],[ /pre ] tags when posting.
#1489
You may want to give GraphicsGale a try.  It features a preview window to view the animation, frames, and layers.  It allows an animation to be exported/impoirted as individual images making it ideal for AGS IMHO.   It's weakness lies in it's lack some of the more advanced painting features.
#1490
Open the first room in the AGS editor.  Open the interaction editor and create a "Player Enters Room  After Fadein" interaction" to run a script.  Open the script editor and place your script there inside the inteaction function you just created. For example:

function room_c() {
   // Player Enters Room After Fadin
   player.Say("This...");
   player.Say("That..");
   Wait(50);
   player.Move(...);
   player.Say("The other thing...");
}
#1491
I don't believe you can just cut and paste GUI event handlers like that.  AGS probably expects to find that function in the global script where it created it.   What I would suggest is that you call a module function from the button click handler function.

There was a discussion a while back about how to create modules for public consumption.   The goal is that modules from multiple authors should be able to work together.    You can find that discussion here:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=18989.msg231569#msg231569

You may also find these documents useful as well.  They aren't tutorials per se but they should be helpful.   

#1492
I would find them very useful as well.     
#1493
Quote
Perhaps the best way to rid the world of all these stereotypes and prejudices would be simply not to bring them to people's attention. That way, children would not be influenced by prejudice and would grow up continuing to simply see everybody else as human beings.
To me CJ's conclusion is just common sense.   My wife is from Bolivia and has a southern European complection or perhaps a little darker.   She  is quite capable of dealing with (and pretty much immune to) people who are explicitly racist towards her.   What really bothers her are well meaning, patronizing indivduals who subscribe to a "liberal political philosphy (US context)".   This kind of racism is just below the surface and insiduous.   When confronted, individuals who practice this, quickly hide behind their politics.  I know it really bothers her when people underestimate her or are patronizing.   

I think people should be creative and use whatever characters they concieve of or think will fit the story.  Artificially inserting ethnic characters into a story, IMHO, is patronizing at best.   

So you may ask why I gratuitously used a dark skinned girl for the main character of the new DemoQuest?    Well it didn't have anything to do with race or anything like that.  While surfing the forums one day I say this beautiful character drawn by a relatively new AGS member, Pttr.   I PMed him that his character was beautiful and asked if he would be willing to make a character for the new DemoQuest.   He said that he would and asked if I wanted to use the charcter that I liked so much.  I told him that would be fine and the rest is history (more or less).   

The bottom line:  It turned out the way it did because I found someone, Pttr, who would do character sprites and I really liked a prior pic done by Pttr.  Since Pttr already had some work done and had a vision this was the easiest thing to do.  Here is a poster with the original picture done by Pttr.



#1494
I think it would be ok to release beta to the website.   I think the script examples are pretty much complete, so Yeah, go ahead and make it available for everyone to use.   
#1495
Quote from: [lgm] on Sat 30/07/2005 17:25:51
1 kg? Didn't I tell you to leave your bricks at home!?
Hehehehe! I know you're being sarcastice but one of my colleagues actually did this.    I was working an automation project in the south of France (poor me ;)).  We were sitting around sipping wine one evening.  One of my colleagues, Don, is married to a local Frence girl he had met many years before while working on a similar project.  Don worked on many overseas projects over the years while my other colleague John and I were new at this.   I was single but John had brought his wife and kids along.     At that time our company would allow you to ship 1500 lbs of stuff over to setup houskeeping and would add 20% to that for the trip back (presumably so you could keep any aquisitions you made during the project).  Don was explaining this to John and I while Don's and John's wives were standing nearby listening to our conversation.   John said, wow 20% extra on the way back that's a good bit.   When Don's wife suddenly broke in the conversation with a red face and angry voice "Yeah! It is unless your idot husband buys a brick pizza oven.".   

John has a dry sense of humor and so he asks "So Don, You bought a brick pizza oven?"   Don says "Yeah man it's great. I'm gonna put it my back yard."  John then says "Oh yeah. But how are you going to get it home?` How do you ship a brick oven?".   

I thought this was a good question because I wondered how they would keep it from falling apart during shipment.   Now here is the point where I am about to spit a mouth full of wine over the balcony and nearly passout from laughing.  Don says "It's ok John, it's a kit."   
 
Anyway Kinoko, have a good time in Japan, just don't bring back a brick pizza oven, even if it in kit form.  ;)   I'm looking forward to hearing about your experiences there; I hope you let us know how it's going from time to time.   




#1496
The compiler copies the header into each room script and the global script whenever it runs.   In this casewhenever a change is made to the header then every room script would have to be recompiled.    This is the reason it is not recommended.   
#1497
Quote
I'm using properties for my inventory to have some base stats to my items. If I leave a number property blank, AGS 2.71 Beta 3 keeps filling it in with this number: -2147483648
Well a number must have a valid value and "blank" isn't a valid numeric value is it.  So you will have to pick a valid value and make that the default.   A value of "-2147483648" is the largest negative number that can be represented by an int variable, I believe.  Since apparently you haven't specified a default value, presumably AGS uses "-2147483648" as the default value.
#1498
Try doing somethoing like this:

StrFormat(ScoreString,"%06d%06d", millionsscore, unitsscore);

#1499
Well, if it's just to keep track of a score you could script it yourself using a pair of ints or a char array.     
#1500
I would make the rocket an object.  Crop all of your sprites so that they are just big enough to hold the rocket.  Import the sprites and then make a VROCKET view.  You can put 20 frames in one loop so if you do that your 40 frames will fill up 2 loops.

Next put something like the following in the room script.   Call InitRocket from the "First Time Player Enters Screen"  interaction to start the animation.  Work out what they should be for each frame and modify the InitRocket() function accordingly.  You will probably have to get the x,y positions by trial and error, unfortunately.   

You can modify FRAME_DELAY to adjust the animation speed to your liking.  The DQCycle mini-game, that's part of the current version of DemoQuest, uses a similar technique to animate the destination objects as the player gets closer to the end of the race course.
// Room Script 

#define FRAME_DELAY 10
#define MAX_FARMES  40

struct rocket {
   int x;
   int y;
};
rocket Rocket[MAX_FRAMES];

int Frame=0, Loop=0, RawFrame=0, Delay=FRAME_DELAY;

function InitRocket() {         // Call from "First Time Enters Screen" 
   int i=0;

   // Initialize frame positions
   Rocket.x =                     // Frame-0 position 
   Rocket.y =                    
   i++;
   Rocket.x =                     // Frame-1 position 
   Rocket.y = 
   :
   Rocket.x =                    // Frame-MAX_FRAMES position 
   Rocket.y = 
   i++;
}

function AnimateRocket() {  // Call from Repeatedly Execute
   int frame, loop;

   // Calculate delay between frames
   if (Delay>0) Delay--;
   else {
      // Reset delay
      Delay = FRAME_DELAY;

      // Increment to next frame
      if (RawFrame<MAX_FRAMES) {  // until animation is complete
         RawFrame++;
         if (Frame>=20) {           // Put 20 frames in each loop
            Frame = 0;
            Loop++;
         }
         else Frame++;

         // Set rocket's frame and position
         cRocket.SetView(VROCKET,Loop,Frame);
         cRocket.SetPosition(Rocket[RawFrame].x,Rocket[RawFrame].y);
      }
   }
}
   

SMF spam blocked by CleanTalk