home *** CD-ROM | disk | FTP | other *** search
/ The Best of Select: Games 3 / cd.iso / games / dcg303xa / worlddef.scr < prev    next >
Text File  |  1993-05-24  |  4KB  |  96 lines

  1. !
  2. ! FILE: WORLDDEF.SCR
  3. !
  4. ! When you ENTER a world the following sequence of events occurs:
  5. !
  6. !  a) If a script exists for the current world (called WORLD###.SCO)
  7. !     it is called at entry point @EXIT.
  8. !
  9. !  b) If the script in a) ends with CONTINUE, or it does not exist,
  10. !     then this script (WORLDDEF.SCO) is called at entry point @EXIT.
  11. !
  12. !  c) The current world is saved and the destination world is loaded.
  13. !
  14. !  d) If a script exists for the new world (called WORLD###.SCO, where
  15. !     ### is the NEW world's number, not the old), then the script is
  16. !     invoked BEFORE the world is displayed on the screen at entry point
  17. !     @GET.  NOTE THAT THE OLD WORLD IS STILL SHOWING ON THE SCREEN.
  18. !
  19. !  e) If the above script 'CONTINUE's, then the new world is displayed
  20. !     and the script is called again with entry point @ENTER.
  21. !
  22. !  f) If the above script ends with CONTINUE on the second call, or
  23. !     the script does not exist at all, then the dfault script (WORLDDEF.SCR)
  24. !     is called with entry pont @ENTER.
  25. !
  26. ! NOTES:
  27. !
  28. !  1) The main purpose of the @GET entry point is to allow you to 'catch'
  29. !     the player BEFORE the new world is displayed.  The main reason for
  30. !     this is that you may want to transfer the party to a 3rd destination
  31. !     upon certain conditions.  Should you perform a transfer in the @ENTER
  32. !     section, the new world would 'blink' on the screen, before the party
  33. !     is transfered.  This MAY very well be what you want to do, for example
  34. !     if you display some text or do some animation that shows the reason
  35. !     why the final destination will be different!.
  36. !
  37. ! (c) DC Software, 1992
  38. !
  39.  
  40. !------------------------------------------------------------------------!
  41. :@GET
  42. !------------------------------------------------------------------------!
  43.   CONTINUE; ! Allow the transfer to take place !
  44.  
  45. !------------------------------------------------------------------------!
  46. :@ENTER
  47. !------------------------------------------------------------------------!
  48.  
  49.   L0 = 0; 
  50.   if world.entrytext(world.door) > 0 then
  51.     readtext( world.entrytext(world.door) );
  52.     ! if the switch is zero, the text is displayed only once !
  53.     if world.entrytextswitch(world.door) = 0 then 
  54.       world.entrytext(world.door) = -1; ! Forget the text !
  55.     endif;
  56.     L0 = 1;  ! Text has been displayed !
  57.   endif;
  58.  
  59.   if world.type = ENDGAME then
  60.     writeln( "Press <SPACE> to end game" );
  61.     pause; ! Wait before ending the game !
  62.     ENDGAME;
  63.   endif;
  64.  
  65.   if L0 = 0 then
  66.     writeln( "You are now in ", world.name );
  67.   endif;
  68.  
  69.   if world.type = ARENA then
  70.     new( npc, world.x / 2, world.y / 2 );
  71.   endif;
  72.  
  73.   STOP; ! Ok.  We have 'entered' the world !
  74.  
  75. !------------------------------------------------------------------------!
  76. :@EXIT
  77. !------------------------------------------------------------------------!
  78.   ! Handle exit text if any !
  79.   if world.exittext(world.door) >= 0 then
  80.     readtext( world.exittext(world.door) );
  81.     if world.exittextswitch(world.door) then
  82.       world.exittext(world.door) = -1; ! Never Again.. !
  83.     endif;
  84.   endif;
  85.  
  86.   ! Exiting from this world implies you 'enter' a door, which will lead
  87.   ! to another world (and will cause the 'ENTER' entry point to be
  88.   ! invoked for that other world!
  89.   enter( world.door );
  90.  
  91.   ! The 'continue' command informs the driver that it's ok to perform
  92.   ! the transfer indicated by the 'enter()' above.
  93.   CONTINUE;
  94.                                      
  95.  
  96.