Results 1 to 18 of 18

Thread: attempt to make a game client with simba

  1. #1
    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default attempt to make a game client with simba

    Hello everyone. My name is Make.
    I am new here. but been a scar user since 3.13.
    I was wondering if anyone had some knowledge of reading/loading resource files. "resource hacker .egf file" and/or sending/receiveng packet data "sockets and stuff" with simba to a game server.and/or settransbitmap on forms?
    i am attempting a remake of a game Client in simba for a game server "Meow/kalandra/eoserv".
    its a 2d RPG multi player type game.based from a game called Endless online.
    I have alot of the main stuff remade form/buttons/screens/artwork but almost at a stand still with the project untill i figure a few things out.
    few screenshots of the project as of today.
    2uh9tl0.png
    mu8xae.png

    Cnc Welcome
    Last edited by MakIAM; 11-26-2014 at 11:35 PM. Reason: made no sence

  2. #2
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Is it a Java applet? If so, you *might* be able to load it inside SMART.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  3. #3
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    Is it a Java applet? If so, you *might* be able to load it inside SMART.
    Take a read.... again.

  4. #4
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    Take a read.... again.
    Ouch, that was pretty bad.
    I need to learn to read more than the title and first few words before I believe myself informed enough to formulate a response.

    Thanks for catching me on that.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  5. #5
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    How many lines is that? Also, why not write it in C++/C#/Java/Python?



    New to scripting? Procedures & Functions for Beginners
    Do you use your computer at night? Just get f.lux

  6. #6
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Check out Amethlion.

    Similar to what you're doing.

    Perhaps try to get into contact with solemn?

    Looking forward to reading more about your project
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  7. #7
    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Incurable View Post
    How many lines is that? Also, why not write it in C++/C#/Java/Python?
    in its current state 3170 lines. im hope to keep it under 10k lines.

    i dont know c or c++Java/Python?
    i havent coded anything in 25 years. back when you turned the pc on it just blinked....
    pascals fine for me. got to start somewhere right?

    thanks for the reply's
    Last edited by MakIAM; 11-27-2014 at 03:12 AM. Reason: added this Java/Python? and thanks

  8. #8
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Quote Originally Posted by MakIAM View Post
    in its current state 3170 lines. im hope to keep it under 10k lines.

    i dont know c or c++Java/Python?
    i havent coded anything in 25 years. back when you turned the pc on it just blinked....
    pascals fine for me. got to start somewhere right?

    thanks for the reply's
    Eh, fair enough... well, why not learn then? You seem to know what you're doing, so learning another language will be fairly simple. Python is similar enough to Pascal that you could probably pick it up in a few days.



    New to scripting? Procedures & Functions for Beginners
    Do you use your computer at night? Just get f.lux

  9. #9
    Join Date
    Nov 2014
    Posts
    104
    Mentioned
    12 Post(s)
    Quoted
    59 Post(s)

    Default

    Hey Make, here is some example code I whipped up related to "sockets and stuff." The comments should explain what is going on in the code itself.
    Simple Client:
    Simba Code:
    {$f-}

    var socket: integer;
    begin
      // Create & connect our socket
      socket = CreateSocket();
      ConnectSocket(socket, 'localhost', '4040');

      // Say hello, and get a reply
      SendSocket(socket, 'Hello!');
      writeLn(RecvSocket(socket));

      // Say bye and get a reply
      SendSocket(socket, 'bye');
      writeLn(RecvSocket(socket));

      // Clean up
      CloseSocket(socket);
      FreeSocket(socket);
    end.
    Simple Server:
    Simba Code:
    {$f-}

    var
      serverSocket, clientSocket: integer;
      input: string;
    begin
      // Create & bind our socket so we can accept connections
      serverSocket := CreateSocket();
      BindSocket(serverSocket, 'localhost', '4040');

      // Wait for a socket to connect
      ListenSocket(serverSocket);
      clientSocket := AcceptSocket(serverSocket);

      // Keep listening and responding until client says 'bye'
      repeat
        input := RecvSocket(clientSocket);
        SendSocket(clientSocket, 'Server says: ' + input);
        writeLn('from client: ', input);
      until input = 'bye';

      // Clean up
      CloseSocket(clientSocket);
      CloseSocket(serverSocket);
      FreeSocket(clientSocket);
      FreeSocket(serverSocket);
    end.

    As for the egf files, you can read and interpret them. Do you want examples on how to read from files in Simba? Interpreting the files will be challenging, if my limited understanding of Elmer Front is correct.
    Last edited by akarigar; 11-27-2014 at 06:12 AM. Reason: Added some info for egf

  10. #10
    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by akarigar View Post
    Hey Make, here is some example code I whipped up related to "sockets and stuff." The comments should explain what is going on in the code itself.
    Simple Client:
    Simba Code:
    {$f-}

    var socket: integer;
    begin
      // Create & connect our socket
      socket = CreateSocket();
      ConnectSocket(socket, 'localhost', '4040');

      // Say hello, and get a reply
      SendSocket(socket, 'Hello!');
      writeLn(RecvSocket(socket));

      // Say bye and get a reply
      SendSocket(socket, 'bye');
      writeLn(RecvSocket(socket));

      // Clean up
      CloseSocket(socket);
      FreeSocket(socket);
    end.
    Simple Server:
    Simba Code:
    {$f-}

    var
      serverSocket, clientSocket: integer;
      input: string;
    begin
      // Create & bind our socket so we can accept connections
      serverSocket := CreateSocket();
      BindSocket(serverSocket, 'localhost', '4040');

      // Wait for a socket to connect
      ListenSocket(serverSocket);
      clientSocket := AcceptSocket(serverSocket);

      // Keep listening and responding until client says 'bye'
      repeat
        input := RecvSocket(clientSocket);
        SendSocket(clientSocket, 'Server says: ' + input);
        writeLn('from client: ', input);
      until input = 'bye';

      // Clean up
      CloseSocket(clientSocket);
      CloseSocket(serverSocket);
      FreeSocket(clientSocket);
      FreeSocket(serverSocket);
    end.

    As for the egf files, you can read and interpret them. Do you want examples on how to read from files in Simba? Interpreting the files will be challenging, if my limited understanding of Elmer Front is correct.
    Thank you very much for the examples. this is going to be very helpful.
    this is for lape correct?
    would the simba/pascal usage be about the same?

    and yes please, if you have any examples of reading/loading graphics files.
    that would be awsome...
    here is a link to a sample gfx..egf file //under 5 post so i cant post a normal link.srry
    h t t p s://w w w.mediafire.com/?ks6wp13pt1lv30v
    it opens with reshacker and has rc data too?

    i figured if i could'nt load them i would have to make a .ini file with the bitmap strings in it.

    thank you again for the examples.

  11. #11
    Join Date
    Nov 2014
    Posts
    104
    Mentioned
    12 Post(s)
    Quoted
    59 Post(s)

    Default

    Quote Originally Posted by MakIAM View Post
    Thank you very much for the examples. this is going to be very helpful.
    this is for lape correct?
    would the simba/pascal usage be about the same?

    and yes please, if you have any examples of reading/loading graphics files.
    that would be awsome...
    here is a link to a sample gfx..egf file //under 5 post so i cant post a normal link.srry
    h t t p s://w w w.mediafire.com/?ks6wp13pt1lv30v
    it opens with reshacker and has rc data too?

    i figured if i could'nt load them i would have to make a .ini file with the bitmap strings in it.

    thank you again for the examples.
    No worries, glad to be of help. I would imagine the example should be about the same if you're using the Pascal interpreter, if it isn't, let me know and I can take a look.

    The link doesn't seem to be working for me. If you can make ini files, it would be much simpler to work with since you can use the following ini related functions.
    Simba Code:
    function ReadINI(const Section, KeyName, FileName: string): string;
    procedure WriteINI(const Section, KeyName, FileName: string);
    procedure DeleteINI(const Section, KeyName, FileName: string);

  12. #12
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Check out the Simba documentation for reading from and writing to files.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  13. #13
    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    @ daniel
    thank you. i will check these out more this week.
    i have been working on trans bitmaps this past week. what a head ache.
    @ akarigar
    the socket stuff seems to be about the same. but i havent figured the usage out yet."time out errors and stuff.

    thanks for the help so far.

  14. #14
    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    thank you both. i have spent the last weeks learning to draw in simba. will be working on the sockets and reading from resource more soon.
    Attached Images Attached Images

  15. #15
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Quote Originally Posted by MakIAM View Post
    thank you both. i have spent the last weeks learning to draw in simba. will be working on the sockets and reading from resource more soon.
    Looks great dude! Keep us updated, and I sure hope to try out the final piece !

  16. #16
    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    working on a ver of a map editor. got movement of player with attack and sit work on another script.
    i need idea's on how to make it draw faster. maybe larger tile group draws at one time, or maybe multi timer thread draws.
    C&C welcome on this script.
    program MakesMapMessV20;
    // you can change the map size at end of script mapsizx and mapsize y
    var
    DsgnForm:TForm;
    TLabel0: TLabel;
    Ground:TImage;
    groundlayer,Tile,BmpW,BmpH:integer;
    GroundPicture,bmps1: TMufasaBitmap;
    bmp1,GroundRenderdPicture: TBitmap;
    a,b,TileRowX,TileRowY,MapSizeX,MapSizeY,TileId:int eger;
    c,d,filename,StringOutPut:string;
    const
    default = 'Comic Sans MS';

    procedure YourClickProcedure(Sender: TObject);
    begin
    //GetBitmapSize(GroundLayer,Bmpw,BmpH);
    //StringOutPut:= CreateBitmapstring(GroundLayer);
    //WriteLn('This will be saved in a ini file ' + IntToStr(BmpW));
    //WriteLn('This will be saved in a ini file ' + IntToStr(BmpH));
    //WriteLn('This will be saved in a ini file ' +StringOutPut);
    Ground.Left:=Ground.Left-32;
    Ground.Picture.Bitmap.handle:=GroundRenderdPicture .handle;
    end;
    procedure YourClickProcedure2(Sender: TObject);
    begin
    TLabel0.Caption:='Done';
    Ground.Left:=(DsgnForm.Width/(2))-a;//will be based from player x y from warp/or database login start x y info
    SetTransparentColor(GroundLayer,clblack);
    SetTransparentColor(Tile,clblack);
    for TileRowY:= 0 to MapSizeY do //row drawing down/left
    begin
    for TileRowX:= 0 to MapSizeX do //row drawing right/down
    begin
    a:=a+32;
    b:=b+16;
    FastDrawTransparent(a,b,Tile,GroundLayer);
    SetBitmapname(GroundLayer,'GroundLayer');
    end;
    a:= (a - (MapSizeX * (32))-(64));
    b:= (b - (MapSizeX * (16)));
    end;
    GroundPicture:=GetMufasaBitmap(GroundLayer);
    GroundRenderdPicture.free;
    GroundRenderdPicture:=GroundPicture.ToTBitmap;
    Ground.Picture.Bitmap.handle:=GroundRenderdPicture .handle;
    Ground.onclick:=@YourClickProcedure;
    end;
    procedure InitForm;
    begin
    //DsgnForm\\
    DsgnForm:=TForm.Create(nil);
    with DsgnForm do
    begin
    Caption:='Render a Custom map V.20';
    Left:=1;
    Top:=1;
    DsgnForm.Width:=820;
    Height:=840;
    Font.Name:=default;
    Font.Color:=clDefault;
    Font.Size:=0;
    color:=clblack;
    onclick:=@YourClickProcedure2;
    //onshow:=@YourClickProcedure2;
    end;
    GroundLayer:=CreateBitmap((MapSizey * 33)+(MapSizeX *33)+1000,(MapSizey * 33)+(MapSizey *33)+1000);
    SetTransparentColor(GroundLayer,clblack);
    SetTransparentColor(Tile,clblack);
    a:=(MapSizey * 32)+1;
    //Screen\\
    Ground:=TImage.Create(DsgnForm);
    with Ground do
    begin
    //TileId:= 4;
    //d:= 'News Info';
    //FileName := AppPath + 'NewsTest3.ini';
    //c:=((ReadINI ((d),(IntToStr(TileId)), FileName)));
    c:='meJzVWGtXWkcUPTwFhRoN4vAWTUzarP6E9kM+dEWDD1RQg i8EAggIiDxFnslKTdKsdrU/uHP25TaaNm1eajqL5boMc8/ss88+Z85IdFVDFEmckchd2QZXNu4MLL64UQTowe+Tok5ij0T1p jF92BAVElkS2ySekAiSqJFoMnhRIrFP4uCm8b1/iC6JFgAfAX+eRJJEiMQmiQiJHRJREqcknvGCr2pIzP6O2VHXMO wYqE4B/y4+8mEFyGVcTkj04GCf43LjgyEVmeeZrMmR1YgMiaeYjJM4ZuT ODa3/zMyA5eQW+atm13Mdfy1zXnOwTm4G+eQCi1kskziEvNdIhEkMAH uDxCqT7EkaHDEN819HRGLkOTA4C1oZC1dBe7dh4ZXryO6V60PO 2FbBs8S/SMx5gmSp4a8K8gg0s42EXcfnCLpaRRY0WGCOoMa1oePXt9SUb7 LvV4t8BUE/Aga5bwHUtfG3gJkGfs1hZR7Py3AwBgcfY2ULaGU40jIKOgnbkd fMN638uhKL4JdHbluBzvPYIgF4VXKsa9xhnf0R2QOAV8V8Amvy vF6+Nb0AqIsIzSaKagZOBVGOqkiEDXJv6XlNiJ3iyCbo29cTXw Q5c1gEvVVy5/XugZ4LyAkXEFddN9+xTm3qratkX2bBTPwEAFGyBWhqgywBsj8B pWtwYRXIk2ostlGUCnAwNdziTt/iqxsdHY2zpOV9P6NGsc0koCqibZG3aPRWjVznsyiAPXKf6n2Nk YlVsgVZ9taH8PeEJkN0OwSqa+AzxYX0bSzWEIgIFgQxoyizDBH GJPm3pAuMv0XOutZ5qP0o5HPVUe+p0Xc8wmCqCHQdDzGa6Zs8b YSgRsO/ZbVaNqHzGuKVQ1aeYXJAU2tkXSJbGBmtxGIZmJP4uo6ZJTi1q1 bgY9ip01xrbPbNKAM4/QDOQ+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PvZzitcJ8BzN K770BRwZfEPhlL8rQbRwq7VzAnFMfKshZRQwZ6EcpjE31dtOCo pSbZhiNxDqEtAMqIleF/JIXi5D08QX86zgpcjTXHZ352cQ/dej7P2wMNTF0wXmiZb9C7Ij/3Dwrk30b+OMwGLgO5Je8+At8Tb3XJNTLb5s8NYNsI4d93T7L5t 6rcWdXy1Wlj9BsqVeAa+H8vV7k6O5zi/eFUcrG2dd+92aC8adp/vwbdkpp7Y4g+zJ0VYBHUWgme5PILw5mvkvemvH+y3GuS8rBHQP gGvgPISMUd3CWfYXj3vk4A66itBaRpDX1thsH/1VyDj7uMnL9Y3gjiELhGfWSm/iq/3n498EN0j7UUidX791e8f8yZApc9fgTuiYN3g==';
    Parent:=DsgnForm;
    Ground.Left:=0;
    Top:=0;
    Width:=(MapSizey * 32)+(MapSizeX *32)+1000;
    Height:=(MapSizey * 16)+(MapSizey *16)+1000;
    bmps1:=GetMufasaBitmap(BitmapFromString(64,32,c));
    bmp1:=bmps1.ToTBitmap;
    GroundRenderdPicture:=bmp1;
    Picture.Bitmap.handle:=GroundRenderdPicture.handle ;
    onclick:=@YourClickProcedure2;
    end;

    //TLabel0\\
    TLabel0:=TLabel.Create(DsgnForm);
    with TLabel0 do
    begin
    Parent:=DsgnForm;
    TLabel0.Caption:='Click Any Place To Start';
    Left:=79;
    Top:=74;
    Width:=38;
    Height:=14;
    Font.Name:=default;
    Font.Color:=clWhite;
    Font.Size:=18;
    end;
    Tile:=CreateBitmap(64,32);
    Tile:=BitmapFromString(64,32,c);
    end;

    procedure SafeInitForm;
    var
    v: TVariantArray;
    begin
    setarraylength(V, 0);
    ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
    DsgnForm.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
    v: TVariantArray;
    begin
    SetArrayLength(V, 0);
    ThreadSafeCall('ShowFormModal', v);
    end;
    //start\\
    begin
    a:=(MapSizey * 32)+1;
    b:=0;
    MapSizeX:=65;//downright rows x //mapsize
    MapSizeY:=65;//downleft rows y //mapsize
    SafeInitForm;
    SafeShowFormModal;
    bmps1.free;
    freebitmap(Tile);
    GroundRenderdPicture.free;
    freebitmap(2);
    freebitmap(GroundLayer);
    //DsgnForm.free;//crashes simba on clicking simba after DsgnForm.free hmm

    //this timage "Ground" dont free but also it do not show as Notfreed in debug box ,but i see mem sticking in task manager if this not there//Ground.free\\. hmm
    Ground.free; //this frees it from mem after you stop script.if not after running multi times mem loads up and crashes

    end.
    Attached Files Attached Files

  17. #17
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Got any more of those pretty pictures of this project?
    There used to be something meaningful here.

  18. #18
    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    Got any more of those pretty pictures of this project?
    i do. but i will have to learn some more things before the code is updated where i can add the artwork./objects/walls/shadows ,things like that.
    I have been drawing the last two years to get enough artwork to add in this project.
    thanks for the feedback and interest

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •