Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

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 - sunrosea

Pages: [1]
1
Technical forum / Re: DeleteEntity error, even though code works
« on: September 10, 2012, 06:44:58 AM »
Ah right, I see. Thank you :)

I noticed tho that i get another error, thats only there when I have that code in the file. If i remove it, it doesn't get the error.
I removed the deleteEntity in any case because when i reload the scene the entity seems to disappear on its own.

The error is:
07:34:54:  Runtime error. Script 'scenes\Room\scr\scene_init.script', line 5
07:34:54:    Call to undefined method 'SkipTo'. Ignored

I have not edited the scene_init.script, but it doesn't seem to be that file having errors, but the game.exe doing something to make the engine say there's an error there.

Here's what the whole coding looks like so far for the game.script file:
Code: [Select]
#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 right-click menu
global WinMenu = Game.LoadWindow("interface\menu\menu.window");
WinMenu.Visible = false;

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


global MenuObject = null;






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




//create animated sprite on scene
Game.ChangeScene(Game.StartupScene);
var wakeupanim= Scene.CreateEntity("wakeupanimation");
wakeupanim.SetSprite("Animations\wakeupscene1.sprite");
wakeupanim.X=280;
wakeupanim.Y=521;
wakeupanim.Scale=100;
//Let animated sprite animate before fade out
Sleep(5000);
//Delete sprite from scene
Scene.FadeOut(100);
Game.ChangeScene(Game.StartupScene);
//Load main actor
actor = Game.LoadActor("actors\Naomi\Naomi.actor");
Game.MainObject = actor;


actor.SubtitlesPosX = 0;
actor.SubtitlesPosY = 550;
actor.SubtitlesWidth=1324;

////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
  // what did we click?
  var ActObj = Game.ActiveObject;
  if(ActObj!=null)
  {
    // clicking an inventory item
    if(ActObj.Type=="item" && Game.SelectedItem==null)
    {
      Game.SelectedItem = ActObj;
    }
    // using an inventory item on another object
    else if(Game.SelectedItem != null && Game.SelectedItem!=ActObj)
    {
      var Item = Game.SelectedItem;
      if(ActObj.CanHandleEvent(Item.Name)) ActObj.ApplyEvent(Item.Name);
      else if(Item.CanHandleEvent("default-use")) Item.ApplyEvent("default-use");
      else if(ActObj.CanHandleEvent("default-use")) ActObj.ApplyEvent("default-use");
      else actor.Talk("I can't use these things together.");
    }
    // just a simple click
    else ActObj.ApplyEvent("LeftClick");

  }
  // else propagate the LeftClick event to a scene
  else
  {
    Scene.ApplyEvent("LeftClick");
  }
}



////////////////////////////////////////////////////////////////////////////////
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.GetControl("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();
    }
    // no verbs supported, no menu is needed; just send the RightClick event to the object
    else ActObj.ApplyEvent("RightClick");
  }
}


////////////////////////////////////////////////////////////////////////////////
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);
}

2
Technical forum / DeleteEntity error, even though code works
« on: September 09, 2012, 11:15:54 AM »
Hi!

I wanted to have an animated sprite in the beginning of the game, without the actor, because it is supposed to be the actor lying down on the ground.
So I decided to load the actor after the sprite have done its job, and so this is what I came up with:
game.script
Code: [Select]
// which scene to load?
Game.ChangeScene(Game.StartupScene);
//create animated sprite on scene
var wakeupanim= Scene.CreateEntity("wakeupanimation");
wakeupanim.SetSprite("Animations\wakeupscene1.sprite");
wakeupanim.X=280;
wakeupanim.Y=521;
//Let animated sprite animate before fade out
Sleep(5000);
//Delete sprite from scene
wakeupanim.DeleteEntity("wakeupanimation");
Scene.FadeOut(100);
Game.ChangeScene(Game.StartupScene);
//Load main actor
actor = Game.LoadActor("actors\Naomi\Naomi.actor");
Game.MainObject = actor;

This works totally fine. But I still get an error saying:
 "12:08:26:  Runtime error. Script 'scripts\game.script', line 39
12:08:26:    Call to undefined method 'DeleteEntity'. Ignored."

It does delete the sprite anyways, because its not there once the scene is loaded again with the actor.
But I'm just thinking it might ruin other things with the game further on, is there something i need to fix so that i do not get the error?


3
Technical forum / Re: About selling game
« on: September 08, 2012, 10:54:37 AM »
Okay, thank you so much :)

4
Technical forum / About selling game
« on: September 08, 2012, 10:19:38 AM »
Hi!

As far as I understand, its okay to sell the game without paying anything (although I will donate in the future).
But is there anything you have to think about when you go about this?
like:
1. Do I have to credit any specific things from the engine or creator of it?
2. Is there any integrated parts to the engine that is not made by the engine creator, that has to be paid for?

Anything more to think of?

5
Technical forum / Re: Have subtitles show in response box
« on: September 08, 2012, 07:27:46 AM »
Thanks again! :) I had it figured out another way tho. But this could be useful for anyone else wanting to do this.

6
Technical forum / Have subtitles show in response box
« on: September 07, 2012, 12:50:19 PM »
Hey again, another issue this time :)

Well, I would like to have the subtitles to my character to be in the response box. Like I want all subtitles and talking stuff to be displayed at the same area
at the bottom of the screen with a plain colored background.

How would I implement this?

7
Technical forum / Re: left click pick up item
« on: September 07, 2012, 09:04:30 AM »
well i noticed a problem. When i save the changes to the apple.script file it does not update.  ???
Anyone know why? I open the file i WME and edit it and then save. But it doesn't seem to register it.

EDIT: I had to press "save as" instead of just save, weirdly enough. But yeah, its working fine now. Thanks for the help. :)

8
Technical forum / Re: left click pick up item
« on: September 07, 2012, 08:54:56 AM »
Thank you for the suggestion. :) This did not work tho. I have been working further with the scripts but have not been able to make the item disappear from the ground. What happens when i click "take" it only puts the apple on my cursor, and so theres an apple following my cursor, and an apple lying on the ground.
Nothing in the inventory. Do I have to adjust the inventory files?
 

9
Technical forum / left click pick up item
« on: September 06, 2012, 01:50:31 PM »
Hi!

I've tried to figure out how to make it so when you left click an item, the character will pick it up, instead of right click
and then choose to pick it up.
Basically, I'd like my character to pick up item when left click, and "look at" item when right click without the "menu" popping up. The right click will therefore make her only speak about the item.
Could someone tell me which files I should edit and what i should write to make that work?

Also Im having problems with making the object(an apple) appear in the inventory with the right-click menu thing, even tho i followed the steps in the manual.
When I choose to pick it up, it doesn't disappear from its position nor appearing in the inventory.
here's what i got so far:
the apple.script
Code: [Select]
#include "scripts\base.inc"


////////////////////////////////////////////////////////////////////////////////
on "LookAt"
{
  actor.Talk("Looks like an apple....");
}

////////////////////////////////////////////////////////////////////////////////
on "Take"
{
  actor.Talk("It could be useful, I might get hungry.");
  Game.TakeItem("apple");
 
  Game.SelectedItem = "apple";
}


The items.item file:
Code: [Select]
ITEM
{
   CURSOR_COMBINED = TRUE
   CAPTION = "WME User's Guide"
   NAME = "book"
   IMAGE = "items\book.bmp"
   CURSOR = "items\book.bmp"
   CURSOR_HOVER = "items\book_h.bmp"
   SCRIPT = "items\book.script"
}
ITEM
{
   CURSOR_COMBINED = TRUE
   CAPTION = "apple"
   NAME = "apple"
   IMAGE = "items\apple.png"
   CURSOR = "items\apple.png"
   CURSOR_HOVER = "items\apple.png"
   SCRIPT = "items\apple.script"
}

 i also added the apple.script file to the sceneEdit, by clicking on the apple entity and then adding the script file.
Also added "apple" to the "item" text box and saved it.

have I missed something?

10
Technical forum / Bad quality image in fullscreen
« on: August 28, 2012, 01:30:56 PM »
Hi!
I've got a problem with the background image quality, and the character quality when its in full screen. In windowed mode it looks fantastic.
I'm guessing that even tho I have set a size of the game (which is the exact same as of the background), it still resizes it a bit and that's what causing it to get a bit blurry like?
Is there a way that you can run it in full screen, so that there are black edges around the scene, but without the engine resizing the game?


11
Technical forum / Re: Curved scale line?
« on: August 27, 2012, 09:52:09 AM »
Wow, that simple to find it! I should have looked a bit harder. ;D
Thanks a lot! :)

12
Technical forum / Curved scale line?
« on: August 26, 2012, 12:31:12 PM »
Hi!
I installed a couple of days ago the WME, and I love it so far :)
I have a question regarding the green horizontal scale lines which I haven't found an answer to yet here in the forums.
You see, the ground of my background is not straight horizontally, its going upwards a bit at the left side of the screen, like a hill kind of.
The part where my character is walking up a bit on the hill, is a bit further away, and therefore I want her to be scaled to 80% of her size.
So i put one of the scaling lines there and changed it to 80%, but when shes walking down the hill for example, the line "registers" it like shes scaling bigger because shes going further away from the line, even tho its at the same distance, just that its going downwards. I hope you catch my drift.
Is there a way to curve the horizontal scaling line so that it follows the hill or is there another setting i can do to make her stay at 80% walking down and up the hill?
Or maybe you somehow can add another horizontal line, i actually would need three of them.

Pages: [1]

Page created in 0.079 seconds with 24 queries.