Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

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.

Messages - Catacomber

Pages: 1 ... 25 26 [27] 28 29 30
391
Technical forum / Re: On look, on book, on right click scripts
« on: October 28, 2008, 09:34:07 PM »
Lightbulb turning on over cattish ears.  : )

But I still have to get Molly and Sally to exchange the book.  Will go over the chapter again tonight.  Thank you.

392
Technical forum / Re: On look, on book, on right click scripts
« on: October 28, 2008, 09:22:38 PM »
I found this "right click" script in a tutorial but it seems like a lot of stuff--is it necessary to go anywhere outside the WME book to do the projects?  This is where I got the "look at" from.

on "RightClick"
{
  // if inventory item selected? deselect it
  if (Game.SelectedItem != null)
  {
    Game.SelectedItem = null;
    return;
  }
 
  var ActObj = Game.ActiveObject;
 
  // is the righ-click menu visible? hide it
  if(WinMenu.Visible == true) WinMenu.Visible = false;
  else if(ActObj!=null)
  {
    // if the clicked object can handle any of the "verbs", display the right-click menu
    if(ActObj.CanHandleEvent("Take") || ActObj.CanHandleEvent("Talk") 
    || ActObj.CanHandleEvent("LookAt"))
    {
      // store the clicked object in a global variable MenuObject
      MenuObject = Game.ActiveObject;
      var Caption = WinMenu.GetWidget("caption");
      Caption.Text = MenuObject.Caption;
 
      // adjust menu's position
      WinMenu.X = Game.MouseX - WinMenu.Width / 2;
      if(WinMenu.X < 0) WinMenu.X = 0;
      if(WinMenu.X+WinMenu.Width>Game.ScreenWidth) 
         WinMenu.X = Game.ScreenWidth-WinMenu.Width;
 
      WinMenu.Y = Game.MouseY - WinMenu.Height / 2;
      if(WinMenu.Y<0) WinMenu.Y = 0;
      if(WinMenu.Y+WinMenu.Height>Game.ScreenHeight) 
          WinMenu.Y = Game.ScreenHeight-WinMenu.Height;
 
      // and show the right-click menu
      WinMenu.Visible = true;
 
      // stop the actor from whatever he was going to do
      actor.Reset();
    }
    else ActObj.ApplyEvent("RightClick");
  }
}


 

393
Thank you.  :  )

394
Technical forum / Re: On look, on book, on right click scripts
« on: October 28, 2008, 09:05:11 PM »
Sorry, Metamorphium, I'm working through Chapter 6.  You don't use look at but I was trying to find out some solution to my problem and was reading a different tutorial in the documentation as well.  You only reference handlers "on book" and "on leftclick" and I think "on rightclick".  I could be missing more of the on rightclick code, trying to figure it out but I could use some help.

395
Someone will help you, I'm sure.  Meanwhile, I did a search and found this:

var blockedDeskRegion = Scene.GetNode("block_desk");
  blockedDeskRegion.Blocked = false;

You could try fitting that code into your conditional code somehow if--what you wanted to happen as a condition happens but you have to use your own variable and region name. 

I'd like to know what works too.  This seems like something I'd be using quite a bit.  : )  This does sound like something basic but I can't find any documentation on it.

396
It may be something more, but I would put some brackets in that script to begin with:

if (!TeleportOpen)
{Region.Blocked = true;
}
else
{Region.Blocked = false;
}

Although I don't think the last bracket set is absolutely necessary. If this doesn't help, it's something deeper.




397
Technical forum / On look, on book, on right click scripts
« on: October 28, 2008, 03:58:37 AM »
Am following the WME Book demo and have met a new problem.  I can't get these scripts to work.  I don't know how to look at an item.  : )  How do you do that?  Do I have to have a "look at" script or is it in the "const.inc" script or someplace else?

Basically Molly and Sally can both go to and pick up the book and put it in their individual inventories--and they do have individual inventories.  But I don't know how to make them look at the book or give the book to each other.  They refuse.   I don't have any script errors--just don't have the action I expected. 

This is the script on the book.  Neither Molly nor Sally nor the book have a rightclick script--does that make sense?

#include "scripts\base.inc"

on "LeftClick"
{
        actor.GoToObject(this);
      actor.TakeItem("book");   
}


on "LookAt"
{
  actor.Talk("Guess I should read through this...");
}

////////////////////////////////////////////////////////////////////////////////
on "Take"
{
  Game.SelectedItem = "book";
}


This is my Molly script--Sally's is about the same:

#include "scripts\base.inc"

on "LeftClick"
{
   if (Game.MainObject == molly) actor.Talk("I am already selected!");
   else
   {
      actor = molly;
      Game.MainObject = actor;
      Game.InventoryObject = actor;
   }
}

on "book"
{   
   if (actor == molly) actor.Talk("It's always important to read WME documentation! I'll do it now!");
   else
   {
      Game.SelectedItem = null;
      sally.DropItem("book");
      molly.TakeItem("book");   
      molly.Talk("Thank you");
   }
}

This is my game script--

#include "scripts\base.inc"
#include "scripts\keys.inc"

// store some of the game's attributes in global variables for convenience
Keyboard = Game.Keyboard;
Scene = Game.Scene;

// load the "caption" window
var win = Game.LoadWindow("interface\system\caption.window");
global WinCaption = win.GetControl("caption");

// load our main actor
molly = Game.LoadActor("actors\molly\molly.actor");
sally = Game.LoadActor("actors\molly\sally.actor");

actor = molly;
actor = sally;

Game.MainObject = actor;
Game.InventoryObject = actor;

// run the "game loop" script
Game.AttachScript("scripts\game_loop.script");

Game.InventoryVisible = true;

// which scene to load?
Game.ChangeScene(Game.StartupScene);


////////////////////////////////////////////////////////////////////////////////

on "LeftClick"
{
  var ActObj = Game.ActiveObject;
  if(ActObj!=null)
  {
    if(Game.SelectedItem != null && Game.SelectedItem!=ActObj)
    {
      var Item = Game.SelectedItem;
      if(ActObj.CanHandleEvent(Item.Name)) ActObj.ApplyEvent(Item.Name);
    }
    else
        ActObj.ApplyEvent("LeftClick");
  }
  else
  {
    Scene.ApplyEvent("LeftClick");
  }
}

on "RightClick"
{
  if (Game.SelectedItem != null){
    Game.SelectedItem = null;
  }
}
////////////////////////////////////////////////////////////////////////////////
on "Keypress"
{
  // on Esc or F1 key
  if(Keyboard.KeyCode==VK_ESCAPE || Keyboard.KeyCode==VK_F1)
  {
    // load and display the main menu window
    WinCaption.Visible = false;
    var WinMainMenu = Game.LoadWindow("interface\system\mainmenu.window");
    WinMainMenu.Center();
    WinMainMenu.GoSystemExclusive();
    Game.UnloadObject(WinMainMenu);
  }
}


////////////////////////////////////////////////////////////////////////////////
on "QuitGame"
{
  // on Alt+F4 (window close)
  // load and display the quit confirmation window
  WinCaption.Visible = false;
  var WinQuit = Game.LoadWindow("interface\system\quit.window");
  WinQuit.Center();
  WinQuit.GoSystemExclusive();

  // and if the user selected Yes
  if(WinQuit.xResult)
  {
    // quit the game
    Game.QuitGame();
  }
  // otherwise just unload the quit window from memory
  else Game.UnloadObject(WinQuit);
}


398
Technical forum / Re: Z-order guiding needed :)
« on: October 27, 2008, 04:25:24 PM »
 :)  Looking forward to a screenshot of your game. 

399
Technical forum / Re: Z-order guiding needed :)
« on: October 27, 2008, 04:14:09 AM »
There is some info about ordering here:

http://docs.dead-code.org/

"Inside a game scene creation"---there is also mention about this in the WME book online--my understanding is that the z depth of regions is ordered from top to bottom in the Layout screen but for your gate it might be that a blocked region might work--not sure.  You'd have to try it.
 
I just discovered all the scripting commands--they're in the wme documentation online but I don't think there's enough room in the forum to explain them all--the best way is trial and error.   :)  I certainly couldn't explain them all -- : )  But I'm really glad they're listed there so I can try and err sometime.  : )  Right now I'm happy working through the tutorials.  : )  Problems and mistakes are my friend as that's how I get to take things apart and figure out how things work.  : )

400
Technical forum / Re: Screen display problems
« on: October 26, 2008, 02:43:51 PM »
I reinstalled the latest drivers again just in case there was some corruption. 

401
Technical forum / Re: Screen display problems
« on: October 26, 2008, 02:20:19 PM »
NVIDIA GeForce4MX440 with AGP8X--I just updated the driver two months ago.

402
Technical forum / Re: Molly and Sally
« on: October 26, 2008, 12:24:57 AM »
SOLVED!!!!!!!    ;D ;D ;D ^^

Everything is perfect now.  There was ONE line in sally.actor that made my life miserable:

INTERACTIVE = FALSE  How it got to false when I copied the file from Molly, I'll never know but will be very watchful in copying files in future.

Changing that to true solved my problem.  Sally is alive!!! 

I am learning a great deal from my mistakes!!!!  :  ) 

403
Technical forum / Re: Molly and Sally
« on: October 25, 2008, 10:24:00 PM »
The game seems to think both actors are Molly--when I click on the real molly--I get message on screen Molly.  When I click on Sally, no message.  Trying to track the problem down. 

404
Technical forum / Re: Molly and Sally
« on: October 25, 2008, 10:02:57 PM »
Yup, thanks--just don't know what to do here--I'm trying to follow the tutorial and am now up to giving control to the other actor but Sally is dead. Only Molly acts when I click on her.  She acts according to her script but Sally is quite dead.

This is my Sally script:

; $EDITOR_PROJECT_ROOT_DIR$ ..\..\..\

ACTOR
{
  NAME = "sally"
  CAPTION="Sally"
  SCALABLE = TRUE
  INTERACTIVE = FALSE
  X = 460
  Y = 400
  SCRIPT="actors\sally\sally.script"

  FONT = "fonts\outline_red.font"
 
   ANIMATION
  {
    NAME       = "idle"
   
    LEFT       = "actors\sally\ll\stand.sprite"
    RIGHT      = "actors\sally\rr\stand.sprite"
    UP         = "actors\sally\uu\stand.sprite"
    DOWN       = "actors\sally\dd\stand.sprite"

    UP_LEFT    = "actors\sally\ul\stand.sprite"
    UP_RIGHT   = "actors\sally\ur\stand.sprite"
    DOWN_LEFT  = "actors\sally\dl\stand.sprite"
    DOWN_RIGHT = "actors\sally\dr\stand.sprite"
  } 

  ANIMATION
  {
    [blah blah blah-the usual--deleted to save posting space]

This is my Game.script:
#include "scripts\base.inc"
#include "scripts\keys.inc"

// store some of the game's attributes in global variables for convenience
Keyboard = Game.Keyboard;
Scene = Game.Scene;

// load the "caption" window
var win = Game.LoadWindow("interface\system\caption.window");
global WinCaption = win.GetControl("caption");

// load our main actor
molly = Game.LoadActor("actors\molly\molly.actor");
sally = Game.LoadActor("actors\sally\sally.actor");
actor = molly;
actor = sally;
Game.MainObject = actor;

// run the "game loop" script
Game.AttachScript("scripts\game_loop.script");

Game.InventoryVisible = true;

// which scene to load?
Game.ChangeScene(Game.StartupScene);


////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
  // what did we click?
  var ActObj = Game.ActiveObject;
  if(ActObj!=null)
  {
     ActObj.ApplyEvent("LeftClick");
  }
  // else propagate the LeftClick event to a scene
  else
  {
    Scene.ApplyEvent("LeftClick");
  }
}

on "RightClick"
{
  if (Game.SelectedItem != null){
    Game.SelectedItem = null;
  }
}

////////////////////////////////////////////////////////////////////////////////
on "Keypress"
{
  // on Esc or F1 key
  if(Keyboard.KeyCode==VK_ESCAPE || Keyboard.KeyCode==VK_F1)
  {
    // load and display the main menu window
    WinCaption.Visible = false;
    var WinMainMenu = Game.LoadWindow("interface\system\mainmenu.window");
    WinMainMenu.Center();
    WinMainMenu.GoSystemExclusive();
    Game.UnloadObject(WinMainMenu);
  }
}


////////////////////////////////////////////////////////////////////////////////
on "QuitGame"
{
  // on Alt+F4 (window close)
  // load and display the quit confirmation window
  WinCaption.Visible = false;
  var WinQuit = Game.LoadWindow("interface\system\quit.window");
  WinQuit.Center();
  WinQuit.GoSystemExclusive();

  // and if the user selected Yes
  if(WinQuit.xResult)
  {
    // quit the game
    Game.QuitGame();
  }
  // otherwise just unload the quit window from memory
  else Game.UnloadObject(WinQuit);
}

Urgh!  (Not part of script)  ???

This is the part of the book am following:

Now what we’ve done is that we’ve created another actor named Sally which uses the same graphics as a Molly, but it’s entirely different person. We have her reference stored in the global variable actor2 and we’ve placed her in our Room scene. Next thing we’re going to do is that we’re going to implement a neat character switching.

If player clicks on Molly or Sally (without an inventory item selected) game gives control to the second actor.

Now remember that everything in our scripts is set to use the global variable “actor”. So if we want to implement character switching, we simply set this variable to character of our liking. Also we have to change the Game.MainObject because it drives the screen scrolling and we want to maintain this functionality as well. So let’s open the file molly.script in the actor folder and add here the LeftClick handler:
on "LeftClick"
{
   if (Game.MainObject == molly) actor.Talk("I am already selected!");
   else
   {
      actor = molly;
      Game.MainObject = actor;
   }
}

Analogically we’ll modify the sally.script to read:
on "LeftClick"
{
   if (Game.MainObject == sally) actor.Talk("I am already selected!");
   else
   {
      actor = sally;
      Game.MainObject = actor;
   }   
}

Although we could use single file for this, later on it pays off to have those separated when we want to perform different tasks with each actor.

Now run the game and note that we can switch between actors by simple Left Click on them.

I did all this. Sally is still dead.  Will place flowers on her grave.  : (

405
Technical forum / Re: Screen display problems
« on: October 25, 2008, 09:32:35 PM »
Hmmmm.  If I set my computer resolution to 800 x 600 which is the same resolution of the game resolution I don't seem to get these problems but 800 x 600 computer screen resolution makes everything so big!!  Was there a time when this was normal?

Pages: 1 ... 25 26 [27] 28 29 30

Page created in 0.055 seconds with 24 queries.