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

Pages: [1] 2 3 ... 5
1
Quick update : I managed to have a correct behaviour, but only because I have only 2 actors

Hey ylegrand!

I am pretty green to WME and know nothing about programming, but when I tried to load and set in motion several actors in my scene the problem was in 'Game.MainObject = actor;' line.

Maybe this will help you. Please tell me if that was the point.

2
Hi anarchist!

I have not tested this code so if it produces errors let us know which errors appear

Well, I did paste your code in scene_init.script after reading your helpful comments and guess what? No errors were identified in the debug. FANTASTIC!  ::thumbup

However, I keep getting this behavior from first tree entity (
Quote
treebg1.X = 0;
, remember?):

https://ibb.co/gvUr96

You see? First treebg2 entity appears in the FAR LEFT (no problem with that) and nearly a second later treebg1 emerges from nowhere.

, or better yet try to solve them yourself first  ;)

In the attempt to solve this issue on my own I changed the starting x coordinate of the car entity, however the result turned out to look even more unnatural: first we see both tree entities frozen in the FAR LEFT edge and the car entity drives in to its SkipTo point from the FAR RIGHT edge and finally trees start moving like they should  :(

My question is -
Is there a way to start the scene with this FAR LEFT edge hidden somehow from our view? Is it possible to shift the "view" a bit to the right in order to conceal the starting points of the trees? Please tell me what you think about this!

This way no one will notice treebg1 teleportation))

Here are the scene files for your kind consideration. This way we both will see what the issue is with those tree entities.

My background image is 2400 X 600 and the scene "view" is 800 X 600. Any ideas about shifting the "view" from the default FAR LEFT background edge to the right?

anarchist, THANK YOU for your patience and knowledge! I guess it is difficult to understand things that I try to express sometimes (like with this last "view" question). Maybe we perceive the problem from different angles - logical (you) and visual (me). Will really have to reinvent my mind to acquire a programming mind type lol.

3
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.

What you want is the entities to start on the start position, move right and then, when they have reached a predefined position on the right they appear on the left.

Not wishing to sound harsh but all you do is to reset the x,y coordinnates for each object within a loop.

Hey guys!

Sorry, but I still don't understand how to make your script work for multiple tree entities. I tried to adjust it for several trees, and in the end it always causes errors and undesirable behavior. Please, if you know how the script should work, tell me what's the solution for several entities.

This script could be good for clouds too, btw.

THANK YOU for your friendly attitude and help!

4
Hey Muties!

Finding the answers to these questions is a good way to overcome the background width limitation for everyone who would like to create a scene with "movement illusion". Let's come up with a template.

Please kindly view my questions about the script and scene setting in previous messages here. Any ideas on how the script could be customized for smooth "movement" of multiple entities?

This may seem as something obvious for a person proficient in scripting, but, honestly, to me this is not that easy.

Thank you for your attention, patience and advice, guys! 

5
Hi anarchist!

This approach is not correct. What you want is the entities to start on the start position, move right and then, when they have reached a predefined position on the right they appear on the left.

Do you mean ALL tree entities in the scene must have X=0 as their starting point? In that case how do we prevent them from overlapping each other (set a space/time delay between them)?

I would also rethink what to use in the while() statement. You probably want this script to run for a specific duration of time, so you could probably use a counter variable.

The reason for me placing the x-axis coordinates in the while() statement is that I misunderstand how this script could work for multiple tree entities, not just one. Or should there be a separate loop for each entity?

4. In terms of question 3 I thought maybe if there was a way to only display a central area of the scene background, then the tree entities had enough time and space to appear at their initial positions while we don't see them, move across the visible scene area and then reach the limit positions in the second area that we don't see. Does that make sense? If yes, how do we display the central part of 2400 X 600 background? What can I make in SceneEdit or in scene_init.script?

Hope this screen will illustrate what I mean: 



I still don't know the way to only display a central part of the long background image so that the starting and end destinations of tree entities were invisible. Any advice?

THANK YOU for your attention, time and friendly help!

6
Hi anarchist,

Please kindly view these questions:

What you need to do is have an if() statement inside the while loop, which will check whether the tree has moved too much, and reset its X position to 0.

1. Does this script express your point?

Code: WME Script
  1. treebg1.X=0;
  2. while (treebg1.X<800+512)
  3.   {
  4.     treebg1.X = treebg1.X+1;
  5.     Sleep(2);
  6.         if(treebg1.X == 1200)
  7.         {
  8.           treebg1.X=0;
  9.         }
  10.   }

I tried it and it worked! The tree entity (treebg1) started racing across the screen repeatedly. However I have some doubts, if it is okey from your point of view.

2. I tried to think how this script could be applied to other tree entities and a house entity. Will the following approach be correct?

Code: WME Script
  1. treebg1.X=0;
  2. treebg2.X=100;
  3. while (treebg1.X<800+512 + treebg2.X<800+336)
  4.   {
  5.   treebg1.X = treebg1.X+1;
  6.   Sleep(2);
  7.         if(treebg1.X == 1200)
  8.         {
  9.           treebg1.X=0;
  10.         }
  11.  
  12.   treebg2.X = treebg2.X+1;
  13.     Sleep(0);
  14.         if(treebg2.X == 2000)
  15.         {
  16.           treebg2.X=100;
  17.         }
  18.   }

3. The code from the previous question seems to work, yet entity sprites behave oddly - they sometimes appear from the left edge of screen as if right from the air, from nowhere (not from behind the left edge). And sometimes first tree joins second tree on the run like the engine doesn't manage to "draw" it in time :D Well, of course, WME is not the reason, and I blame my imperfect math knowledge. Is there a way to improve this scenario somehow to make the entities  emerge more naturally?

4. In terms of question 3 I thought maybe if there was a way to only display a central area of the scene background, then the tree entities had enough time and space to appear at their initial positions while we don't see them, move across the visible scene area and then reach the limit positions in the second area that we don't see. Does that make sense? If yes, how do we display the central part of 2400 X 600 background? What can I make in SceneEdit or in scene_init.script?

Hope this screen will illustrate what I mean: 



THANK YOU, anarchist! The scene starts getting closer and closer to what it was thought to be, yet there are some things I can't resolve without help from the community.

7
Dear Muties! Still need your help with the scene. eborr's code works fine, yet I tried to set it to repeat numerous times and... nothing.

How is it possible to make an entity (such as treebg1) move across the scene over and over again?

THANK YOU for your attention and help!

8
Technical forum / Re: Strangest problem ever - registry path sound troubles
« on: December 07, 2017, 06:32:06 PM »
However, I found the root of the problem.

Hi Mikael!

I am glad you found solution of your problem.

9
Technical forum / Re: Second actor creation and cutscene
« on: December 05, 2017, 09:36:07 PM »
Great article!  :)

Hey NAItReIN!

THANK YOU for your kind words! Btw I sent you a personal message with a question. Please kindly view it and tell me what you think.  ;)

10
Technical forum / Re: Strangest problem ever - registry path sound troubles
« on: December 05, 2017, 09:34:18 PM »
However, when I change the registry path, the sound suddenly only comes from the left channel! When I change back to the previous registry path, the sound comes from both channels again. This happens both with the compiled version and when I start the game from within WME. I'm on Win 8, but tested it on my Win 10 computer too, with the same result. It couldn't possibly be a hardware problem since it only affects my newly created registry paths.

Hey Mikael,

I am sorry for asking this, but why do you need to change the registry path? What are you trying to achieve by doing this?

I am quite new to WME and don't understand much in computers, so I just wanted to know.

11
you need to set the sleep to between 5 and 10 otherwise it will take ages to cross the screen

eborr, I am sorry for asking you about the car entity animation. Have just solved this by setting move.sprite in car.entity by default  :) .

Anyway I don't know how it is possible to make the tree entity appear at its initial position over and over again once your script has run (like in this screen)



and how to make this stop at a given moment. Should the script be modified? Or is it another script?

THANK YOU, eborr!

12
you need to set the sleep to between 5 and 10 otherwise it will take ages to cross the screen

Hey eborr, you did this! The tree runs across the scene behind the car sprite  ;D

However, I had to disable car entity animation (that imitated its movement) in this line

Code: WME Script
  1. car.PlayAnim("entities\car\sprites\move.sprite"); //Set the car in motion

because otherwise your code wouldn't cause the tree entity move.

1. Is that possible to keep both the car entity animation and your script running?
2. Also the tree entity only moved to the right once. How do we cause it return to the initial position and repeat its path across the scene? How do we stop this behavior at a given moment?

to get the KNOSSOS demo

www.svarunentertainment.com

I will download and try the demo, eborr.

THANK YOU for your kind attention and help!

13
Technical forum / Re: Second actor creation and cutscene
« on: December 03, 2017, 02:39:59 PM »
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.

Hey anarchist! The tutorial based on your advice is now available in "How-to" articles in Knowledge Base. You can find it here http://res.dead-code.org/doku.php/kbase:how_to_make_scene_auto-scrolling_in_wintermute_engine.

Please kindly view it and tell me if something is incorrect or vague (I want beginners like me get a clear guide).

THANK YOU!

14

2. Is there a way to kinda lock actors' movement in the x-axis, so that they moved in a straight horizontal line, without swaying up and down in the y-axis? The point is there won't be any depth in my game, everything's pretty flat. Previously I asked this in one of the previous topics and anarchist shared a brilliant idea of making two blocked regions with a narrow walking path between them for actors. Still, sometimes I notice actor sprites do sway up and down a bit within that walking stripe. Is there a code to ban actors from moving in the y-axis at all or is keyboard control with LEFT and RIGHT keys the only way to provide movement in a perfect horizontal line?

Guys, any ideas about the second question?

Thank you for your thoughts and practical experience!

15
Hi eborr!

Not wishing to sound harsh but all you do is to reset the x,y coordinnates for each object within a loop.

You don't sound harsh, not at all - maybe a bit sophisticated  :), but that's the question of your experience in scripting compared to mine.

I added this piece of code to scene_init.script:

Code: WME Script
  1. treebg1.X=0;
  2. while (treebg1.X<800+512)
  3.   {
  4.     treebg1.X = treebg1.X+1;
  5.     Sleep(1000);
  6.   }

However nothing really changed - the treebg1 entity isn't moving anywhere.

Guess the problem is I misunderstand following things:

1. Should background trees be one big entity sprite or separate entities?
2. How exactly do I move the tree entities along the x-axis? What method or command should be used?

You set this up as a script you can call, and invokr it for the duration.

3. I am sorry, could you please provide more details?

If you want to see this in action look at the cars in the background in the K'NOSSOS tutorial.

4. Where could I read or download the tutorial to see the cars in the background?

THANK YOU, eborr!

Pages: [1] 2 3 ... 5

Page created in 0.42 seconds with 17 queries.