| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| String to Real/Integer | |
|---|---|
| Tweet Topic Started: Nov 16 2010, 08:20 PM (208 Views) | |
| DJ-Habana | Nov 16 2010, 08:20 PM Post #1 |
|
C# King
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I am building my multiplayer now with 39dll the problem is that if I send it like this writeshort(x) writeshort(y) writeshort(z) writeshort(roty) then the object is wabling and that is not right so now I go and I make a string CRD = string(x)+'|'+string(y)+'|'+string(z)+'|'+string(roty)+'|'; and use this code do decode it then function decode_string str=argument0; // string to decode obj=argument1; //obj to update with coordinates var p; p = string_pos('|',str); temp = string_copy(str,1,p-1); obj.x = real(temp); str = string_delete(str,1,p); p = string_pos('|',str); temp = string_copy(str,1,p-1); obj.y = real(temp); str = string_delete(str,1,p); p = string_pos('|',str); temp = string_copy(str,1,p-1); obj.z = real(temp); str = string_delete(str,1,p); p = string_pos('|',str); temp = string_copy(str,1,p-1); obj.roty = real(temp); str = string_delete(str,1,p); if I run then I get this error: ___________________________________________ ERROR in action number 1 of Step Event for object obj_39DllControl: Error in function real(). |
|
| |
![]() |
|
| Despellanion | Nov 16 2010, 08:40 PM Post #2 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I don't know, I haven't had any problems with wabbling multiplayer position updates. Just make sure you aren't trying to send too much data at the same time, or there might be some packet loss or some packets not being sent properly. I've also had the real-error, and I think it's got to do with it trying to read funny values that aren't really numbers. You should check the actual value with a show_message or something, then it would be easier to spot the problem I think. |
![]() |
|
| DJ-Habana | Nov 16 2010, 09:03 PM Post #3 |
|
C# King
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
this is what I send when it is wabling or something clearbuffer(); writebyte(5); writebyte(global.myid); writeshort(x); writeshort(y); writeshort(z); writeshort(roty); sendmessage(global.clienttcp); then a guy told me to put everything in one string CRD = string(x)+'|'+string(y)+'|'+string(z)+'|'+string(roty)+'|'; clearbuffer(); writebyte(5); writebyte(global.myid); writestring(CRD,true) sendmessage(global.clienttcp); if it is packet loss how would I know that? |
|
| |
![]() |
|
| DJ-Habana | Nov 16 2010, 11:21 PM Post #4 |
|
C# King
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
should this be in a alarm event clearbuffer(); writebyte(5); writebyte(global.myid); writeshort(x); writeshort(y); writeshort(z); writeshort(roty); sendmessage(global.clienttcp); I saw it in alarm event in the example u3d + 39dll |
|
| |
![]() |
|
| Despellanion | Nov 16 2010, 11:26 PM Post #5 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You can have it in a alarm event, but you can also put it in a key-press event to save the server some work for idling players. |
![]() |
|
| DJ-Habana | Nov 17 2010, 06:45 AM Post #6 |
|
C# King
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Cool Thanx going to give it a try |
|
| |
![]() |
|
| DJ-Habana | Nov 17 2010, 07:47 AM Post #7 |
|
C# King
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
damn it still jumps around I wish I could explain what I see Edited by DJ-Habana, Nov 17 2010, 07:51 AM.
|
|
| |
![]() |
|
| « Previous Topic · Off-topic · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)



10:48 AM Jul 11