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.

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

Pages: 1 [2] 3 4
16
Technical forum / Windows and z-order
« on: June 29, 2007, 10:59:35 AM »
Hello! I have very simple question ;D

Code: WME Script
  1. var note=Game.LoadWindow("windows\notebook\notebook.window");
  2. var tool=Game.LoadWindow("windows\toolbar\toolbar.window");

note window is fullscreen, while tool one is in corner. Player have access to these windows - he can click on note or tool control elements.

But when player clicks on note window, tool window suddenly :( becomes inaccessable. As I understand tool window moves after note one in z-order ??? How can I restore original state: both note and tool windows are accessible?

17
Technical forum / Re: Background music and .LoadActor3D() method
« on: April 06, 2007, 09:39:16 AM »
Thanks! I'll try my best ;D

18
Technical forum / Background music and .LoadActor3D() method
« on: April 06, 2007, 08:52:57 AM »
Hello! The trouble just is in music, while actor3dx objects have been loading. Sometimes the music are gone in cycles or temporary interrupted and continued playing then. This time players (like Media Player Classic or VLC) are working properly. Is way to play music without such awful damages?

Because of the music after all I decide to load all actors at the game launch. So the it is clear, but then new problem is appeared. If several actor3dx objects are loaded (even .Active property is FALSE), the game shows 30 FPS instead of 50 one. As I understand 20 FPS "are eaten" by loaded actor's scripts. Can I "freeze" or temporary detach these scripts?

Sorry for my English, but I really don't know how to describe this trouble better than it is :)

19
Technical forum / Re: Troubles with alpha
« on: April 03, 2007, 11:23:47 AM »
Thanks you too :)

Code: Text
  1. e=w.GetControl("1");e=e.GetEntity();e.Rotatable=TRUE;e.Rotate=350;

Now it worked properly.

And what about this?

Code: Text
  1. c=w.GetControl("1");
  2. e=c.GetEntity();
  3. e.FadeTo(0,0,0,0,1);    // entity must be transparent, but it isn't
  4. c.Visible=TRUE; // entity container appears "suddenly" (because of the entity is not transparent)
  5. e.FadeTo(TIME,255,255,255,255); // entity must fade in from transparent state, but there isn't any action

Did I make a mistake somewhere?  ???

20
Technical forum / Re: Black Screen before ChangeScene()
« on: April 02, 2007, 12:28:34 PM »
If I understand correctly, you can do next

Code: Text
  1. var Win = Game.LoadWindow("name");
  2.  
  3. Win.Center();
  4. Win.GoSystemExclusive();
  5.  
  6. Scene.FadeOut(0,0,0,0,255);     // Scene become black at the moment
  7.  
  8. Game.UnloadObject(Win);
  9.  
  10. Game.ChangeScene("name");

21
Technical forum / Re: Troubles with alpha
« on: April 02, 2007, 12:18:00 PM »
Thanks for help!

Any reason why you don't use MakeRGBA?

Gya-a! :o Now I use MakeRGBA()! :D

Are you sure your alpha color is set properly?

Yes, I'm sure. It's worked fine, when .Rotatable property is FALSE

I tried the same with an entity embedded into an entity container - also works

It's strange. I have bad feelings ::) Maybe, I misunderstand something. Anyway...

Code: Text
  1. //e=w.GetControl("1");e=e.GetEntity();e.Rotatable=TRUE;e.Rotate=350;

If I erased "//", the entity turned to angle, but .FadeTo() method broke suddenly. (So "1"'s entity didn't appear slowly)

Code: Text
  1. c=w.GetControl("1");
  2. e=c.GetEntity();
  3. e.FadeTo(0,0,0,0,1);
  4. c.Visible=TRUE;
  5. e.FadeTo(TIME,255,255,255,255);

Entity .FadeTo() method didn't work at all, when the entity was in the entity container. (.AlphaColor property didn't have any effect)

Links.

The example (temporary file erased)

22
Technical forum / Troubles with alpha
« on: March 30, 2007, 12:09:04 PM »
Hello!

Sometimes I have a strange trouble with alpha.

Code: Text
  1. w=Game.LoadWindow("scenes\test\w4.window");
  2. w.FadeTo(0,1,0,0,0);
  3. //e=w.GetControl("1");e=e.GetEntity();e.Rotatable=TRUE;e.Rotate=10;
  4. w.Visible=TRUE;
  5. w.FadeTo(1000,255,255,255,255);
  6. Sleep(10000);
  7. w.FadeTo(1000,1,0,0,0);
  8. w.Visible=FALSE;
  9. Game.UnloadObject(w);

.FadeTo() method is based on window's .AlphaColor property. So it works fine! But when I enable marked line (especially, e.Rotatable=TRUE; operator), the entity always becomes visible, and the changing of .AlphaColor doesn't take effect. If I write e.Rotatable=FALSE; operator, it works fine again. I'm embarassed :) What the matter? Is trouble in the entity container or something else?

Although, .Rotatable is worked. And .AlphaColor not :)

Here is the piece of advanced script, attached to window

Code: Text
  1. #include "scripts\base.inc"
  2.  
  3. var a0=255;
  4. var r0=255;
  5. var g0=255;
  6. var b0=255;
  7.  
  8. method FadeTo(duration,a,r,g,b){
  9.   if(a==NULL)a=0;
  10.   if(r==NULL)r=0;
  11.   if(g==NULL)g=0;
  12.   if(b==NULL)b=0;
  13.   var tmp=Scene.GetNode("temp_entity");
  14.   var t0=Game.CurrentTime;
  15.   tmp.AlphaColor=this.AlphaColor;
  16.   if(tmp.AlphaColor==NULL||tmp.AlphaColor==0){
  17.     a0=255;
  18.     r0=255;
  19.     g0=255;
  20.     b0=255;
  21.   }
  22.   //Game.LOG("=WINDOW "+this.Name+" FADES=");
  23.   //Game.LOG("FROM: "+a0+" "+r0+" "+g0+" "+b0);
  24.   //Game.LOG("  TO: "+a+" "+r+" "+g+" "+b);
  25.   while(TRUE){
  26.     var dt;
  27.     if(duration>0)dt=(Game.CurrentTime-t0)/duration;else dt=1;
  28.     if(dt<0)dt=0;
  29.     if(dt>1)dt=1;
  30.     tmp.AlphaColor=0;
  31.     tmp.AlphaColor=tmp.AlphaColor*256+a0+(a-a0)*dt;
  32.     tmp.AlphaColor=tmp.AlphaColor*256+r0+(r-r0)*dt;
  33.     tmp.AlphaColor=tmp.AlphaColor*256+g0+(g-g0)*dt;
  34.     tmp.AlphaColor=tmp.AlphaColor*256+b0+(b-b0)*dt;
  35.     this.AlphaColor=tmp.AlphaColor;
  36.     if(dt==1){
  37.       if(a==255&&r==255&&g==255&&b==255)this.AlphaColor=NULL;
  38.       a0=a;
  39.       r0=r;
  40.       g0=g;
  41.       b0=b;
  42.       break;
  43.     }
  44.     Sleep(50);
  45.   }
  46. }

23
Technical forum / Re: Window events handler
« on: March 13, 2007, 04:31:07 PM »
Thanks :) What about responses in the ResponseBox? Are LeftClick, MouseEntry and MouseLeave events in responses?

24
Technical forum / Animation methods surprise
« on: March 13, 2007, 12:38:06 PM »
Hello everyone! :)

I find out a strange situation, when .PlayAnim*() methods are working, but the object isn't playing a specified animation. That means there aren't any warnings/errors and

Code: [Select]
var t=Game.CurrentTime;
this.PlayAnim("anim");
t=Game.CurrentTime-t;

the variable t has one value only. But sometimes the object play anim animation and sometimes not (as I said, "play" means, that player see the animation. Anyway .PlayAnim() take typical t time). I guess, what is it really may be ???

...

Well, the trouble was disappeared, when I erased next line

Code: [Select]
this.PlayAnimChannelAsync(1,"start");
And the start animation wasn't played only. Then I modify it to the

Code: [Select]
this.PlayAnimAsync("start");
but the start animation isn't played again ;D The information about channels in documentation is very poor to understand this situation. So, can somebody explain it to me?

As I thought, 0-Channel is default channel for idle, walk, talk - animations. I used 1-Channel and that was all I need ;) the trouble was appeared. idle animation and the start one must play simulanteously (they describe different bones/dummies, so must work).

25
Technical forum / Window events handler
« on: March 09, 2007, 02:31:50 PM »
Hello! :) I need in a little advice. The trouble is in playing sound, when mouse pointer is become on button (or, equally, when WME automatically use back_hover image for button).

I didn't find any window events in documentation, so I'm thinking about solution in entities now, i.e.

Code: [Select]
var lst=NULL;
while(TRUE){
  var obj=Game.ActiveObject;
  if(obj!=lst){
    if(obj.Caption=="button")
      Game.PlaySound("sounds\menu\button_on.wav");
    else Game.PlaySound("sounds\menu\button_off.wav");
    lst=obj;
  }
  Sleep(AMBIENT_LAG);
}

But what about window events? Or any other ideas? :)

26
Technical forum / Re: Window or entity before ResponsesBox
« on: March 02, 2007, 08:16:04 AM »
It's worked! Thanks! :)

Although I found useful to create upper window with 0-Height and without clipping, but your way is better, than my one.

27
Technical forum / Window or entity before ResponsesBox
« on: March 01, 2007, 07:04:24 PM »
Hi! :)

I need to put responses box under transparent (or semi-transparent) image, but responses are always on top. I try use window before ResponsesBox, well, it works, but in this case I can't choose any response because of window. I try set .Interactive property of the window to FALSE, but it isn't work ???

Can I create non-interactive visible window? Or is the solution to put responses box under non-interactive sprite(s)?

28
Technical forum / Several actors - one .x file
« on: February 08, 2007, 08:57:07 AM »
Hello :)
Code: Text
  1. var a=Scene.LoadActor3D("actors\a\a.act3d");
  2. var b=Scene.LoadActor3D("actors\a\a.act3d");
  3. var c=(a==b);//FALSE
Question: is there way to use one resource (.x file) with several actors? For example, I need in 10 clones. So, if actor's size is 1 MB, I need in 10 MB RAM. It's not good, huh.
Code: Text
  1. var a=Scene.LoadActor3D("actors\a\a.act3d");
  2. var b=a;
  3. var c=(a==b);//TRUE
Has WME a method like
Code: Text
  1. var a=Scene.LoadActor3D("actors\a\a.act3d");
  2. var b=Scene.ReplicateActor3D(a);
  3. var c=(a==b);//FALSE
?
Variables a and b may contain of different description (Scale, e.t.c.), but use one memory resource. And so?

29
Technical forum / Re: In-game notes
« on: February 05, 2007, 03:52:21 PM »
Hi again, I'm sorry, but I don't really understand, how fonts are worked :( Can someone give me a little "sample"? For example, I used window in data package
Code: [Select]
WINDOW{
  X = 0
  Y = 0
  WIDTH = 1280
  HEIGHT = 1024
  NAME = "notebook"
  FONT = "fonts\note.font"
  SCRIPT = "scenes\items\notebook\scr\notebook.script"
  VISIBLE = FALSE
  STATIC{
    NAME = "page0"
    TEXT = ""
    TEXT_ALIGN = "left"
    VERTICAL_ALIGN = "top"
    ;BACK = "ui_elements\but_normal.image"
    FONT = "fonts\note.font"
    X = 130
    Y = 209
    WIDTH = 440
    HEIGHT = 580
    VISIBLE = TRUE
  }
}
with note.font in second localization package
Code: [Select]
TTFONT{
  SIZE = 23.8
  FACE = "Arial"
  FILENAME = "fonts\arial.ttf"
  BOLD = FALSE
  ITALIC = FALSE
  UNDERLINE = FALSE
  STRIKE = FALSE
  CHARSET = 1
  COLOR { 0, 0, 0 }
  ALPHA = 255
  LAYER{
    OFFSET_X = 0
    OFFSET_Y = 0
    COLOR { 0, 0, 0 }
    ALPHA = 255
  }
}
Maybe the trouble is in separate packages? (fonts isn't in primary data package, but in another)

30
Technical forum / Re: In-game notes
« on: February 02, 2007, 04:16:23 PM »
Thanks :)

Pages: 1 [2] 3 4

Page created in 0.146 seconds with 174 queries.