Author Topic: Ego coming from another room  (Read 5698 times)

0 Members and 1 Guest are viewing this topic.

Offline Patrick

Ego coming from another room
« on: May 05, 2002, 06:43:10 PM »
Yo,

Does anyone know how to get my EGO to not have a defined position for entering a room? As my game is  now, you can leave a room from the top, and then end up in the middle!



  leaving   > |
                    |
                    |> in new room
                    |
                    |

I want it to be like this

  leaving   > |> in new room
                    |
                    |
                    |
                    |

or
                    |
                    |
     leaving > |> in new room
                    |
                    |

;D like my example?  ;)

SMG240




Offline Corby

Re:Ego coming from another room
« Reply #1 on: May 05, 2002, 07:28:11 PM »
Try this:

Logic for first room:
if (ego_edge_code == right_edge)  {
 get.posn(ego,v100,v101);
 new.room(2);
}

Logic for second room:
v100 = 1  //So the ego will appear at the far left of the
               // screen
if ((prev_room_no == 1
   position.v(ego,v100,v101);
   status.line.on();
   accept.input();
}

That should work... I don't know if there's a better way to do it...

Offline Chris Cromer

Re:Ego coming from another room
« Reply #2 on: May 05, 2002, 08:21:11 PM »
Your code is almost correct Corby, but there was a few errors in it. Try this:

v100 = 1; // Change this to the x position you want the ego to appear
v101 = 1; // Change this to the y position you want the ego to appear

if (prev_room_no == 1) {
   position.v(ego,v100,v101);
   status.line.on();
   accept.input();
}
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Corby

Re:Ego coming from another room
« Reply #3 on: May 06, 2002, 04:36:37 PM »
Oops! Here's a problem I haven't figured out... How do you switch ego's? Sorta like shape shifting in Jen's Quest?

Offline Chris Cromer

Re:Ego coming from another room
« Reply #4 on: May 06, 2002, 05:17:15 PM »
Just change the view number,

load.view(2);
set.view(ego,2);
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Patrick

Re:Ego coming from another room
« Reply #5 on: May 06, 2002, 08:33:22 PM »
SPEAKING OF COMING INTO MY ROOM.... >:(  >:(  >:(  >:(

What is this all about?

When I enter my room one timw, the animations wont work but I can get the item in the room.

I fool around with the } 's on the logic page.

Then when I enter the room, the objects are all animated, but if I say "GET _______" it says you cant get that here. Also I cannot leave the room or if I enter the room, there is like this little block at the entrance that I only can move in
________________________
|               |    door     |       |
|  box- >   | _________|      |
|                                       |
|                     item            |
|                                      |
|_________|door|__________|



I am sooooo confused   :'(   :(


Offline Blacki

Re:Ego coming from another room
« Reply #6 on: May 06, 2002, 08:54:08 PM »
First check your object editor and make sure the object is in the right room.

If it's not that, can you show us the logic?

sounds pretty messy.

Offline Patrick

Re:Ego coming from another room
« Reply #7 on: May 06, 2002, 09:09:05 PM »
Well, I know that it is in the right room because it used to work this is it's logic:



// ****************************************************************
//
// Logic 9
//
// ****************************************************************

#include "defines.txt"
#define pearl  o10
#define torch  o11
#define torch2 o12

if (new_room)
{
load.pic(room_no);
draw.pic(room_no);
discard.pic(room_no);
set.horizon(61);
}

animate.obj(o12);
load.view(22);
set.view(o12,22);
position(o12,44,52);
set.priority(o12,6);
ignore.objs(o12);
ignore.horizon(o12);
ignore.blocks(o12);
draw(o12);

animate.obj(o11);
load.view(22);
set.view(o11,22);
position(o11,91,52);
set.priority(o11,6);
ignore.objs(o11);
ignore.horizon(o11);
ignore.blocks(o11);
draw(o11);


if(!has("pearl"))
{
animate.obj(o10);
load.view(19);
set.view(o10,19);
set.loop(o10,0);
set.cel(o10,0);
position(o10,75,84);
set.priority(o10,7);
ignore.objs(o10);
draw(o10);


  //init

  if (prev_room_no == 5)
  {
    position(o0, 79, 161);
  }
   if (prev_room_no == 10)
  {
    position(o0, 71, 64);
  }
  draw(o0);
  show.pic();

if (ego_edge_code == horizon_edge)
{
  //horizon exit
  new.room(10);
}

if (ego_edge_code == bottom_edge)
{
  //bottom exit
  new.room(5);
}
if (f2 && unknown_word_no == 0 && !input_parsed)
{  if (said("look"))
  {
    print("You see a cave with a pearl on a pillow in the middle of the room on a rock.");
  }
}

if (said("get","pearl")) {
      if (posn(o0,45,68,107,131)) {
        if (!has("pearl")) {
          get("pearl");
          load.sound(73);
          sound(73,f16);
          erase(o10);
          print("You take the magnificant pearl.");
          v3 += 3;
        }
        else {
          print("You already have it.");
        }
        }
       else {
        print("Get closer.");
       }
      }
     }
 return();

« Last Edit: May 06, 2002, 09:10:37 PM by smartguy240 »


Offline Blacki

Re:Ego coming from another room
« Reply #8 on: May 06, 2002, 11:39:14 PM »
Try this;-----

#include "defines.txt"
#define pearl  o10
#define torch  o11
#define torch2 o12

if (new_room) {
 load.pic(room_no);
 draw.pic(room_no);
 discard.pic(room_no);
 set.horizon(61);
                         
 animate.obj(o12);
 load.view(22);
 set.view(o12,22);
 position(o12,44,52);
 set.priority(o12,6);
 ignore.objs(o12);
 ignore.horizon(o12);
 ignore.blocks(o12);
 draw(o12);

 animate.obj(o11);
 load.view(22);
 set.view(o11,22);
 position(o11,91,52);
 set.priority(o11,6);
 ignore.objs(o11);
 ignore.horizon(o11);
 ignore.blocks(o11);
 draw(o11);

 if(!has("pearl")){
   animate.obj(o10);
   load.view(19);
   set.view(o10,19);
   set.loop(o10,0);
   set.cel(o10,0);
   position(o10,75,84);
   set.priority(o10,7);
   ignore.objs(o10);
   draw(o10);
 }

 //init

 if (prev_room_no == 5){
   position(o0, 79, 161);
 }
 if (prev_room_no == 10){
   position(o0, 71, 64);
 }
 draw(o0);
 show.pic();
}  
if (ego_edge_code == horizon_edge){
 //horizon exit
 new.room(10);
}

if (ego_edge_code == bottom_edge){
 //bottom exit
 new.room(5);
}
if (f2 && unknown_word_no == 0 && !input_parsed){
 if (said("look")){
   print("You see a cave with a pearl on a pillow in the middle of the room on a rock.");
 }
}

if (said("get","pearl")) {
 if (posn(o0,45,68,107,131)) {
   if (!has("pearl")) {
     get("pearl");
     load.sound(73);
     sound(73,f16);
     erase(o10);
     print("You take the magnificant pearl.");
     v3 += 3;
   }
   else {
     print("You already have it.");
   }
 }
 else {
   print("Get closer.");
 }
}
   
return();

Offline Patrick

Re:Ego coming from another room
« Reply #9 on: May 07, 2002, 05:04:16 PM »
Ill try it and if it dosent work, I will restart the logic from scratch.


Offline Patrick

Re:Ego coming from another room
« Reply #10 on: May 07, 2002, 06:37:16 PM »
Ok it worked. You rock!  8)

Now,

I am having a problem with 3 things and I have a feeling that the center of all my problems is in my DEFINES.txt and my Logic.000.

Here I go...

1.) I have read the thread on the inventory bug, and have tried to fix it but it will not work.

2.) I cannot get a timer to work on my game, all that appears is these little glitches that change every second.

3.) Finally, anytime that I press escape on my AGI game that I am making, instead of having a menu pop up,  I get an error message that reads something like this...

Bad Action 161
enter to exit (or something like that)

I will send my logic.000 and defines.txt and hope that someone out there will be able to help me!

Thanx guys,
SMG240



Offline Patrick

Re:Ego coming from another room
« Reply #11 on: May 07, 2002, 06:39:12 PM »
Code: [Select]

#include "defines.txt"

if (error_code > 0) {
 call(98);     // error handler - IMPORTANT
}

if (room_no == 0) {
 call(91);    // initialization

 if (game_restarted) {
   disable.item(menu_fileseparator);
   set(menu_enabled);
   reset(f33);
   new.room(2);     // go to first room here
 }
 else {
   set.menu("AGI");
   set.menu.item("About      ", menu_about);
   set.menu.item("Help   <F1>", menu_help);
   set.menu("File");
   set.menu.item("Save     <F5>", menu_save);
   set.menu.item("Restore  <F7>", menu_restore);
   set.menu.item("-------------", menu_fileseparator);
   set.menu.item("Restart  <F9>", menu_restart);
   set.menu.item("Quit  <Alt-Z>", menu_quit);
   set.menu("Action");
   set.menu.item("See Object  <F4>", menu_seeobject);
   set.menu.item("Inventory  <Tab>", menu_inventory);
   set.menu("Special");
   set.menu.item("Sound On/Off      <F2>", menu_soundonoff);
   set.menu.item("Clock On/Off      <F6>", menu_clock);
   set.menu.item("Joystick      <Ctrl J>", menu_joystick);
   set.menu.item("Pause            <Esc>", menu_pause);
   set.menu("Speed");
   set.menu.item("Normal ", menu_normalspeed);
   set.menu.item("Slow   ", menu_slowspeed);
   set.menu.item("Fast   ", menu_fastspeed);
   set.menu.item("Fastest", menu_fastestspeed);
   submit.menu();
   disable.item(menu_fileseparator);
   set(f33);
   new.room(1);    // Patrick's Quest VER 1.0
 }
}

if (new_room) {          // First interpreter cycle in a new room
                        // Note: Everything other than logic 0 is discarded
                        // from memory when new.room is executed
 load.logics(90);  // Load game specific functions logic into memory
 reset(f32);  // If you remove this command to have debug
                       // mode STAY on, remember to load the debug
                       // logic here.
 clear.lines(24,24,0);  // clear bottom line of screen (remove ego's coords if shown)
 animate.obj(o0);
 load.view.v(ego_view_no);
 set.view.v(o0, ego_view_no);
 observe.objs(o0);
 set (f37);
                             //make sure clock gets updated this cycle
                            // on this cycle (if turned on)
}

if (v35 > 0) {    // player is dead
 if (v35 != 255) {    // first cycle since player died. disable
                             // some menu items and load logic 94 into
                             // memory as it will be called from now on.
   disable.item(menu_about);
   disable.item(menu_help);
   disable.item(menu_save);
   disable.item(menu_pause);
   disable.item(menu_soundonoff);
   disable.item(menu_seeobject);
   disable.item(menu_joystick);
   disable.item(menu_normalspeed);
   disable.item(menu_fastestspeed);
   disable.item(menu_fastspeed);
   disable.item(menu_slowspeed);
   load.logics(94);
 }
 call(94);    // death handler
 goto(End);
}

if (!f33) {
 if (controller(c19)) {
   menu.input();
 }
}

if (controller(menu_about)) {
 print("Patrick's Quest");
}

if ((controller(menu_fastestspeed) ||
    said("fastest") ||
    said("fastest", "speed"))) {
 cycle_delay = 0;    // no delay between interpreter cycles
}

if ((controller(menu_fastspeed) ||
    said("fast") ||
    said("fast", "speed"))) {
 cycle_delay = 1;    // 1/20th of a second delay between interpreter cycles
}

if ((controller(menu_normalspeed) ||
    said("normal") ||
    said("normal", "speed"))) {
 cycle_delay = 2;    // 2/20ths of a second delay between interpreter cycles
}

if ((controller(menu_slowspeed) ||
    said("slow") ||
    said("slow", "speed"))) {
 cycle_delay = 4;    // 4/20ths of a second delay between interpreter cycles
}

if (controller(c26)) {
 sound_volume--;  // decrease volume
}

if (controller(c27) && sound_volume < 15) {
 sound_volume++;  // increase volume
}

if (controller(menu_soundonoff)) {
 toggle(sound_on);
}

if (!f33) {

 if (!f32) {
   if (controller(key_debug)) {
     set(f32);
     print("Version 1.00");
     version();
     load.logics(99);    // load debug logic into memory
   }
 }



Offline Patrick

Re:Ego coming from another room
« Reply #12 on: May 07, 2002, 06:41:14 PM »
//HERE IS THE SECOND HALF, it said that it was too long

Code: [Select]
 if ((controller(menu_save) ||
      said("save", "game") ||
      said("save"))) {
   stop.sound();
   save.game();
 }

 if ((controller(menu_restore) ||
      said("restore", "game") ||
      said("restore"))) {
   stop.sound();
   restore.game();
 }

 if ((controller(menu_restart) ||
      said("restart", "game") ||
      said("restart"))) {
   restart.game();
 }

 if ((controller(menu_help) ||
      said("help"))) {
   call(92);
 }

 if (controller(key_echoline)) {
   echo.line();
 }

 if (controller(key_clearinputline)) {
   cancel.line();
 }

 if (controller(menu_joystick)) {
   init.joy();
 }

 if ((controller(menu_pause) ||
      said("pause", "game") ||
      said("pause"))) {
   pause();
 }

 if ((controller(menu_inventory) ||
      said("inventory"))) {
   status();
 }

 if ((controller(menu_seeobject) ||
      controller(key_seeobject))) {
   set(inventory_select_enabled);    // enable choice of inventory item in inventory screen
   status();   // show inventory screen - player selects an inventory item
   if (selected_inventory_item > 0 &&
       selected_inventory_item != 255) {       // note: selected_inventory_item is set to 255
                                               // if ESC is pressed in the inventory screen.
     // player has chosen an object (value of selected_inventory_item). We now display this object.

     if (selected_inventory_item == 1) {       // test object
       show.obj(220);
     }
     if (selected_inventory_item == 0) {       // key
       show.obj(007);
     }
     if (selected_inventory_item == 2) {       // fish
       show.obj(002);
     }
     if (selected_inventory_item == 3) {       // mail
       show.obj(003);
     }
     if (selected_inventory_item == 4) {       // sword
       show.obj(10);
     }
     // NOTE: If you have several objects, it is easier to give them
     // consecutive view numbers. Then you can do the following (view
     // numbers start at 220 for this example):
     //   v255 = selected_inventory_item; v255 += 219;
     //   show.obj.v(v255);
     // If you this, you don't have to have separate statements for each
     // object.

     reset(inventory_select_enabled);   // disable choice of inventory item in inventory screen
   }
 }

 if ((controller(menu_quit) ||
      said("quit", "game") ||
      said("quit"))) {
   stop.sound();
   quit(0);
 }
}

get.posn(o0, v30, v31);       // get ego's current position

if (ego_dir == v34 &&
   v30 == v32 &&
   v31 == v33) {
 // ego hasn't moved or changed direction since last cycle
 stop.cycling(o0);
}
else {
 if (!f30) {
   start.cycling(o0);
 }
}

v32 = v30;
v33 = v31;
v34 = ego_dir;

if (f31) {
 start.cycling(o0);
}
else {
 if ((ego_dir == stopped || f31)) {
   stop.cycling(o0);
 }
}

if ((said("clock") || controller(menu_clock))) {
 toggle(f34);
 if (!f34) {
   status.line.on();         // remove clock text from status line
 }
}



if (isset(game_restored)) {    // first cycle since restore game executed
 clear.lines(23, 24);
 reset(f32);
 disable.item(menu_fileseparator);
}

call.v(room_no);    // IMPORTANT: This calls the logic for the current room - this
                   // is not done automatically by the interpreter so it has to be
                   // called manually by logic 0. Logic 0 cycles round and on each
                   // cycle the current room's logic is called, so it is also
                   // executed with each cycle.

if (f32) {
 call(99);    // debug logic
}

call(90);      // game specific functions

if (f2 &&
   unknown_word_no > 0) {
 reset(f2);
 if (unknown_word_no == 1) {
   print("I don't understand \"%w1\"");
 }
 if (unknown_word_no == 2) {
   print("Can you rephrase that? \"%w2\"");
 }
 if (unknown_word_no == 3) {
   print("HUH? \"%w3\"");
 }
}

if (f2 &&
   !input_parsed) {     // no command has been recognised
 print("I don't understand your request.");
 reset(f2);
}

reset(input_parsed);

End:
return()


Offline Patrick

Re:Ego coming from another room
« Reply #13 on: May 07, 2002, 06:46:51 PM »
// vars
#define room_no                      v0
#define prev_room_no                 v1
#define ego_edge_code                v2
#define score                        v3
#define object_touching_edge         v4
#define object_edge_code             v5
#define ego_dir                      v6
#define max_score                    v7
#define free_memory                  v8
#define unknown_word_no              v9
#define cycle_delay                  v10
#define clock_seconds                v11
#define clock_minutes                v12
#define clock_hours                  v13
#define clock_days                   v14
#define joystick_sensitivity         v15
#define ego_view_no                  v16
#define error_code                   v17
#define error_information            v18
#define key_pressed                  v19
#define computer_type                v20
#define window_close_time            v21
#define sound_type                   v22
#define sound_volume                 v23
// not sure what v24 is
#define selected_inventory_item      v25
#define video_mode                   v26
// flags
#define ego_on_water                 f0
#define ego_hidden                   f1
#define input_received               f2
#define ego_touching_signal_line     f3
#define input_parsed                 f4
#define new_room                     f5
#define game_restarted               f6
#define script_buffer_blocked        f7
#define joystick_sensitivity_set     f8
#define sound_on                     f9
#define trace_enabled                f10
#define first_logic0_cycle           f11
#define game_restored                f12
#define inventory_select_enabled     f13
#define menu_enabled                 f14
#define windows_remain               f15
#define stop_sound                   f16
// strings
#define prompt_char                  s0
// edge codes
#define no_edge                      0
#define horizon_edge                 1
#define right_edge                   2
#define bottom_edge                  3
#define left_edge                    4
// directions
#define stopped                      0
#define up                           1
#define upright                      2
#define right                        3
#define downright                    4
#define down                         5
#define downleft                     6
#define left                         7
#define upleft                       8
// video modes
#define CGA                          0
#define RGB                          1
#define Hercules                     2
#define EGA                          3
#define VGA                          4
//AGI Menu
#define menu_about                   c21
#define menu_help                    c2
// File menu
#define menu_save                    c3
#define menu_restore                 c5
#define menu_fileseparator           c20
#define menu_restart                 c7
#define menu_quit                    c1
// Action menu
#define menu_seeobject               c22
#define menu_inventory               c10
// Special menu
#define menu_soundonoff              c16
#define menu_clock                   c12
#define menu_joystick                c15
#define menu_pause                   c16
// Speed menu
#define menu_normalspeed             c24
#define menu_slowspeed               c25
#define menu_fastspeed               c23
#define menu_fastestspeed            c28
// Keys
#define key_activate_menu            c19
#define key_decrease_volume          c26
#define key_increase_volume          c27
#define key_clearinputline           c17
#define key_echoline                 c9
#define key_seeobject                c4
#define key_debug                    c14
//other
#define debug_active                 f32
#define clock_active                 f34
#define old_clock_seconds            f37
#define ego                          o0
#define mail                         o1
#define fish                         o2
#define sword                        o3
#define key                          o4
#define water                        o5
#define water                        o7
#define girl                         o6
#define apple                        o8
#define town                         o9
#define new_ego_x                    v30
#define new_ego_y                    v31
#define old_ego_x                    v32
#define old_ego_y                    v33
#define old_ego_dir                  v34
#define never_animate_ego            f30
#define always_animate_ego           f31
#define death_type                   v35
#define thankyou_timer               v36
#define coords_shown                 f35
#define num_invobjects               25
#define disable_game_functions       f33
#define game_version_message         "(Patrick's Quest Version 1.00)"
#define game_about_message           "(This game rocks you debugger!)"


Offline Patrick

Re:Ego coming from another room
« Reply #14 on: May 07, 2002, 06:47:55 PM »
That was my defines.txt file



SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.055 seconds with 22 queries.