Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


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 - Indra Anagram

Pages: 1 2 [3] 4 5
31
Hey Mnemonic!

The van is basically staying in the same place (moving a little to the left and right)

1. Do you mean something like this?



Basically you'd need just one script, that would move it's owner entity by decreasing its X position, and if X is lower than some threshold, it would increase it again and repeat the process.

2. I want the vehicle to move left, like in the example gif from my original post. Will the code resemble something like:

Code: WME Script
  1. if(X>1200)
  2. {
  3.   tree.SkipTo(X, Y);
  4. }

Or do I understand you correctly at all?

while everything else moves. For example, the trees would be "recyclable" entities, that move from right to left, and when they're off screen, they skip back all the way to the right and then move through the screen again. Same for the fog, houses etc.

3. I am creating a simple replica of the scene. How many layers should be in the scene? 3 or 4? I mean for background, emerging and disappearing house and back trees, the car itself (with floor region), and foreground with trees. Should those foreground tree entities be recycled one by one or as one long sprite?

THANK YOU for your kind reply and inspiration!

32
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!


33
Technical forum / Re: Second actor creation and cutscene
« on: November 20, 2017, 08:18:43 PM »
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?

34
Technical forum / Re: Second actor creation and cutscene
« on: November 19, 2017, 02:28:25 PM »
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!

35
Technical forum / Re: Second actor creation and cutscene
« on: November 18, 2017, 07:12:08 PM »
As I said above, I am working blindly, but from what I read in the documentation, the behaviour you observe does make sense, so I think this will work.

Yes, anarchist, the code that you came up with works perfectly!  ::rock
The whole scene now scrolls to "husband" actor smoothly. Do you happen to know if it is possible to speed up scrolling speed? Or it is not a changeable feature?

You were helping me *blindly*, without any use of scrolling in your project, wow! I am so impressed and sooo grateful to you!

THANK YOU, anarchist! You and NAItReIN are my heroes. Without you, guys, I don't know how I'd even crack all this scripting. Guess this is the pure question of experience.

36
Technical forum / Re: Inventory and response area always on top
« on: November 17, 2017, 09:56:34 PM »
NAItReIN, if not for you and anarchist, I wouldn't get through this at all!  ::thumbup

So cool to see ideas becoming something real with WME!

37
Technical forum / Re: Inventory and response area always on top
« on: November 17, 2017, 09:48:30 PM »
NAItReIN, it looks like it really does!  :D

You rock!

38
Technical forum / Re: Inventory and response area always on top
« on: November 17, 2017, 09:24:46 PM »
You're welcome  :) It is really great to see new active WME user  :)

NAItReIN, I got it! It was not only enough to replace InventoryWinDark with WinInventoryWinDark in game_loop.script. It was also necessary to do same in game.script:

Code: WME Script
  1.     // we need to store reference to window in global variable because we will use it in other script
  2.     // inventory dark window does exist, but it is not visible
  3.     global WinInventoryWinDark = Game.CreateWindow();
  4.     WinInventoryWinDark.SetImage("interface\inventory.png");
  5.     WinInventoryWinDark.X = 0;
  6.     WinInventoryWinDark.Y = 510;

This code worked finally! HUGE THANKS for your help again and again!

39
Technical forum / Re: Inventory and response area always on top
« on: November 17, 2017, 09:08:23 PM »
Hello,
I am away by my notebook where I have demo prepared for you. I am going to upload it on Dropbox tomorrow and share it with you  :)

NAItReIN, that will be really cool! Because you certainly updated it with more code.

Something is wrong on my side, so I'll look for mistakes to correct.

THANKS, NAItReIN! You helped me to advance significantly today.

40
Technical forum / Re: Inventory and response area always on top
« on: November 17, 2017, 08:57:41 PM »
Hello,
I am sorry I made a mistake. I tested my game and it worked well. Inventory window is always visible but when game is set to Game.Interactive = false; inventory window is covered with inventory dark. When I try to talk with oldguy in WME demo inventory window is invisible and I can see only responses window. When responses window is no visible I see inventory dark window. When dialog is gone inventory normal window is visible.
I am so sorry for my bed English  ::)

Hey NAItReIN!

It's me who should apologize for being so importunate. You've showed great support to me and anyone who might encounter similar problems with the inventory and responses window customization. THANK YOU for your patience!

Can you paste the contents of inventory_dark.sprite?

This would help to identify why responses are covered with the inventory background in my game.

41
Technical forum / Re: Inventory and response area always on top
« on: November 17, 2017, 07:27:19 PM »
Quote
23:50:33:  Compiling script 'scripts\game_loop.script'...
23:50:33:    Error@line 46: Variable 'WinInventoryWinDark' is referenced but not defined
23:50:33:  Compiling script 'scripts\game_loop.script'...
23:50:33:    Error@line 49: Variable 'WinInventoryWinDark' is referenced but not defined

NAItReIN!

I found out what was wrong in lines 46 and 49!))) Actually, the problem was in line 3.

Instead of

Code: WME Script
  1. global InventoryWinDark;

there should have been

Code: WME Script
  1. global WinInventoryWinDark;

So, now Debugging console doesn't show any error.

However, the background for the darkened inventory does cover responses window all the same. Maybe something should be corrected in responses.def?

THANKS for your attention and advice!

42
Technical forum / Re: Inventory and response area always on top
« on: November 17, 2017, 07:04:06 PM »
But how to solve your problem? See my solution:

Hey NAItReIN!

Gosh, I didn't see your last reply till I refreshed the page. Have just tested your codes. Replaced "interface\inventory_dark.sprite" with the path to my own image for darkened inventory in game.script.

Code: WME Script
  1. #include "scripts\base.inc"
  2. #include "scripts\keys.inc"
  3.  
  4. // store some of the game's attributes in global variables for convenience
  5.  
  6.  
  7. // load the right-click menu
  8. global WinMenu = Game.LoadWindow("interface\menu\menu.window");
  9. WinMenu.Visible = false;
  10.  
  11. // load the "caption" window
  12. var win = Game.LoadWindow("interface\system\caption.window");
  13. global WinCaption = win.GetControl("caption");
  14.  
  15.  
  16.     // we need to store reference to window in global variable because we will use it in other script
  17.     // inventory dark window does exist, but it is not visible
  18.     global InventoryWinDark = Game.CreateWindow();
  19.     InventoryWinDark.SetImage("interface\inventory.png");
  20.     InventoryWinDark.X = 0;
  21.     InventoryWinDark.Y = 510;
  22.  
  23. global MenuObject = null;
  24.  
  25.  
  26. // load our main actor
  27. molly = Game.LoadActor("actors\molly\molly.actor");
  28. sally = Game.LoadActor("actors\sally\sally.actor");
  29. actor = molly;
  30. Game.MainObject = actor;
  31.  
  32. // run the "game loop" script
  33. Game.AttachScript("scripts\game_loop.script");
  34.  
  35.  
  36. // which scene to load?
  37.  
  38.  
  39.  
  40. ////////////////////////////////////////////////////////////////////////////////
  41. on "LeftClick"
  42. {
  43.   // what did we click?
  44.   var ActObj = Game.ActiveObject;
  45.   if(ActObj!=null)
  46.   {
  47.     // clicking an inventory item
  48.     if(ActObj.Type=="item" && Game.SelectedItem==null)
  49.     {
  50.       Game.SelectedItem = ActObj;
  51.     }
  52.     // using an inventory item on another object
  53.     else if(Game.SelectedItem != null && Game.SelectedItem!=ActObj)
  54.     {
  55.       var Item = Game.SelectedItem;
  56.       if(ActObj.CanHandleEvent(Item.Name)) ActObj.ApplyEvent(Item.Name);
  57.       else if(Item.CanHandleEvent("default-use")) Item.ApplyEvent("default-use");
  58.       else if(ActObj.CanHandleEvent("default-use")) ActObj.ApplyEvent("default-use");
  59.       else actor.Talk("I can't use these things together.");
  60.     }
  61.     // just a simple click
  62.     else ActObj.ApplyEvent("LeftClick");
  63.   }
  64.   // else propagate the LeftClick event to a scene
  65.   else
  66.   {
  67.     Scene.ApplyEvent("LeftClick");
  68.   }
  69. }
  70.  
  71.  
  72.  
  73. ////////////////////////////////////////////////////////////////////////////////
  74. on "RightClick"
  75. {
  76.   // if inventory item selected? deselect it
  77.   if (Game.SelectedItem != null){
  78.     Game.SelectedItem = null;
  79.     return;
  80.   }
  81.  
  82.   var ActObj = Game.ActiveObject;
  83.  
  84.   // is the righ-click menu visible? hide it
  85.   if(WinMenu.Visible == true) WinMenu.Visible = false;
  86.   else if(ActObj!=null)
  87.   {
  88.     // if the clicked object can handle any of the "verbs", display the right-click menu
  89.     if(ActObj.CanHandleEvent("Take") || ActObj.CanHandleEvent("Talk") || ActObj.CanHandleEvent("LookAt"))
  90.     {
  91.       // store the clicked object in a global variable MenuObject
  92.       MenuObject = Game.ActiveObject;
  93.       var Caption = WinMenu.GetControl("caption");
  94.       Caption.Text = MenuObject.Caption;
  95.  
  96.       // adjust menu's position
  97.       WinMenu.X = Game.MouseX - WinMenu.Width / 2;
  98.       if(WinMenu.X < 0) WinMenu.X = 0;
  99.       if(WinMenu.X+WinMenu.Width>Game.ScreenWidth) WinMenu.X = Game.ScreenWidth-WinMenu.Width;
  100.  
  101.       WinMenu.Y = Game.MouseY - WinMenu.Height / 2;
  102.       if(WinMenu.Y<0) WinMenu.Y = 0;
  103.       if(WinMenu.Y+WinMenu.Height>Game.ScreenHeight) WinMenu.Y = Game.ScreenHeight-WinMenu.Height;
  104.  
  105.       // and show the right-click menu
  106.       WinMenu.Visible = true;
  107.  
  108.       // stop the actor from whatever he was going to do
  109.       actor.Reset();
  110.     }
  111.     // no verbs supported, no menu is needed; just send the RightClick event to the object
  112.     else ActObj.ApplyEvent("RightClick");
  113.   }
  114. }
  115.  
  116.  
  117. ////////////////////////////////////////////////////////////////////////////////
  118. on "Keypress"
  119. {
  120.   // on Esc or F1 key
  121.   if(Keyboard.KeyCode==VK_ESCAPE || Keyboard.KeyCode==VK_F1)
  122.   {
  123.     // load and display the main menu window
  124.     WinCaption.Visible = false;
  125.     var WinMainMenu = Game.LoadWindow("interface\system\mainmenu.window");
  126.     WinMainMenu.Center();
  127.     WinMainMenu.GoSystemExclusive();
  128.     Game.UnloadObject(WinMainMenu);
  129.   }
  130. }
  131.  
  132.  
  133. ////////////////////////////////////////////////////////////////////////////////
  134. on "QuitGame"
  135. {
  136.   // on Alt+F4 (window close)
  137.   // load and display the quit confirmation window
  138.   WinCaption.Visible = false;
  139.   var WinQuit = Game.LoadWindow("interface\system\quit.window");
  140.   WinQuit.Center();
  141.   WinQuit.GoSystemExclusive();
  142.  
  143.   // and if the user selected Yes
  144.   if(WinQuit.xResult)
  145.   {
  146.     // quit the game
  147.     Game.QuitGame();
  148.   }
  149.   // otherwise just unload the quit window from memory
  150.   else Game.UnloadObject(WinQuit);
  151. }
  152.  

When I run the game the darkened background shows, alright, but it covers responses window, it seems, so no responses are visible and the game is stuck. In your demo from the today archive everything was fine. Here is what Debugging console says:

Quote
23:50:33:  Compiling script 'scripts\game_loop.script'...
23:50:33:    Error@line 46: Variable 'WinInventoryWinDark' is referenced but not defined
23:50:33:  Compiling script 'scripts\game_loop.script'...
23:50:33:    Error@line 49: Variable 'WinInventoryWinDark' is referenced but not defined

And here is how game_loop.script looks:

Code: WME Script
  1.     #include "scripts\base.inc"
  2.      
  3.     global InventoryWinDark;
  4.     global WinCaption;
  5.     global WinMenu;
  6.      
  7.     // infinite loop
  8.     while(true){
  9.      
  10.       // save the active object for later
  11.       var ActObj = Game.ActiveObject;
  12.      
  13.       // handle the standard foating caption
  14.       if(Game.Interactive && ActObj!=null)
  15.       {
  16.         if (Game.SelectedItem==null)
  17.         {
  18.           WinCaption.X = Game.MouseX;
  19.           WinCaption.Y = Game.MouseY + 20;
  20.           WinCaption.TextAlign = TAL_LEFT;
  21.           WinCaption.Text = ActObj.Caption;
  22.      
  23.           // keep the caption on screen
  24.           WinCaption.SizeToFit();
  25.           if(WinCaption.X + WinCaption.Width > Game.ScreenWidth) WinCaption.X = Game.ScreenWidth - WinCaption.Width;
  26.           if(WinCaption.Y + WinCaption.Height > Game.ScreenHeight) WinCaption.Y = Game.ScreenHeight - WinCaption.Height;
  27.           }
  28.         // handle the caption when you want to use an object with another
  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.       // this is what we need
  44.       if(Game.Interactive==false && Game.ResponsesVisible == false)
  45.       {
  46.         WinInventoryWinDark.Visible = true;
  47.       }
  48.       else
  49.         WinInventoryWinDark.Visible = false;
  50.      
  51.       // go to sleep for 20 miliseconds to allow the engine to perform other tasks
  52.       // it is important for the "endless" scripts to call the Sleep command, otherwise the game will get stuck
  53.       Sleep(20);
  54.     }

Maybe I did something wrong with your code  :o Could you please look through the script?

Anyway, THANK YOU for your active and friendly help!

43
Technical forum / Re: Inventory and response area always on top
« on: November 17, 2017, 04:38:53 PM »
I hope it will help to solve your problems.

It HAS solved my problems, NAItReIN! Worked like a charm. 

Now the inventory is always at the bottom of screen and whenever responses show up, the background changes!

Just like in the game that is my inspiration, yay! :)

I was thinking about anarchist's advice:

Quote
I guess you can use inventoryWindow.SetImage() to change the background.

Because I want the inventory become darkened (change background) during scripted things, I guess InventoryWindow.SetImage should be used with

Code: WME Script
  1. if (Game.Interactive = false)
  2. {
  3.  
  4. }

How do I deal with the command? Should I make it a variable? Have tried this and got nothing.

BIG THANKS to you for your kind attention and the archive!

44
Technical forum / Re: Inventory and response area always on top
« on: November 17, 2017, 09:06:35 AM »
Hi muties,
please, download this file: https://www.dropbox.com/s/6mz8frfvo1bzs6t/IndraAnagram.rar?dl=0

I hope it will help  :)

Hey NAItReIN! I am deeply sorry, but the .rar archieve cannot be opened (at least I can't do that) - "File is damaged" and "Unsupported format" messages show. Could you please re-upload it to Dropbox or make it .zip instead? THANK YOU for your reply and desire to help!

45
Technical forum / Re: Inventory and response area always on top
« on: November 16, 2017, 08:20:31 PM »
As for modifying the inventory window on the fly, take a look at the command GetInventoryWindow() to "get" the window. After you have the window in a variable, you can handle it like any other window (I have never done this so please test). I guess you can use inventoryWindow.SetImage() to change the background. I guess the same applies for responses window, where you can use Game.GetResponsesWindow().

anarchist, I tried the commands, but since there is no information in tutorials about what exactly should be inside brackets, I inserted path to the definition file ("interface\inventory.def"), but it didn't work. What exactly should be inside? What value? And what would the code be like, if I want the inventory window dynamically change during scripted things and be replaced with response window?

About responses window...

Code: WME Script
  1.   WINDOW
  2.   {   
  3.     X = 0
  4.     Y = 510
  5.     WIDTH = 800
  6.     HEIGHT = 180
  7.     IMAGE = "interface\dialog.png"

I opened responses.def and changed Y value from 0 to 510 just like with the inventory window, however when I run the game, the background image seems to cover response options, so it is impossible to click on them.

Can't figure out what to do with this either  :P

Please help me, if you've got any idea about the values and use of GetInventoryWindow(), inventoryWindow.SetImage() and Game.GetResponsesWindow() commands.

HUGE THANKS!

Pages: 1 2 [3] 4 5

Page created in 0.161 seconds with 21 queries.