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

Pages: [1] 2
2
Technical forum / Re: how to create ourself's Async methods?
« on: August 19, 2008, 03:30:20 PM »
You mean methods that return immediately and run in a separate thread? That currently isn't possible. You can simulate this using events, but of course, events don't have parameters.

Code: WME Script
  1. this.ApplyEvent("parallel_task");
  2. // some code 1
  3.  
  4. on "parallel_task"
  5. {
  6.   // some code 2
  7. }
  8.  

Some code 1 and some code 2 will run in parallel after executing this script.
thanks very much,i think that's enough.i will try it later.

3
Technical forum / how to create ourself's Async methods?
« on: August 19, 2008, 10:29:15 AM »
The engine has some Async methods,can we define it by  ourself?thanks. :)

4
Technical forum / a solution to develop multiply players game by WME
« on: August 14, 2008, 07:17:40 AM »
I use WME developed a  multiply players game.The server use JAVA +Tomcat+ SQL SERVER2000.player can login the server,chating each other,also can upon the game data to  server and query reports from server.player can see others moving,speaking in himself's client.here is the screenshot:
multiply player:

user login:

regist user:

scene1:

scene2:

scene3:


  • game background:    
        This is a business  simulation RPG game,players(3-6 players) set up some  companies,each play acts a duty such as CEO,CFO,CTO and so on.
    Each company will receive a sum of money at the first,then every need to do lots of things:hire office,buy productlines,invite employees,buy materials,design and develop new products,sell products........., all of the companies will compete each other.
  • game frame
        I decided to use WME to finish the game client.of course the game need a server program(i use java write some struts actions and use tomcat to run it,game data was stored into the sql server2000).
  • network
        The WME client program can connect to the JAVA web server?yeah,it seems impossible if we only use itself's ability.so we use delphi writen a DLL file.There is some functions in the DLL,one of them called http_get(url,result),ok,now we can call it in the game script by follow  steps:
    1.declare the dll function in the base.script:
    external "gui.dll" int http_get(string,string);//arg1:http url address;arg2:return value
    2.we can call it like this:
    var rt=new String(100);
    http_get("http://www.dead-code.ogr/test.jsp?arg=1&arg=2&arg=3...",rt);

    we send our client program's data by arg=1&arg=2&arg=3...,and the server will return the result in variable  rt,our server sometime return a XML string and sometime return a split string(ex:"123#456#abc#def").
    we call DLL  function to  parse XML string and call WEM's String.Split(..) to parse split string.String.By the way,String.Split(..) has  more high performace than DLL XML function.
  • GUI
        The WME itself's GUI is not strong,we use jsp web page(html,css,javascript....) to  implemented  most of the windows,the WME client open this page by call the DLL function http_webbrowser(url).This solution cause our game can only run in the window mode.........,but i think it's worthwhile.
  • multiply player
         client  side
        Our WME Client  store the players in a global array:
        actors["tom"]=Game.LoadActor3D("actors\....\p.act3d");
        We can get every actor by their name:
        var act=actors["tom"];
        server side
        We have a table to store all player's location,scene....,each WME Client  need to report it's latest status and  get the players list from server  at a certain time rate(such as every 100ms),

    var rt=new String(2000);
    http_get("http://...../LoginAction.do?p0=9&p1="+courseid+"&p2="+companyid+"&p3="+studentid+"&scene="+Scene.Name+"&actor="+actor.Name+"&x="+actor.X+"&y="+actor.Y,rt);   

    by parasing the string rt. our client program can know how many actors are online,each one's location,scene,who are speaking,speaking what.....
  • others
    how to display a custom text on the head of the actor?
    do it in the actor's script like this:

    var WinSubtitles;
    var tiptitle;
    while(1)
    {
    if(WinSubtitles==null)
    {
    WinSubtitles = Game.CreateWindow("subtitles_window");
    //WinSubtitles.SetImage("interface\bst\actor_card.tga");
    }
    if(tiptitle==null)
    {
    tiptitle= WinSubtitles.CreateStatic("speaker_name");
    tiptitle.SizeToFit();
    tiptitle.SetFont("fonts\arial_Í·²¿Ìáʾ-´Î.font");
    }
               // position the subtitles window
       WinSubtitles.X = this.X-Scene.OffsetX-32;
       WinSubtitles.Y = this.Y - this.Height-25;
       WinSubtitles.Width =100;
       WinSubtitles.Height = 45;
       WinSubtitles.Visible = this.Active;
       // position the speaker name
       tiptitle.X = 0;
       tiptitle.Y = 0;
       tiptitle.Width =WinSubtitles.Width;
       tiptitle.Height = WinSubtitles.Height;
       tiptitle.TextAlign = TAL_LEFT;
       tiptitle.VerticalAlign=VAL_TOP;
       tiptitle.Text =this.Caption;
      Sleep(20); 
    }

    how to use our cusutom talk method?
    do it in the actor's script like this:

    • var subtitle;
      var msgtext;
      method MsgText(msg,t)
      {
      var l=msg.Length;
      if(l>84) return;
      var tt=t;
      if(subtitle==null)
      subtitle = Game.CreateWindow("subtitles_window1");
      if(msgtext==null)
      msgtext= subtitle.CreateStatic("speaker_name1");
      msgtext.ParentNotify=true;

      msgtext.SetFont("fonts\arial_????-?.font");   
      msgtext.TextAlign = TAL_LEFT;
      msgtext.VerticalAlign=VAL_CENTER;
      subtitle.Width =310;
      subtitle.Height =230;
      msgtext.Width =275;
      msgtext.Height =285;

      msgtext.Text =ToString(msg);
      subtitle.SetImage("interface\bst\msg1.png");
      subtitle.Width =55;
      subtitle.Height =35;
      msgtext.Width =40;
      msgtext.Height =25;
      msgtext.X =6;
      msgtext.Y =6;
      subtitle.Visible = this.Active;
      subtitle.MoveBefore(WinSubtitles);
      while(tt)
      {
      subtitle.Y = this.Y - this.Height-subtitle.Height;
      subtitle.X = this.X-Scene.OffsetX-28;
      Sleep(20);
      tt=tt-20;
      }
      subtitle.Visible=false;
      }



5
Game announcements / Re: a multiply players game developed by WME.
« on: August 14, 2008, 07:05:41 AM »
WTH!!!! That looks awesome. I didn't know external coding could allow for a multiplayer game in WME. This must be a breakthrough. More info would be great.

Cheers ::beer
Myles Blasonato
PS: I wish i could play the game but i can't read that  language :(
::beer
the language is chinese,welcome to BeiJing,the Olympic Games is in progress.

6
Game announcements / Re: a multiply players game developed by WME.
« on: August 14, 2008, 05:32:40 AM »
haha :D,first,thanks for Mnemonic's perfect working.WME is powerful!!I will write some technical details so any others can  use for reference.

  • game background:    
        This is a business  simulation RPG game,players(3-6 players) set up some  companies,each play acts a duty such as CEO,CFO,CTO and so on.
    Each company will receive a sum of money at the first,then every need to do lots of things:hire office,buy productlines,invite employees,buy materials,design and develop new products,sell products........., all of the companies will compete each other.
  • game frame
        I decided to use WME to finish the game client.of course the game need a server program(i use java write some struts actions and use tomcat to run it,game data was stored into the sql server2000).
  • network
        The WME client program can connect to the JAVA web server?yeah,it seems impossible if we only use itself's ability.so we use delphi writen a DLL file.There is some functions in the DLL,one of them called http_get(url,result),ok,now we can call it in the game script by follow  steps:
    1.declare the dll function in the base.script:
    external "gui.dll" int http_get(string,string);//arg1:http url address;arg2:return value
    2.we can call it like this:
    var rt=new String(100);
    http_get("http://www.dead-code.ogr/test.jsp?arg=1&arg=2&arg=3...",rt);

    we send our client program's data by arg=1&arg=2&arg=3...,and the server will return the result in variable  rt,our server sometime return a XML string and sometime return a split string(ex:"123#456#abc#def").
    we call DLL  function to  parse XML string and call WEM's String.Split(..) to parse split string.String.By the way,String.Split(..) has  more high performace than DLL XML function.
  • GUI
        The WME itself's GUI is not strong,we use jsp web page(html,css,javascript....) to  implemented  most of the windows,the WME client open this page by call the DLL function http_webbrowser(url).This solution cause our game can only run in the window mode.........,but i think it's worthwhile.
  • multiply player
         client  side
        Our WME Client  store the players in a global array:
        actors["tom"]=Game.LoadActor3D("actors\....\p.act3d");
        We can get every actor by their name:
        var act=actors["tom"];
        server side
        We have a table to store all player's location,scene....,each WME Client  need to report it's latest status and  get the players list from server  at a certain time rate(such as every 100ms),

    var rt=new String(2000);
    http_get("http://...../LoginAction.do?p0=9&p1="+courseid+"&p2="+companyid+"&p3="+studentid+"&scene="+Scene.Name+"&actor="+actor.Name+"&x="+actor.X+"&y="+actor.Y,rt);   

    by parasing the string rt. our client program can know how many actors are online,each one's location,scene,who are speaking,speaking what.....
  • others
    how to display a custom text on the head of the actor?
    do it in the actor's script like this:

    var WinSubtitles;
    var tiptitle;
    while(1)
    {
    if(WinSubtitles==null)
    {
    WinSubtitles = Game.CreateWindow("subtitles_window");
    //WinSubtitles.SetImage("interface\bst\actor_card.tga");
    }
    if(tiptitle==null)
    {
    tiptitle= WinSubtitles.CreateStatic("speaker_name");
    tiptitle.SizeToFit();
    tiptitle.SetFont("fonts\arial_头

7
Game announcements / a multiply players game developed by WME.
« on: August 13, 2008, 01:33:03 PM »
I use WME developed a  multiply players game.The server use JAVA +Tomcat+ SQL SERVER2000.player can login the server,chating each other,also can upon the game data to  server and query reports from server.player can see others moving,speaking in himself's client.here is the screenshot:

user login:

regist user:

scene1:

scene2:

scene3:

8
Technical forum / how to display a rotated text on screen?
« on: August 01, 2008, 08:34:12 AM »
Is WME can display a rotated dynamic text(it's content can change by variable) in scene?

9
Technical forum / game window's position problem in window mode
« on: July 21, 2008, 11:02:16 AM »
I run my game in window mode,but the game window startup position is always at topleft of desktop,how can i  set it in the center of the desktop?

10
Technical forum / ToInt
« on: July 11, 2008, 10:15:59 AM »
var s=new String("2");
var i=ToInt(s);
the result is i=0;
why?

11
Technical forum / Re: data type problem:how to convert String to int?
« on: July 11, 2008, 10:04:13 AM »
thanks very very much ::beer

12
Technical forum / data type problem:how to convert String to int?
« on: July 11, 2008, 09:52:59 AM »
i define a String variable:
var s=new String(10);
test(s);//here call a dll function test(string),this function is not written by me,so the parameter s is String type,after call it, s="10";
for(var i=0;i<s;i=i+1)
{
do something..........
}

but when i run the programe,the for loop wasn't be execute.
how to convert the variable s to int ?

13
Technical forum / Re: how to display text on the actor's head?
« on: May 15, 2008, 03:35:46 PM »
thanks for reply.
There are many actors in my game.how to create caption dynamic in the code?

14
Technical forum / how to display text on the actor's head?
« on: May 15, 2008, 09:19:06 AM »
i want to display a text for example actor's name on the actor's head,display always when ever the actor is walking,running....,how can i do it?

15
Technical forum / 3d actor DirectWalk(...) problem
« on: May 13, 2008, 09:42:06 AM »
When i use 3d actor DirectWalk(...) function,the block object in scene can't block the actor,why?

Pages: [1] 2

Page created in 0.095 seconds with 24 queries.