Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read 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.

Topics - yaobifeng

Pages: [1]
1
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. :)

2
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;
      }



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

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

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

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

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

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

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

10
Technical forum / how to store multiple actors into array?
« on: April 29, 2008, 07:55:22 AM »
hi guys,i want to track  multiple actors in the scene.i define a global variable in the base.inc file like this:
global  actors = new Array();

then for a test ,i load a actor in the "LeftClick" function like this:

var actor1;
actor1=Game.LoadActor3D("actors\victor\victor.act3d");   
actors.Push(actor1); 
Game.Msg(actors.Length);

when i click the mouse more than one time, i found actors.Length always is 1.
why?

11
Technical forum / how to set the game run in window mode only?
« on: April 09, 2008, 03:41:12 AM »
i don't want my users to run it in fullscreen mode but window mode only,how can i do?
thanks!

12
Technical forum / Is there have timer in the WME?
« on: April 08, 2008, 06:39:57 AM »
hi,
I want to use a timer to get some data from server,ex get a string from the server per 3000ms,how can i do in the WME?Thinks.
another problem,i want to use a tread to get the data from the server,is tread supported in the wme?

13
hi,
I want to use the windows's UI in the game,ex window,button,list box,checkbox and so on,I use delphi write a function in dll file:

h := GetForegroundWindow;
Form1:=TForm1.CreateParented(h);
form1.ShowModal;
setwindowpos(form1.Handle,hwnd_topmost,0,0,0,0, swp_nosize or swp_nomove);
form1.Free;


then call it in the script:
external "D:\Program Files\Borland\Delphi6\Projects\dll.dll" TestDll(int);
...
TestDll(55);
...


it works like:



here is the problem,sometime the showmodle window open and show back of the game surface,sometime it's open and show front of the game surface.
how can i open and show the window front of the game surface always?

Pages: [1]

Page created in 0.09 seconds with 22 queries.