Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Pages: 1 ... 8 9 [10]
 91 
 on: December 03, 2017, 02:09:39 PM 
Started by Indra Anagram - Last post by Indra Anagram

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!

 92 
 on: December 03, 2017, 02:00:40 PM 
Started by Indra Anagram - Last post by Indra Anagram
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!

 93 
 on: December 02, 2017, 11:48:51 PM 
Started by Indra Anagram - Last post by eborr
Not wishing to sound harsh but all you do is to reset the x,y coordinnates for each object within a loop. I dont have access to a win box at the moment but the code goes something like this


Myobejct.X =0;
while (Myobject.X <Screensize+objectsize)
  {
    Myobject.X = Myobejct.X +1;
    SLEEP(<some int >);
  }

Obviously this ie not pure WME script but I hope you get the general idea. You set this up as a script you can call, and invokr it for the duration. If you want to see this in action look at the cars in the background in the K'NOSSOS tutorial.

 94 
 on: December 02, 2017, 08:11:13 PM 
Started by Indra Anagram - Last post by Indra Anagram
Indra Anagram, please, see image bellow

NAItReIN, I've just changed X and Y values in speaker.entity file and guess what? The subtitle text left its initial position at the top of screen and moved closer to its center! Which means in this method subtitles are completely dependent on the position of entity sprite)))

Without your screen I probably wouldn't have guessed.

 ::rock

Yay! THANKS!!!

 95 
 on: December 02, 2017, 07:59:11 PM 
Started by Indra Anagram - Last post by Indra Anagram
Indra Anagram, please, see image bellow

Hey NAItReIN!

You never give up, I see!  ;)

BIG THANKS for your enthusiasm in helping beginners like me on this forum.

I have looked at your screenshot. As I far as I can tell, it contains
Quote
on "LeftClick"
, so in order to see that subtitle a player must use a mouse. See, my initial point was a scene with voice and text that sound and appear while the game is not interactive. Automatically you might say)

Have made some changes to the code of speaker.script according to your lines in the screenshot, however it changed nothing. The thing is just stuck up there at the top!

And... what do we do with this?

Code: WME Script
  1. var entSpeaker = Scene.LoadEntity("entities\speaker\speaker.entity");
  2. entSpeaker.Talk("THANK YOU, NAItReIN!", "1.3.ogg");


I mean LeftClick thing and invisible speaker.

You and anarchist are my heroes whatever  ::thumbup

 96 
 on: December 02, 2017, 07:36:00 PM 
Started by Indra Anagram - Last post by NAItReIN
Quote
Hey NAItReIN, the error's gone! However, the text is still glued to the top of screen. Sorry, I don't know what's the reason.

Indra Anagram, please, see image bellow:

 97 
 on: December 02, 2017, 03:20:53 PM 
Started by Indra Anagram - Last post by Indra Anagram
Hi anarchist!

Sorry, there was some issue with the .window file on my side - once I opened it in the Notepad after WindowEdit, WindowEdit refused to re-open it ('unsupported file format').

It seems everything works fine now.

First, the sound file was playing over and over again, till I found Looping parameter in the Documentation and set it to "false". So, now it plays once, just like it should.

I've got a question, though... What if I have a long text that is better to show sentence by sentence on screen (in this window?). What do I change in the code or files? Do I create a new window for each sentence and sound file? Or is there a way to "erase" first sentence within the same window and play another sound file at the same time? What was your background in that regard? Please, share your thoughts.

I tried your and NAItReIN's advice - both worked. NAItReIN's decision seems more flexible and logical in function (changing text sentence by sentence, for instance), but yours succeeded in terms of design. Plus I had some new experience with creating windows))

THANK YOU, anarchist!

 98 
 on: December 02, 2017, 02:11:06 PM 
Started by Indra Anagram - Last post by Indra Anagram
Now it should works fine  :)

Hey NAItReIN, the error's gone! However, the text is still glued to the top of screen. Sorry, I don't know what's the reason.

THANK YOU for your help!

 99 
 on: December 02, 2017, 12:16:44 PM 
Started by Indra Anagram - Last post by NAItReIN
Hi Indra Anagram  :)

I'm sorry I made a mistake. There is a problem with this line:
Code: WME Script
  1. this.SubtitlesPosXCenter = center
has to be
Code: WME Script

Now it should works fine  :)

 100 
 on: December 02, 2017, 07:18:38 AM 
Started by Indra Anagram - Last post by Indra Anagram
Hey NAItReIN,

You should use Talk method. See what does documentation say:

Talk(Text, SoundFilename, Duration, TalkStances, TextAlignment)
TalkAsync(Text, SoundFilename, Duration, TalkStances, TextAlignment)

Makes the object talk.
Parameters :

Text

A text to be used as a talk subtitle

SoundFilename
A filename of a sound file to be used (oprtional, default is no sound)


The good news is once I added a comma and the name of a sound file to this line:

Code: WME Script
  1. entSpeaker.Talk("Hi Indra Anagram, how are you today?", "1.3.ogg");

the sound file started playing while the text is on screen. THANK YOU!

As for this:

Code: WME Script
  1. #include "scripts\base.inc"
  2. this.SubtitlesPosRelative = false;
  3. this.SubtitlesPosX = 250;
  4. this.SubtitlesPosY = 500;
  5. this.SubtitlesWidth = Game.Width - 100;
  6. this.SubtitlesPosXCenter = center.

there were some issues.

First, I got the following error in Debugging console:

Quote
11:56:33:  Compiling script 'entities\speaker\speaker.script'...
11:56:33:    Error@line 7: syntax error

I thought maybe the problem was in the period, changed '.' to ';' and the error@line7 disappeared, but a new one showed up:

Quote
11:57:28:  Compiling script 'entities\speaker\speaker.script'...
11:57:28:    Error@line 6: Variable 'center' is referenced but not defined

And this code does not change anything - the text has default position at the top of screen  :) I played with it commenting out line by line and changing 'false' to 'true', but it didn't cause the text move to the positions we wanted.

Any ideas what could be the reason? And how to eliminate error@line 6?

THANKS!

Pages: 1 ... 8 9 [10]

Page created in 0.223 seconds with 14 queries.