Please login or register.

Login with username, password and session length
Advanced search  


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.

Topics - mRax

Pages: [1] 2
Fixed / About m_DrawOffset*
« on: September 14, 2009, 08:15:33 AM »
Probably those are not bugs, but

1. I suppose, .SetMousePos method must be
Code: [Select]
int x = Stack->Pop()->GetInt();
int y = Stack->Pop()->GetInt();
x = max(x, 0); x = min(x, m_Renderer->m_Width);
y = max(y, 0); y = min(y, m_Renderer->m_Height);
p.x = x + m_Renderer->m_DrawOffsetX;
p.y = y + m_Renderer->m_DrawOffsetY;
CBPlatform::ClientToScreen(m_Renderer->m_Window, &p);
CBPlatform::SetCursorPos(p.x, p.y);

return S_OK;
instead of
Code: [Select]
int x = Stack->Pop()->GetInt();
int y = Stack->Pop()->GetInt();
x = max(x, 0); x = min(x, m_Renderer->m_Width);
y = max(y, 0); y = min(y, m_Renderer->m_Height);
p.x = x; p.y = y;
CBPlatform::ClientToScreen(m_Renderer->m_Window, &p);
CBPlatform::SetCursorPos(p.x, p.y);

return S_OK;

2. The same goes to .CreateParticleEmitterBone method. Last one doesn't respect m_DrawOffset* values.

Fixed / VAL_BOTTOM failed
« on: August 27, 2009, 01:16:44 PM »
Hello! Vertical text alignment of the label in the window
Code: [Select]

will be VAL_CENTER for some reason. Not VAL_BOTTOM. Did I make a mistake somewhere? ???

Technical forum / Actor3DX.AlphaColor
« on: July 23, 2009, 09:16:11 AM »
It looks like .AlphaColor property hasn't effect on Actor3DX-type objects. Is there some reason for such thing? ??? (The property worked with Actor2D...)

WME sources discussion / Mouse position & maximilized window
« on: February 13, 2009, 04:05:08 PM »
There is a little interesting bug. When game is in window mode (not fullscreen) and game window is stretched like desktop wallpaper, mouse position is calculated wrong.

For example, there are desktop resolution 1280x800 and game window resolution 1280x1024. When game window is maximilized, then its lower part is inaccessible, because of windows mouse position isn't translated properly to stretched window position. The bottom of mouse position (x,800) translated surely into game as it is (x,800) instead of (x,1024).

Here is possible modification, bold font style is used to show changes. (Well, is it good idea to write about all that in `sources discussion`?  ???)

Quote from: bgame.cpp
void CBGame::GetMousePos(POINT* Pos)
   CBPlatform::ScreenToClient(Game->m_Renderer->m_Window, Pos);

   Pos->x -= m_Renderer->m_DrawOffsetX;
   Pos->y -= m_Renderer->m_DrawOffsetY;

   //cursor position modification while window is maximized
      HWND hWnd = Game->m_Renderer->m_Window;
      if(GetWindowPlacement(hWnd, &wndpl))
         if(wndpl.showCmd == SW_SHOWMAXIMIZED)
            RECT hWnd_rect;
            GetClientRect(hWnd, &hWnd_rect);
            Pos->x *= Game->m_Renderer->m_RealWidth;
            Pos->x /= hWnd_rect.right;
            Pos->y *= Game->m_Renderer->m_RealHeight;
            Pos->y /= hWnd_rect.bottom;

   if(m_MouseLockRect.left != 0 && m_MouseLockRect.right != 0 && != 0 && m_MouseLockRect.bottom != 0)
      if(!CBPlatform::PtInRect(&m_MouseLockRect, *Pos))
         Pos->x = max(m_MouseLockRect.left, Pos->x);
         Pos->y = max(, Pos->y);

         Pos->x = min(m_MouseLockRect.right, Pos->x);
         Pos->y = min(m_MouseLockRect.bottom, Pos->y);

         POINT NewPos = *Pos;
         CBPlatform::ClientToScreen(Game->m_Renderer->m_Window, &NewPos);
         CBPlatform::SetCursorPos(NewPos.x, NewPos.y);

I'm sorry for my English, but guess you're understanding what I'm talking about...

P.S. That stretched window is a great way to make game for several screen resolutions. Meaning 1280x1024 window fits perfectly for all desktop resolutions (1280x1024, 1280x800, 1024x768, 800x600, e.t.c.) of 4:3 monitor. I'm talking about window mode, of course.

Technical forum / Several idle-animations
« on: February 13, 2008, 03:43:46 PM »
Hi! I used several "idle" animations in the project. Between two "idle" animations I want to play special "intermediate" animation. It`s not very bad, huh, but after that intermediate animation user can see previous idle just for a moment (or maybe, intermediate animation`s beginning): actor "jumps" quickly between "idles".

This is a piece of code
    var n;
    if(form=="")n="sit";else n="";

Technical forum / Alpha-channel in the .tga texture
« on: February 07, 2008, 04:15:54 PM »
Hello! I've just looked for subject in the threads, but finally not found anything. So I'm sorry, I'm going to ask one question :)

Is in WME some texture requirements? I tried to make "half-transparent" actor3d`s glasses (alpha-channel), and not successfull. Those glasses made actor`s piece behind itself is invisible ???

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?

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 :)

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

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\"
  3. var a0=255;
  4. var r0=255;
  5. var g0=255;
  6. var b0=255;
  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. }

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;

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]
And the start animation wasn't played only. Then I modify it to the

Code: [Select]
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).

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;
  var obj=Game.ActiveObject;
    else Game.PlaySound("sounds\menu\button_off.wav");

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

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)?

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?

Technical forum / In-game notes
« on: January 16, 2007, 04:19:24 PM »
Good morning! I have one question :) The situation is in item "notebook", player have to read some notes to solve quest successfully. How can I print these notes before notebook sprite entity? (sprite entities for words/sentences aren't desired) Also I need in the fade-in effect: notes aren't showen quickly (at the moment), but each word are written letter-to-letter slowly...

The simple solution is in usage window with many captions, buttons or edits... But maybe there are pretty and more "unversal" way, aren't there?

Technical forum / Waiting for transition between two animations
« on: December 14, 2006, 09:59:03 AM »
Hello, I have new question:
Code: [Select]
... // ("body": actor is doing something here)
When body is the simple short code, there is all ok. But when body is using long procedures/object methods, there had been appeared one effect: actor return to previous state quickly (a state is just before .PlayAnim("sit_down") method called, maybe it's idle animation), and when body is over, actor had played "smoothly transition" to the first "stand_up" animation frame, and then played "stand_up" animation. Both animations -- sit_down and stand_up -- aren't looping.

Huh... :) Well, is there property like .AnimTransitionTime for waiting before actor's state would dropped or started transition between two animations?

P.S. Now I'm planning to use several idle animations (especially, last frame of each animation). But maybe there is some way to "freeze" actor, isn't there?

Pages: [1] 2

Page created in 0.051 seconds with 93 queries.