Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Pages: [1] 2 3 ... 10
 1 
 on: Yesterday at 11:54:27 PM 
Started by Indra Anagram - Last post by Indra Anagram
Dear Muties!

Here I am again with another question. Like previous ones I think it is pretty much common for adventure games, so lots of people may be interested in the solution.

In "The Cat Lady" (this adventure game has recently become my huge inspiration) there is a cutscene/scripted scene with a van driving across the scene. I've made some screens and combined them in this GIF to illustrate what I mean:



What I am especially interested here is the van moving horizontally past trees and houses in the background.

1) I know there is a limitation for background resolution in WME. In the aforementioned scene the background seems to last and scroll forever. Yet since houses in the fog do repeat, I suspect the background is looped somehow. How is it possible to achieve such an effect in WME?

2) The van sprite itself is animated in a sly way: sometimes it seems not to move on the X-axis at all and other times it does actual motion from one edge of the scene to the other. Am I right?

3) The trees in the "foreground" have a kind of parallax effect. I know there is a chapter in WME tutorial about levels, yet here, like with the background, the trees seem to last forever)) How does one achieve this? Do these sprites load and unload constantly? What would the code look like? I'm afraid even to think about such code size and contents  :o

Guys, please help me to comprehend making of a complex scripted thing like this.

Thank you for your attention, thoughts, portions of wisdom and advice!


 2 
 on: November 21, 2017, 03:15:17 PM 
Started by Chaos - Last post by Chaos
Thanks a lot!... It finally works!!!   :D I think I finally found exactly that ít is actually located on the game_loop.script.
Code: [Select]
// handle the caption when you want to use an object with another
    else {
      var Item = Game.SelectedItem;

      WinCaption.X = 0;
      WinCaption.Y = 820;
      WinCaption.Width = Game.ScreenWidth;
      WinCaption.TextAlign = TAL_CENTER;
      WinCaption.Text = "Use " + Item.Caption + " with " + ActObj.Caption;
    }
    WinCaption.Visible
(I´ve just changed the value of WinCaption.Y = to exactly what I needed)  The thing is I´ve been looking after it for many months (checking many scripts like game or game-loop but sadly I couldn´t found it until now. ) Thanks again.

 3 
 on: November 21, 2017, 01:11:58 PM 
Started by Chaos - Last post by NAItReIN
Hello  :)

Quote
I was wondering if there's a way to change the Y cordinate and make this text appear much lower on the screen

Of course, there is a way how to manipulate with text possition when you want to use one item with another. Please, open game_loop.script.

Code: WME Script
  1. #include "scripts\base.inc"
  2.  
  3. global WinCaption;
  4. global WinMenu;
  5.  
  6. // infinite loop
  7. while(true){
  8.  
  9.   // save the active object for later
  10.   var ActObj = Game.ActiveObject;
  11.  
  12.   // handle the standard foating caption
  13.   if(Game.Interactive && ActObj!=null)
  14.   {
  15.     if (Game.SelectedItem==null)
  16.     {
  17.       WinCaption.X = Game.MouseX;
  18.       WinCaption.Y = Game.MouseY + 20;
  19.       WinCaption.TextAlign = TAL_LEFT;
  20.       WinCaption.Text = ActObj.Caption;
  21.  
  22.       // keep the caption on screen
  23.       WinCaption.SizeToFit();
  24.       if(WinCaption.X + WinCaption.Width > Game.ScreenWidth) WinCaption.X = Game.ScreenWidth - WinCaption.Width;
  25.       if(WinCaption.Y + WinCaption.Height > Game.ScreenHeight) WinCaption.Y = Game.ScreenHeight - WinCaption.Height;
  26.     }
  27.     // handle the caption when you want to use an object with another
  28.     // this is what you need so you can try changing X or Y coordinates by  yourself
  29.     else {
  30.       var Item = Game.SelectedItem;
  31.  
  32.       WinCaption.X = 0;
  33.       WinCaption.Y = 580;
  34.       WinCaption.Width = Game.ScreenWidth;
  35.       WinCaption.TextAlign = TAL_CENTER;
  36.       WinCaption.Text = "Use " + Item.Caption + " with " + ActObj.Caption;
  37.     }
  38.     WinCaption.Visible = true;
  39.     WinCaption.Focus();
  40.   }
  41.   else WinCaption.Visible = false;
  42.  
  43.   // go to sleep for 20 miliseconds to allow the engine to perform other tasks
  44.   Sleep(20);
  45. }
  46.  

Let´s have a closer look on this piece of code:
Code: WME Script
  1. // handle the caption when you want to use an object with another
  2.     // this is what you need so you can try changing X or Y coordinates by  yourself
  3.     else {
  4.       var Item = Game.SelectedItem;
  5.  
  6.       WinCaption.X = 0;
  7.       // change this value
  8.       WinCaption.Y = 580;
  9.       WinCaption.Width = Game.ScreenWidth;
  10.       WinCaption.TextAlign = TAL_CENTER;
  11.       WinCaption.Text = "Use " + Item.Caption + " with " + ActObj.Caption;
  12.     }
  13.     WinCaption.Visible = true;
  14.     WinCaption.Focus();
  15.   }

 4 
 on: November 21, 2017, 12:17:49 PM 
Started by Chaos - Last post by Chaos
Hiya!  :) I need to change the text that appears everytime you use an item on another. (That little piece of text that says "Use xxxx on xxx" ... I was wondering if there's a way to change the Y cordinate and make this text appear much lower on the screen.  ???

 5 
 on: November 20, 2017, 08:37:57 PM 
Started by Indra Anagram - Last post by anarchist
Quote
What if we offer scene auto-scrolling as a tutorial for WME Knowledge base? I think this feature is quite frequent for adventure games. What do you think?

That sounds like a wonderful idea! I am afraid you will have to do it on your own though since I don't have enough time to contribute.

 6 
 on: November 20, 2017, 08:18:43 PM 
Started by Indra Anagram - Last post by Indra Anagram
Scene.ScrollSpeedX is an attribute, not a method. You get the error because you try to use it as a method

Hey anarchist, that's true! I got misguided with "Call to undefined method 'ScrollSpeedX'. Ignored" message in Debugging console))

a correct use would be:

Code: WME Script
  1. Scene.ScrollSpeedX = 20; //Default is 10, so this will make the scene scroll faster.
  2.  

Once I corrected scene_init.script with your piece of code, the scene started playing without any errors! Yay!  ;D

The funny thing is I used to think setting Scene.ScrollSpeedX to 20 instead of the default 10 will speed up scrolling)) While it's vice versa - reduction of the integer makes the scene scroll faster. I set the attribute's value to 2.

The "cut-scene" as scripted sequence looks exactly like I wanted it to be, anarchist!

THANK YOU!!! Wish I could help other beginners like you do some day. What if we offer scene auto-scrolling as a tutorial for WME Knowledge base? I think this feature is quite frequent for adventure games. What do you think?

 7 
 on: November 20, 2017, 12:37:59 AM 
Started by Eric Matyas - Last post by Eric Matyas
Hey guys,

I've added about 60 new images to the following pages:

TXR - CONCRETE / PAVEMENT
http://soundimage.org/txr-concrete/

TXR - GLASS (new page)
http://soundimage.org/txr-glass/

TXR - WOOD
http://soundimage.org/txr-wood/

I hope some of them are helpful!

 8 
 on: November 19, 2017, 10:39:39 PM 
Started by Indra Anagram - Last post by anarchist
Scene.ScrollSpeedX is an attribute, not a method. You get the error because you try to use it as a method:

Code: WME Script
  1. Scene.ScrollSpeedX(20); //This is wrong
  2.  

also, you have to set its value to an integer, so this is also wrong:

Code: WME Script
  1. Scene.ScrollSpeedX = true; //You assign a boolean value instead of an integer.
  2.  

a correct use would be:

Code: WME Script
  1. Scene.ScrollSpeedX = 20; //Default is 10, so this will make the scene scroll faster.
  2.  

 9 
 on: November 19, 2017, 02:28:25 PM 
Started by Indra Anagram - Last post by Indra Anagram
Hey anarchist!

You can play with these to get what you want.

I've played with ScrollSpeedX and managed to change the speed of scrolling, however an error appeared in Debugging console and wme.log:

Quote
19:10: Runtime error. Script 'scenes\Room\scr\scene_init.script', line 73
19:10:   Call to undefined method 'ScrollSpeedX'. Ignored.

The code looks this way:

Code: WME Script
  1. 70. Game.MainObject = null;
  2. 71. Scene.AutoScroll = true; //The scene can scroll automatically.
  3. 72. Scene.ScrollSpeedX = true; //The scene can scroll horizontally.
  4. 73. Scene.ScrollSpeedX(20); //Set scrolling speed to 20 ms.
  5. 74. Scene.ScrollTo(husband); //Scroll the scene to husband.

What does "undefined method" mean? Isn't Scene.ScrollSpeedX a default method in the engine? The scene works just like I wanted, except for this error message  :(

What goes around comes around. This forum helped me a lot in my game, so I am simply returning the kindness I received. Kindness breeds kindness, I am sure you will do the same some day.

You are right, anarchist. I just hope that some day I'll be experienced enough to help someone on this forum just like you do.

THANK YOU!

 10 
 on: November 18, 2017, 10:43:01 PM 
Started by Indra Anagram - Last post by anarchist
I don't have any special talents, I simply have been working as a professional programmer for years (and on Wintermute for some years too), which among other things gives you the ability to find solution to your problems through searching (either the documentation or the Internet in general). As you said, it is a matter of experience.  8)

Scroll speed is an attribute of the Scene object. From the documentation http://docs.dead-code.org/wme/generated/scripting_ref_scene.html:

Quote
ScrollSpeedX: Horizontal scrolling speed (in milliseconds, default=10)
ScrollSpeedY: Vertical scrolling speed (in milliseconds, default=10)
ScrollPixelsX: Horizontal scrolling shift (in pixels, default=1)
ScrollPixelsY: Vertical scrolling shift (in pixels, default=1)
OffsetX: Current horizontal scrolling offset of the scene
OffsetY: Current vertical scrolling offset of the scene

You can play with these to get what you want.

What goes around comes around. This forum helped me a lot in my game, so I am simply returning the kindness I received. Kindness breeds kindness, I am sure you will do the same some day.

Pages: [1] 2 3 ... 10

Page created in 0.243 seconds with 12 queries.