Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

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

Pages: [1]
1
Technical forum / Overwrite Keyboard functions on Text box areas.
« on: July 02, 2010, 04:13:00 PM »
Good evening,

I'm trying to overwrite the keyboard controls on a single line editor controls. But I've failed so far.

I have something like this on the window's script.

Code: WME Script
  1. on "Keypress"
  2. {
  3.   var button;
  4.  
  5.   if(Keyboard.KeyCode==VK_ESCAPE){
  6.     button = this.GetControl("close");
  7.     button.Press();
  8.   }
  9.   else if(Keyboard.KeyCode==VK_RETURN){
  10.     run();
  11.   }
  12.   else if (Keyboard.KeyCode==VK_DOWN){
  13.         // Run something.
  14.   } 
  15. }
  16.  

I've tried to overwrite the keyboard's UP and DOWN keys but I've found out that those keys, as well as all "cursor moving" keys, can't be overwritten, the game just ignores that code.

Is it possible to overwritten or is it imbedded in the code?

2
Technical forum / Re: help with shadows..
« on: June 26, 2010, 09:18:08 AM »
Hello,

I'm not a graphics artist but I think that problem is clearly due to the scene geometry. Also, try changing the scene's shadow type to "Stencil shadow" so it can adapt to the geometry.

I don't think theres another way to hide the shadow manually in those situations. But I could be wrong. ;D

3
Technical forum / Re: change looping animation
« on: June 26, 2010, 09:11:31 AM »
Well, I've search WME Online Documentation and didn't found any reference to dynamically change a name of the animation and it's loop.

So just think outside the box. If you can't change it, just create another animation with a different name and loop, and call that specific animation.

4
Technical forum / Re: Cant reach inventory's sprite object:(
« on: June 12, 2010, 03:54:04 PM »

I use your code and assigne the animated sprite with SetImage but then how hen how could I reach
that animatedSprite.sprite's properties? For example I want to stop the sprite animation on its last frame or do some other actions on that sprite but
how I can make a call to it?

And where I can give a name for that sprite so I can reach it or call it from code?. The "name" property doesnt work on sprite editor.

Thank you:)

Well, you can always take the loop off in the Sprite Editor or you access it by doing something like:

// Assuming inv was already declared up.
var backgroundImage = inv.GetImage(); // backgroundImage has a reference for a sprite type variable.
backgroundImage.Pause();

For more Sprite functions, you can always check http://docs.dead-code.org/wme/generated/scripting_ref_sprite.html

Hope this helps :)



5
Technical forum / Re: Cant reach inventory's sprite object:(
« on: June 12, 2010, 03:13:08 PM »
Hello,

Well there are simple ways to change your inventory's background image. Just use the standard window editor. Click on inventory.def under the interface folder and in the inventory's background just choose your .sprite image.

If you, somehow, want to do it using code, try doing something like:

var inv = Game.GetInventoryWindow();
inv.SetImage("interface\animatedSprite.sprite");

I hope this was the answer you were looking for.

6
Technical forum / Re: Can I make button Screen/Windowed mode?
« on: June 03, 2010, 09:33:34 PM »
Well I don't think you can change it whilst in game.

The only thing you can do is Game.WindowedMode and it returns true if the game is in windowed mode. But it's a read only variable.

7
Technical forum / Re: Menu Page
« on: May 31, 2010, 11:38:06 PM »
I don't know how you did it in your game, but let's say you have something like this on game.script:
Code: [Select]
on "Keypress"
{
  // on Esc or F1 key
  if(Keyboard.KeyCode==VK_ESCAPE || Keyboard.KeyCode==VK_F1)
  {
    // takes a screenshot and loads the menu.scene
    Game.StoreSaveThumbnail();
    Game.ChangeScene("scenes\menu\menu.scene");
  }
}

I don't have access to Windows at this moment, so I can't guarantee that works. But It should be something like that. Try checking this http://docs.dead-code.org/wme/generated/scripting_ref_game.html.


8
Technical forum / Re: Menu Page
« on: May 31, 2010, 10:52:52 PM »
May we see the error that appears on the log ? Maybe It can help to identify the error.

Regarding the thumbnail preview of the previous scene. My best bet would be each time you load the menu.scene, it would save a temp image of the scene before loading the actual menu scene.

Hope It helped :)

9
Technical forum / Re: Walk speed acceleration/deceleration.
« on: May 29, 2010, 10:34:58 AM »
I don't even know why I didn't see that.

Thank you for the tip and the quick reply :)

10
Technical forum / Walk speed acceleration/deceleration.
« on: May 29, 2010, 03:43:36 AM »
Good evening,

I would like to know if it's possible to dynamically change a character's velocity, while he moves. The character would react like a car, with an acceleration and deceleration.

I tried overwriting the GoTo and GoToAsync method and implementing a mathamic formula, but with no success.

Code: [Select]
method GoTo (X,Y)
{
  var d = Math.Sqrt(Math.Abs(Math.Pow((X-this.X),2))-Math.Abs(Math.Pow((Y-this.Y),2)));
  this.GoToAsync(X,Y)
  for (var i=0; i<=d; i=i+1) {
     this.velocity = (270-270*Math.Exp(-i/2))-(270*Math.Exp((i-d)/2));
     Sleep(d/270);
  }
}


I even tried putting the GoTo/GoToAsync inside the cycle, but what I found out was that when you send the character to a X and Y, the character will move with his initial velocity until he gets to those points.

I don't want to use the DirectWalk because I want the characters to do bends.

Am I doing something wrong or since the char's velocity is constant it's impossible to add acceleration and deceleration ?
 

11
Technical forum / Re: Actor.SkipTo weird behaviour.
« on: April 03, 2010, 01:31:21 PM »
It works!

Okay now I feel dumb. I've tried solving it for 4~5h. Can't believe it was just that simple. Thank you so much :)

Now, since we are on the topic, is it possible to make the default scrolling direction start from Right to Left?

12
Technical forum / Actor.SkipTo weird behaviour.
« on: April 01, 2010, 11:17:22 PM »
Hello,

Okay this is the situation.

In one scene, as displayed on the image below, i want the actor to skip to a certain position on the screen when the room is loaded. However, it ignores the command and simply places it on the center of the screen.

http://i39.tinypic.com/2rr2stj.png

As you can see here, the instructions are clear. When the actor is loaded on the room, he should appear at 1000,580. But that is not the case. He always appears in 1270, 460. I suspect it's a scrolling problem. If I was to change that simple coordinate and put it like less than 1000 on the xx's, it works.

On a side note, is it possible to change the scrolling position to start on the right side of the screen rather than the left side?

I am driving myself to insanity. I simply can't understand why. Would love if someone could enlighten me.

In addition, I have this screen showing the scene on Scene Editor with the respective geometry.

http://i42.tinypic.com/1zpk1h5.png

Thank you.

13
Technical forum / Re: Exception Handling in Wintemute.
« on: March 23, 2010, 03:42:46 PM »
Hum, so there's any way to detect the script gave error ? I don't need it to have a specific error.

Oh well. Thanks for the quick reply :)

Good day.

14
Technical forum / Exception Handling in Wintemute.
« on: March 23, 2010, 01:35:20 PM »
Hello everyone,

As this is my first post, I would like to start by congratulating the fine team that made Wintermute. It's truly superb.

I would like to ask if there is any Exception Handling available on Wintermute.
I have searched the forums and the online Documentation but I didn't see anything.

I'm asking this because I want to make the player type the scene and/or an inventory item, for example, to acess/get it.

If there is no such scene/item when prompted, it says "Error script" in game and "Fatal Error" on wme.log

I tried making a try catch method, but the game doesn't recognize.
If I was to detect that error, in some kind of handler, I could avoid possible crashes and that evil message on screen.

Pages: [1]

Page created in 0.025 seconds with 22 queries.