Post: MW2 RTM help with say command
07-10-2016, 02:16 AM #1
Sicmish
Save Point
(adsbygoogle = window.adsbygoogle || []).push({}); Hey NGU I need some help on the say command like say "Hello world";
I tried it with Cbuf_AddText("say " + Textbox.Text) but it does( YOUNAME:Hello worldsay Hello world)
Its says the text two times.
how would I go about fixing this?
Last edited by Sicmish ; 07-12-2016 at 07:35 PM.
07-15-2016, 12:39 AM #2
S63
Space Ninja
Originally posted by Sicmish View Post
Hey NGU I need some help on the say command like say "Hello world";
I tried it with Cbuf_AddText("say " + Textbox.Text) but it does( YOUNAME:Hello worldsay Hello world)
Its says the text two times.
how would I go about fixing this?


What are you calling the cbuf address with? The RPC Call Function?
07-15-2016, 02:19 AM #3
Sicmish
Save Point
Originally posted by S63 View Post
What are you calling the cbuf address with? The RPC Call Function?


No. I'm calling it straight through Cbuf_Addtext();

     
public static void Cbuf_AddText(string text)
{
byte[] buffer1 = new byte[256];
byte[] buffer2 = new byte[16]
{
(byte) 56,
(byte) 96,
(byte) 0,
(byte) 0,
(byte) 60,
(byte) 128,
(byte) 2,
(byte) 0,
(byte) 48,
(byte) 132,
(byte) 80,
(byte) 0,
(byte) 75,
(byte) 248,
(byte) 99,
(byte) 253
};
byte[] buffer3 = new byte[16]
{
(byte) 129,
(byte) 34,
(byte) 69,
(byte) 16,
(byte) 129,
(byte) 105,
(byte) 0,
(byte) 0,
(byte) 136,
(byte) 11,
(byte) 0,
(byte) 12,
(byte) 47,
(byte) 128,
(byte) 0,
(byte) 0
};
byte[] numArray = new byte[0];
byte[] bytes = Encoding.UTF8.GetBytes(text);
MainWindow.API.CCAPI.SetMemory(33574912U, bytes);
MainWindow.API.CCAPI.SetMemory(2439864U, buffer2);
Thread.Sleep(15);
MainWindow.API.CCAPI.SetMemory(2439864U, buffer3);
MainWindow.API.CCAPI.SetMemory(33574912U, buffer1);
}
07-15-2016, 12:16 PM #4
S63
Space Ninja
Originally posted by Sicmish View Post
No. I'm calling it straight through Cbuf_Addtext();

     
public static void Cbuf_AddText(string text)
{
byte[] buffer1 = new byte[256];
byte[] buffer2 = new byte[16]
{
(byte) 56,
(byte) 96,
(byte) 0,
(byte) 0,
(byte) 60,
(byte) 128,
(byte) 2,
(byte) 0,
(byte) 48,
(byte) 132,
(byte) 80,
(byte) 0,
(byte) 75,
(byte) 248,
(byte) 99,
(byte) 253
};
byte[] buffer3 = new byte[16]
{
(byte) 129,
(byte) 34,
(byte) 69,
(byte) 16,
(byte) 129,
(byte) 105,
(byte) 0,
(byte) 0,
(byte) 136,
(byte) 11,
(byte) 0,
(byte) 12,
(byte) 47,
(byte) 128,
(byte) 0,
(byte) 0
};
byte[] numArray = new byte[0];
byte[] bytes = Encoding.UTF8.GetBytes(text);
MainWindow.API.CCAPI.SetMemory(33574912U, bytes);
MainWindow.API.CCAPI.SetMemory(2439864U, buffer2);
Thread.Sleep(15);
MainWindow.API.CCAPI.SetMemory(2439864U, buffer3);
MainWindow.API.CCAPI.SetMemory(33574912U, buffer1);
}


This looks like you decomplied it from a tool :/ use this 1.

public static void Cbuf_AddText(string text)
{
byte[] DFT = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
Byte[] RPCON = new Byte[] { 0x38, 0x60, 0x00, 0x00, 0x3C, 0x80, 0x02, 0x00, 0x30, 0x84, 0x50, 0x00, 0x4B, 0xF8, 0x63, 0xFD };
Byte[] RPCOFF = new Byte[] { 0x81, 0x22, 0x45, 0x10, 0x81, 0x69, 0x00, 0x00, 0x88, 0x0B, 0x00, 0x0C, 0x2F, 0x80, 0x00, 0x00 };
Byte[] cbuf = new Byte[] { };
cbuf = Encoding.UTF8.GetBytes(text);
PS3.SetMemory(0x2005000, cbuf);
PS3.SetMemory(0x253AB8, RPCON);
Thread.Sleep(15);
PS3.SetMemory(0x253AB8, RPCOFF);
PS3.SetMemory(0x2005000, DFT);
}
07-16-2016, 01:36 AM #5
Sicmish
Save Point
Originally posted by S63 View Post
This looks like you decomplied it from a tool :/ use this 1.

public static void Cbuf_AddText(string text)
{
byte[] DFT = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
Byte[] RPCON = new Byte[] { 0x38, 0x60, 0x00, 0x00, 0x3C, 0x80, 0x02, 0x00, 0x30, 0x84, 0x50, 0x00, 0x4B, 0xF8, 0x63, 0xFD };
Byte[] RPCOFF = new Byte[] { 0x81, 0x22, 0x45, 0x10, 0x81, 0x69, 0x00, 0x00, 0x88, 0x0B, 0x00, 0x0C, 0x2F, 0x80, 0x00, 0x00 };
Byte[] cbuf = new Byte[] { };
cbuf = Encoding.UTF8.GetBytes(text);
PS3.SetMemory(0x2005000, cbuf);
PS3.SetMemory(0x253AB8, RPCON);
Thread.Sleep(15);
PS3.SetMemory(0x253AB8, RPCOFF);
PS3.SetMemory(0x2005000, DFT);
}


Now it prints Cbuf_AddText("say Hello");
    
YOURNAME:Hellosay Hello
YOURNAME:Hellosay Hello
YOURNAME:Hellosay Hello
YOURNAME:Hellosay Hello
YOURNAME:Hellosay Hello


Still says it twice but now repeats it 5 to 6 times
    
public static void Cbuf_AddText(string text){
byte[] DFT = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
Byte[] RPCON = new Byte[] { 0x38, 0x60, 0x00, 0x00, 0x3C, 0x80, 0x02, 0x00, 0x30, 0x84, 0x50, 0x00, 0x4B, 0xF8, 0x63, 0xFD };
Byte[] RPCOFF = new Byte[] { 0x81, 0x22, 0x45, 0x10, 0x81, 0x69, 0x00, 0x00, 0x88, 0x0B, 0x00, 0x0C, 0x2F, 0x80, 0x00, 0x00 };
Byte[] cbuf = new Byte[] { };
cbuf = Encoding.UTF8.GetBytes(text);
API.CCAPI.SetMemory(0x2005000, cbuf);
API.CCAPI.SetMemory(0x253AB8, RPCON);
Thread.Sleep(15);
API.CCAPI.SetMemory(0x253AB8, RPCOFF);
API.CCAPI.SetMemory(0x2005000, DFT);
}


And unfortunately I did, I could not find much documentation on Functions.
I even tried MW2Lib.dll, but Its didn't have all the Functions I was looking for.
So I found a MW2 RTE tool that was open source, so I could look at the way of sending information to MW2 Functions, Offsets exc.
I understand this is wrong of me, I know.
And I know the Offsets can be found all over NGU, but most just had the Offset not the ON/OFF as well,
or the documentation on implementing them into code.
But I had no other way of finding these Offsets and Functions.
I am not a leach/code theft the proper credit and links will be in the tool, and I will be releasing my tool open source,
with the project file for visual studio, most off the code is commented so people will kinda know whats going on.
I'm just trying to figure out the real side of modding, and maybe help someone ells who is wanting to learn by looking through some code.
07-17-2016, 09:08 AM #6
Originally posted by Sicmish View Post
Now it prints Cbuf_AddText("say Hello");
    
YOURNAME:Hellosay Hello
YOURNAME:Hellosay Hello
YOURNAME:Hellosay Hello
YOURNAME:Hellosay Hello
YOURNAME:Hellosay Hello


Still says it twice but now repeats it 5 to 6 times
    
public static void Cbuf_AddText(string text){
byte[] DFT = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
Byte[] RPCON = new Byte[] { 0x38, 0x60, 0x00, 0x00, 0x3C, 0x80, 0x02, 0x00, 0x30, 0x84, 0x50, 0x00, 0x4B, 0xF8, 0x63, 0xFD };
Byte[] RPCOFF = new Byte[] { 0x81, 0x22, 0x45, 0x10, 0x81, 0x69, 0x00, 0x00, 0x88, 0x0B, 0x00, 0x0C, 0x2F, 0x80, 0x00, 0x00 };
Byte[] cbuf = new Byte[] { };
cbuf = Encoding.UTF8.GetBytes(text);
API.CCAPI.SetMemory(0x2005000, cbuf);
API.CCAPI.SetMemory(0x253AB8, RPCON);
Thread.Sleep(15);
API.CCAPI.SetMemory(0x253AB8, RPCOFF);
API.CCAPI.SetMemory(0x2005000, DFT);
}


And unfortunately I did, I could not find much documentation on Functions.
I even tried MW2Lib.dll, but Its didn't have all the Functions I was looking for.
So I found a MW2 RTE tool that was open source, so I could look at the way of sending information to MW2 Functions, Offsets exc.
I understand this is wrong of me, I know.
And I know the Offsets can be found all over NGU, but most just had the Offset not the ON/OFF as well,
or the documentation on implementing them into code.
But I had no other way of finding these Offsets and Functions.
I am not a leach/code theft the proper credit and links will be in the tool, and I will be releasing my tool open source,
with the project file for visual studio, most off the code is commented so people will kinda know whats going on.
I'm just trying to figure out the real side of modding, and maybe help someone ells who is wanting to learn by looking through some code.


I think cbuf_addtext isnt in the lib - u just call it straight from the offset
07-17-2016, 05:52 PM #7
S63
Space Ninja
Originally posted by boutthatlife View Post
I think cbuf_addtext isnt in the lib - u just call it straight from the offset


MW2Lib is custom made libary class made by other coder so the chances of it have cbuf_addtext is high
07-17-2016, 11:17 PM #8
Sicmish
Save Point
Originally posted by S63 View Post
MW2Lib is custom made libary class made by other coder so the chances of it have cbuf_addtext is high


Yeah the MW2lib has Cbuf_AddText(); its in the functions class,
it did the same thing even after I replaced the Cbuf_AddText() with the one S63 gave me.
I even tried having the Thread.Sleep(1); instead of Thread.Sleep(15); to turn off API.CCAPI.SetMemory(0x253AB8, RPCOFF);
sooner so its not calling the RPC as long but it still prints even more times.

So I have no idea what to do
07-17-2016, 11:34 PM #9
S63
Space Ninja
Originally posted by Sicmish View Post
Yeah the MW2lib has Cbuf_AddText(); its in the functions class,
it did the same thing even after I replaced the Cbuf_AddText() with the one S63 gave me.
I even tried having the Thread.Sleep(1); instead of Thread.Sleep(15); to turn off API.CCAPI.SetMemory(0x253AB8, RPCOFF);
sooner so its not calling the RPC as long but it still prints even more times.

So I have no idea what to do


Tru this cbuf_addtext("say " + textbox + "\0");
07-17-2016, 11:42 PM #10
Sicmish
Save Point
Originally posted by S63 View Post
Tru this cbuf_addtext("say " + textbox + "\0");


Its freeze's my PS3.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo