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

#1601
I agree there is little advantage in returning a string and that hadn't even occured to me.   I was, of course, thinking it would return an enum such as eListBox, eButton, etc.  I'm sorry if I wasn't clear about that.

Hehe, But now that I see your example it is clearly the same thing I would have done with a ControlType property.  There would be no advantage in that either.  What could I have been thinking?  As Homer Simpson would say "Doh!".   :-[

Cheers
#1602
In AGS 2.7 you can set the selected text and background colors, so yes this is easily done in the next version AGS.   
#1603
General Discussion / Re: Telephone Madness
Thu 10/03/2005 16:36:21
Hehe, I used to get wrong numbers when I lived with my parents all the time.  If they were polite I was too, even though it was annoying.   This one time some chick called up and asked for Bob, who I suppose was her boyfriend.  When I told her that Bob wasn't there she argued with me about it.  The conversation ended up sounding like that old Cheech and Chong routine (Chong: "Who's there?", Cheech: "It's me Dave.", Chong:  "Dave's not here." ....).  Finally she got really pissed and almost in tears said "Humph, you just don't wantr me to talk to Bob.". 

A car insurance telemarketer called my brother-in-law asked him to listen before he said anything.  My brother-in-law tried to break into the sales pitch several times but wasn't abl;e to get a word in.  At the end of the pitch the salesman asked "Well what do you think?".  My brother-in-law said "Sounds like a great deal.  When I get a car I'll be sure and look you up.".

Quote
I actually get quite annoyed at people who do their best to torment telemarketers. ... Most likely, the seller at the other end of the phone is working on commission, and not making very much. How hard is it to say "Thanks, but I'm not interested. Have a nice day!" and hang up?
I'm sorry Snarky, but , I think telemarketers deserve whatever they get.  Telemarketers aren't the only people who have jobs and/or other responsibilities.  How would you like to get 20 calls at 3:00 AM everyday?  Can you honestly say that you would wake-up for each call and politely say  "Thanks, but I'm not interested. Have a nice day!" and hang up?".   

We have a simple rule in our house, if a caller won't  identify himself, the company he works for, the company who he is representing, and phone numbers where he , his company, can his client company can be reached,  then he has no business intruding in my home.   

The next time you get a telemarketer,  try asking him/her their name and number, the name of their company, where the company is incorporated, the names of the company's principles, and an address where  they can take service, to see what happens.  This is all information you would need to file a lawsuit.   It identifies who is accountable for any bussiness you may conduct with telemarketer.   I have yet to find a telemarketer who will give up such information.   Why would anyone conduct business with an annomous party?  "Hey man send me $100 and I'll send you a brand new Porsch!". 

When this one guy finally told me he didn't know anything, I asked to talk to his manager.  He told me he didn't know who that was. Do you think it was polite of him to lie to me like that?

I'll leave you all with some of my father's philosophy on phone etiquitte:  "I'm not going to break my neck to answer that phone!  If it's important they'll call again...".   Hehe, and it drives my wife nuts when I am too busy to answer the phone, which is usually.   

Cheers
   




#1604
I guess you could do that by walking through each of the possibilities and testring for null.  Not quit as clean as having a property though.   
#1605
I recently came across the need to determine what kind of control, to which a GUIcontrol pointer points, while trying out the new V2.7 GUI stuff.   

I am making a generic GUI click handler where I pass the control pointer and mouse button to the handler.  To handle the click it's necessary to extract text from the control, however, it is necessary to know what kind of control it is.  For example, you would use GetText if it were a button and GetItemText if it were a listbox.

So I wonder if it would be reasonable to add a ControlType property to GUI controls in some future version of AGS?

#1606
Quote
Well, my point was that I have very little to put on my resume other than 4 years of Japanese. Japan is where I'll be finishing up my Japanese language skills and also getting long-term job experience teaching (well, long-term for me). The only other skills I have to offer right now are my personality. I can't say I have any decent sales experience or... anything really.
When I downloaded your game. I visited your website and was quite impressed with what you have done there.  If you haven't made mention of this on your resume you are selling yourself short IMHO.   Not only do you have creative and unique skills you have also put them to use. 

Have you considered marketing your artistic skills say to advertising, web design/hosting firms, or anything else to which you could apply those skills?   Or if you insist on starting at a minimum wage job, how about something like a copy or print shop? 

Anyway, I want to wish you good luck on your job search. 

Best Regrads
#1607
Quote
Hello, I downloaded AGS last month...
Welcome  ...

Quote
¿I had to post ALL the message or with the numbers is enough? Because in the rules says i must post the ENTIRE message.
I think you can just "Please note down the numbers above, and what you were doing when this error ocurred."

CJ. the author of AGS can use the numbers to know which part of the AGS programing was running when the problem occured.  The explanation of what you were doing helps to know why the problem may have occured and is important.

Quote
Sorry if my English is too bad but I speak Spanish  :).
No problem.   Tu english es mui bueno y mi espanol es mui malo.  :-[

Quote
Another question: What is "l33tsp34k"?. In the Forum's rules says that we must not use it but I don't know what is it.
I think some people try to be cute or lazy and instead of typing "for you" they would type "4U" instead.   So this "l33tsp34k" is an extreme example of that and the reason for the rule is than no-one knows what it means. 

Quote
If somebody can help me with that I thank so much.
In addition to what Goot said you may have a corrupted game file or may have accidentally deleted a required file from the game directory.  Try doing what Goot suggests.  Start over if necessary.   It's always a good idea to backup the files in the game directory often.  I use Winzip to save a copy of all the files in the game directory.  That way if I ever have a problem like this I can recover nearly all of my work.   

Let us know how it turns out for you and if you are still having problems.
#1608
Btw,  I have started using the new GUI stuff with a companion module and it's working out very well.   It takes a little getting used to ... I think because of being familiar with the old way rather than having difficulty understand the new one.   I am really enjoying working with the new stuff.

I know this was previusly requested and noted but I would like to briefly mention it again in light of my recent experiences.  In doing the above work it quickly became apparent that both gui and companion module must travel toghter.  Having a way of combining a module and one or more GUIs into a single exportable/importable would be really cool and useful IMHO.  So I am hopeful something like this can make it's way in to some future version of AGS. 

Anyway, I just wanted to let you know how much fun I am having  :D

Cheers
Rick
#1609
Quote
I just tried this out and the button text was re-centered correctly when I changed the width. Can you provide an example where it doesn't work?
Here is a code snippet where I was trying to modify button width depending upon how wid the text is.  Previously I was calculating a width but in light of your response I tried just setting it to a constant value (i.e. thinking that I may have calculating crap).  So I still get the same behavior.  I am using a the control index/pointer/casting thing so I wonder if that has something to do with it?   

I still have this gut wrenching feeling that it is I who is in error rather than the engine.  Anyway here is the code snippet and a  zip file of the whole thing in case you need it.
//-------------------------------------------------------------------
   function show_menu(string widget) {
//
//    External References:
//    gMenu - Main menu bar containing buttons as menu items.
//-------------------------------------------------------------------
   int wid, iid, event;
   GUIControl *gui_element;
   
   string item;
   string action;
   
   // Find the specified widget
   wid = 0;
   while (wid<WinBlu_MAXWIDGETS) {
      if (StrCaseComp(widget, Widget[wid].Name)==0) {
         iid = 0;
         while (iid<WinBlu_MAXITEMS) {
            gui_element = gMenu.Controls[iid];  
            if (gui_element==null) {     // No more menu slots available
               iid = WinBlu_MAXITEMS;
            }
            else {                       // OK found a menu slot
               event = get_item(wid, iid, item,  action);
               if (event==WinBlu_NULL) {
                  gui_element.AsButton.Visible = false; 
                  gui_element.AsButton.SetText("");
               }
               else {
                  gui_element.AsButton.Visible = true; 
                  gui_element.AsButton.SetText(item);  

                 // Button width was originally 25 in editor.  
                 // Text is not centered correctly after change
                  gui_element.AsButton.Width = 18;     
                                                                      
               }
            }
            iid++;
         }
         return true;
      }
      wid++; 
   }
   return false;
}
#1610
Ok, I think I see what you want.  Try using an array variable to hold the key translations.  An array variable contains multiple values that are accessed via an index.   So in the example below the keycodes of the actual keys are used as the index and the corresponding array values are the assigned keycodes.   

Hope this is helpful.  If there is something you don't understand just ask.

//===========================================
//  Custom Keycode Assignment 
//-----------------------------------------------------------------------------

// Define the maximum number of keycodes that can be recieved 
// from the keyboard.  Check AGS manual to be sure number is 
// large enough??
#define MAXKEYS 256

// Array that contains key translations.  Actual keycodes are used as the index
// and the assigned keycodes are the values.
int KeyTrans[MAXKEYS];

// This function makes default keycode assignments.  So initially keysare assigned to themselves by default.
function KeyTrans_Init() {
   in i;

   // Make default key assignments
   i = 0;
   while (i<MAXKEYS) {
      KeyTrans = i;
      i++;
   }   
}

// This function assigns a different keycode to a key
function KeyTrans_Assign(int key, int code) {

   // Assign a different code to the specified key
   KeyTrans[key] = code;
}

// This function decodes a key press and returns the assigned codedifferent keycode to a key
function KeyTrans_Code(int key) {

   // Decode key press and return assigned code
   return KeyTrans[key];
}

//===========================================
//  AGS Standard Events
//-----------------------------------------------------------------------------
function game_start() {

   // Make default key assignements
   KeyTrans_Init();  
}

function  on_key_press(int keycode) {
   int keyx;

   // Get key assignment
   keyx = KeyTrans_Code(keycode);
  
   // Decode keyx and do action
   if (keyx==0) {
   }
   else if (keyx==1) {
   }
   :
}

function some_gui_handler() {
   
   // Key assignment GUI handler
   // Gui allows user to specify key and code "somehow?"
   // Then the assignment is made as follows
   KeyTrans_Assign(key,code);
}

#1611
Question about Button.Width ??

It appears that if I change a GUI button's width at runtime the button text retains it's old position instead of being recentered on the button's new extent.  Should Button.Width be read only, should the text be re-centered, or is all as intended?
#1612
Well why not just ask that AGS support MNG files as it does GIF files?

http://www.libpng.org/pub/mng/
#1613
1.  You calculate the annimation delay coirrectly bu you don't give the engine to carry out the AnimateObject() instruction.  The delay means how many executions of the game engine to leave between frames of the animation.   So you keep recalculating this delay every execution of the engine so it doesn't work.  Try this instead:
   // script for room: Repeatedly execute
   if (IsObjectAnimating (0)==0) { 
      a=Random(30);
      AnimateObject(0,1,a,0);
   }


The second problem I see is that I am not sure that GetObjectGraphic() returns the the graphic of the current frame in an animation.  I may be wrong, but it's my guess is that it returns the graphic assigned in the AGS editor.   So my solution would be to do the whole thing like this:
// Room Script
#define LIGHTBULB_VIEW 10
#define LIGHTBULB_LOOP  0
#define LIGHTBULB_FRAMES 5
#define LIGHTBULB_MAX  100
#define LIGHTBULB_MIN -100

int LightBulbFrame=0;
int LightBulbDelay=0;
int LightBulbTime=0;

function LightBulbAnimation() {
   int light_level;

   if (LightBulbTime<=0) {
      LightBulbTime = LightBulbDelay;
      LightBulbFrame++;
      if (LightBulbFrame>LIGHTBULB_FRAMES) {
         LightBulbFrame = 0;
      }
      else {
         LightBulbDelay = Random(30)+1;
         SetObjectFrame (0, LIGHTBULB_VIEW, LIGHTBULB_LOOP, LightBulbFrame);
         light_level = (((LIGHTBULB_MAX-LIGHTBULB_MIN)*LightBulbFrame)/LIGHTBULB_FRAMES)+LIGHTBULB_MIN;
         SetAreaLightLevel(1,light_level);
      }
   }
   else {
      LightBulbTime--;
   }
}

// Repeatedly Execute
function room_a() {
   LightBulbAnimation()
}


3.  You can declare variables outside the bounds of functions.  Such variables retain their value for the session.   Variables declared within the bounds of a function only retain their values during the execution of the function.  The next time the function is called the values of such variables are not retained.  Executable statements can't be putside the bounds of a function because they will never be executed. 

#1614
Rui, you're website is frozen.... :o ... give me chills ...
#1615
  • Learn how to write AGS Script language programs.

  • Do a requirements analysis of the game you wish to make an enumerate the kinds of game elements that will be needed.

  • Experiment to see if all of the elements of your game can be implemented in AGS and to learn how to do it.

  • Design the game

  • Implement the game

  • Test the game

  • Publish the game

#1616
Yes.  Keep in mind that AGS is optimised for adventure type games and the more you deviate from that genre the more scripting you will need to do.
#1617
Quote
Script names can now contain the digit 0-9 after the first character.
Was this intended to include GUI buttons as well?  Still can't use "gMenu0..gMenu9" for a GUI button script names.
#1618
Hehe, can't resist this one   :P

  • If you have to tell everyone how intelligent you are then you probably are not.

  • "traid" is not a word.  If you meant to say "trade" you will notice there is no "i" in the word and that it ends in a silent "e".

  • IQ abbr. intelligence quotient
    Quote
    Noun   1.   IQ - a measure of a person's intelligence as indicated by an intelligence test; the ratio of a person's mental age to their chronological age (multiplied by 100)
    I don't know quite what it is but someone once told me I have a big one...  :=

  • Professor is spelled "professor" not "proffesor"

  • Kinoko has published a game and is working on another, markets several self-published Manga (Kinoko, hope Manga is the correct term for your work) comic books as well as other original art works, and maintains a comercial website.  It's my understanding that Kinoko is currently working on an RPG game using AGS, a challenging task for anyone, but especially so for a an artsie-fartsie non-programmer  type  ;D.  One might ask "What have you done lately?".

  • :) I think the proper term is emoticon.  Their purpose is to allow the writer to convey his "tone" or context in which the message is meant to be  interpreted.  Electronic communications can sometimes be terse and so can lead to confusion.  When communicating in person non-verbal cues provide a context to the communication.  So emoticon are used to express the non-verbal portion of a communication.
    Quote
    Noun   1.   emoticon - a representation of a facial expression (as a smile or frown) created by typing a sequence of characters in sending email; ":-( and :-) are emoticons"

  • You're far to clever for me to keep up with you so I will leave you with a smile  ;D
#1619
Quote
What has changed in the last 48 hrs?  Has your computer contracted a virus, spyware or something?

Quote
It seemed to be a problem with the new Audigy 2 drivers which support DRM (Digital Rights Management).   Apparently, a license was downloaded upon opening an audio file. Not having been a part of the transaction, I was unaware of the download ...

Amounts to the same thing doesn't it.  Why don't you take the sound card back and get your money back?  Damm those MS lovers...  :P
#1620
Kiniko,

I think you are having some confusion so let me see if I can help clarify things a bit.  Allow me to explain from the beginning, though you may know much of this already. 

Frist the on_key_press() function is only called when a key is pressed.  The next thing to do is to find out which key is pressed.  The parameter "keycode" contains the ASCII code of the key that was pressed as a decimal value.   This parameter is used the same as you would use any other integer variable (i.e. int).  It's value is set by the game engine before on_key_pres() is called.   So you don't need to use the function IsKeyPressed() inside the on_key_press() function.  Do something like the following instead.

int prevkey=0;
function on_key_press(int keycode){

   if (keycode==keyx) {
      DoSomething(STATE, keycode);
   }
   else if (keycode==keyy) {
      DoSomethingElse(STATE, keycode);
   {
   prevkey = keycode;
}


If you want to know when a key changes from one thing to another you must create a variable outside of the the bounds of the function.  Variables declared within the bounds of a function are created when the function is called and then destroyed when it completes. Destroyed means that the variable's assigned memory is reclaimed and can be reassigned when other functions are called.  Variables declared outside the bounds of any functions are persistent and retain their values throughout the game.  I believe that game save and restore operations preseve the values of such variables.

Ok! But what are those DoSomething() and DoSomethingElse() thingies?  Obviously they are functions, functions that you have previously created and that contain the rest of your logic.  They must appear in the gloabl script before the on_key_press() function.  They would look something like this

#define THIS                       -100
#define THAT                       -101
#define THE_OTHER_THING -102

function DoSomething(int state, int keycode) {
   if (state==THIS) {
      if (keycode==42) {
      }
      else {
      }
   }
   else if (state==THAT) {
   }
   else if (state==THE_OTHER_THING) {
   }
   else {
      Display("*** Error, undefined state");
   }
}


I think you will find it easier to work with if you get your logic out of the on_key_press function and split up your logic in to one or more functions of your own name and design.   

If you need more help just ask, of course...  ;)
SMF spam blocked by CleanTalk