Plug-in system for Latikai's client

Forum for game modifications and custom clients.

Re: Plug-in system for Latikai's client

Postby Heffernan » Sun May 13, 2018 1:46 pm

Thanks got to test earlier, super cool plugin sadly salems sound system is limited alot maybe JC can change this in the future

Code: Select all
Some random supposedly sax piece


https://www.youtube.com/watch?v=kxopViU98Xo&t=5s
User avatar
Heffernan
 
Posts: 8403
Joined: Mon Sep 08, 2014 3:07 pm
Location: Marps Closet

Re: Plug-in system for Latikai's client

Postby Kashias » Tue May 15, 2018 7:35 pm

The client emits this error :(

java.lang.RuntimeException: Cannot encode a class haven.Coord3f as TTO


ui.wdgmsg(ui.gui.map, "click", cur.sc, cur.rc, 3, 0, 0, (int) cur.id, cur.rc, 0, -1);
// cur is Gob instance


I've got a 'gob' sure, but I can't click on it.
Gob is a limeboulder
Kashias
 
Posts: 3
Joined: Sat Jul 27, 2013 5:29 am

Re: Plug-in system for Latikai's client

Postby Chrumps » Tue May 15, 2018 8:50 pm

Are you posting exact code?
It looks you are using Coord3f instead of Coord.

Cough, auto boulder breaking, cough.
Chrumps
 
Posts: 566
Joined: Wed Apr 09, 2014 9:51 pm
Location: Poland

Re: Plug-in system for Latikai's client

Postby Kashias » Wed May 16, 2018 2:04 pm

Chrumps wrote:Are you posting exact code?
It looks you are using Coord3f instead of Coord.

Cough, auto boulder breaking, cough.


I personally wrote the code. Of course, Salem's base code didin't changed.
and

ui.wdgmsg(ui.gui.map, "click", cur.sc, cur.rc, 3, 0, 0, (int) cur.id, cur.rc, 0, -1);

In this code, cur.sc and cur.rc are recognized as Coord, but at clients, Coord3f. I have no idea why this is so.
Kashias
 
Posts: 3
Joined: Sat Jul 27, 2013 5:29 am

Re: Plug-in system for Latikai's client

Postby Kandarim » Thu May 17, 2018 8:56 am

sc (screen coordinates) should be Coord, while rc (relative coordinates, as far as I figure) should be Coord3f, if memory serves. Not entirely positive on this.
I have neither the crayons nor the time to explain it to you.
JC wrote:I'm not fully committed to being wrong on that yet.
User avatar
Kandarim
Customer
 
Posts: 5309
Joined: Mon Jan 21, 2013 4:18 pm

Re: Plug-in system for Latikai's client

Postby Kashias » Thu May 17, 2018 11:51 am

Kandarim wrote:sc (screen coordinates) should be Coord, while rc (relative coordinates, as far as I figure) should be Coord3f, if memory serves. Not entirely positive on this.


still didnt work
and same error message
Cannot encode a class haven.Coord3f as TTO

ui.wdgmsg(ui.gui.map, "click", cur.sc, cur.getc(), 3, 0, 0, (int) cur.id, cur.getc(), 0, -1);
Kashias
 
Posts: 3
Joined: Sat Jul 27, 2013 5:29 am

Re: Plug-in system for Latikai's client

Postby Chrumps » Thu May 17, 2018 8:06 pm

I am pretty sure the message comes from this function:
Code: Select all
   public void addlist(Object... args) {
   for(Object o : args) {
       if(o == null) {
      adduint8(T_NIL);
       } else if(o instanceof Integer) {
      adduint8(T_INT);
      addint32(((Integer)o).intValue());
       } else if(o instanceof String) {
      adduint8(T_STR);
      addstring((String)o);
       } else if(o instanceof Coord) {
      adduint8(T_COORD);
      addcoord((Coord)o);
       } else if(o instanceof byte[]) {
      byte[] b = (byte[])o;
      adduint8(T_BYTES);
      if(b.length < 128) {
          adduint8(b.length);
      } else {
          adduint8(0x80);
          addint32(b.length);
      }
      addbytes(b);
       } else {
      throw(new RuntimeException("Cannot encode a " + o.getClass() + " as TTO"));
       }
   }
    }


which can encode Coord but not Coord3f.

I asked you if you posted the exact code you are using, not if you took it from someone. The line in the first post looked 100% correct. The line you posted in the second post is different and it makes a huge difference.
Code: Select all
public class Gob implements Sprite.Owner, Skeleton.ModOwner, Rendered {
    public Coord rc, sc;

but
Code: Select all
public Coord3f getc() {
Chrumps
 
Posts: 566
Joined: Wed Apr 09, 2014 9:51 pm
Location: Poland

Previous

Return to Artifice & Arcana

Who is online

Users browsing this forum: No registered users and 3 guests