question on ags

Started by , Sat 11/09/2004 16:53:57

Previous topic - Next topic

someguy

how do you make something animate or move when you use hand icon on it.(ex. press use on a drawer how do you make it open???)by the way i know its obvious i just dont want to search the manual.

rtf

To save you from the wrath of the moderators, let me just say that next time you post a question, read the manual.  It would be a lot quicker to larn rather that waiting for an hour for someone to reply.  ;)

Anyway, I barely ever use the interactions editor, but you can do that instead of scripting.

-Make an object for the closed door of the drawer.
-Make an object for the opened door.
-Place the closed drawer where you want the door to be.
-Place the other one where you want it to be when you open it up, and click "Not Visible"

Interactions Editor:

-Go to the interactions editor for the closed object.
-Click on "Object Off".  Set the object to number for the closed drawer.
-Click on "Object On".  Set it to the open drawer object.

Then, to close it, do the opposite.

Scripting
-In the Interactions Editor, click on Run Script.
-Add:
   
objectOn(x);
objectOff(x);

Where X is the oppropriate object number.
I fail at art.

Phemar

#2

Actually what I would do is create one object called the drawer, but import two sprites; one open and one closed. I'd set it to the closed sprite.

Interaction Editor for Object 0:
Interact with Object
|-Run Script

In Room Script:
//put this at the top of the script:
int draw_open=0,draw_used=0;
#define DRAW_CLOSED 1  //Replace 1 with the closed sprite number
#define DRAW_OPEN 2  //Replace 2 with open sprite number
//And then your interact function, (may look slightly different.)
#sectionstart object0_a  // DO NOT EDIT OR REMOVE THIS LINE
function object0_a() {
  // script for object0: Use object
//Insert the following code into the function:
//(replace //yourcode with the code you wish to use.)
  if (draw_open==0)   {
    SetObjectGraphic (0, DRAW_OPEN);draw_open=1;return;}
  else if (draw_open==1) {
    if (draw_used==0) {
      //yourcode (the code that interacts with it when it's open; to get an inventory item or something
      draw_used=1;return;}
    else if (draw_used==1) {
      //yourcode (the code that says "I've already done that", or something)
    }
    draw_open=2;return;}
  else if (draw_open==2) {
    SetObjectGraphic (0,DRAW_CLOSED);draw_open=1;return;}
}
#sectionend object0_a  // DO NOT EDIT OR REMOVE THIS LINE


This should work fine, though I haven't tested it yet...

someguy

thanks that should help

gary

i know this is dumb but how exactly do you make and "import" sprites??(im new too)

ghostface

gary...that ones pretty obvious...use the sprites button on the left side toolbar running upwards. You can get sprites from a number of places but ask before using them in your game. I recommend the instapack from www.sypher.com/ig/
"I wish I could say something classy and inspirational, but that just wouldn't be our style. Pain heals. Chicks dig scars. Glory. Lasts forever."

"These pretzels are making me thirsty!"

gary

can you please give me another link???That one does not seem to work.

gary

could anyone give me a website??i need to get started with my game.

ghostface

sorry man...spelled it wrong...its spelled www.sylpher.com/ip
"I wish I could say something classy and inspirational, but that just wouldn't be our style. Pain heals. Chicks dig scars. Glory. Lasts forever."

"These pretzels are making me thirsty!"

gary


Edwin Xie

Don't double post and don't be rude to ghostface! Btw, the the site is http://www.sylpher.com/ig/ I think ghostface spelled sylpher wrong.
Moving at superhigh speed getting to the planet called Earth. But it is boxed in white......thing.....

Scummbuddy

im locking this beacuse gary was being a jerk. plus, if you don't even know how to make a sprite, ags may not be for you.
thank you ghostface for trying, and edwin for correcting the link
gary, please calm down, check out the manual, and check out the critics lounge for some tutorials, ideas and images to view.
perhaps checking out the RON game sprites would be good.

wow, it took me awhile, but i found the ron pack on shimbleshanks site
http://www.freewebs.com/skimbleshanks/gamepacks.htm
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

SMF spam blocked by CleanTalk