Author Topic: serverCmdSetWrenchData  (Read 990 times)

I'm trying to make a mod that involves people applying stuff to bricks.
The stuff of interest seems to be commandtoserver('setwrenchdata',"blah");.
So I tried to figure out how to use it.

First, I turned on trace at the server to see what the client sends.
Then I wrenched a brick and applyed some stuff.
It came up like this in the console:

Entering serverCmdSetWrenchData(5493, N blah^LDB 342^EDB 0^EDIR 0^IDB 0^IPOS 0^IDIR 2^IRT 4^RC 0^C 0^R 1)

First of all, I thought "WTF!".
Then I figured out the meaning:
5493 -> Me
N blah -> Brick has name 'blah'
LDB 342 -> Brick has light datablock 342
EDB 0 -> Brick has no emitter
EDIR 0 -> Emitter direction north
IDB 0 -> Brick has no item
IPOS 0 -> Item is on top of brick
IDIR 2 -> Item is direction north
IRT 4 -> Item has respawn time of 4
RC 0 -> No raycasting
C 0 -> No collision
R 1 -> Rendering on

All of that stuff goes in one argument, the specific things seem to be seperated by ^ or what does that mean?

However when I try to do
commandtoserver('setwrenchdata',"N asdf^LDB 0^EDB 0^EDIR 0^IDB 0^IPOS 0^IDIR 2^IRT 4^RC 1^C 1^R 1");

It ends up with the brick having the name
asdfLDB_0EDB_0EDIR_0IDB_0IPOS_0IDIR_2IRT_4RC_1C_1R_1

Hell I tried everything someone please help :c

^ is meant to represent [TAB], it works now
:D

^ is meant to represent [TAB], it works now
:D
function servercmdCommand(%client, %parameter){}

Also look at space guys autowrench (maybe)

function servercmdCommand(%client, %parameter){}

Also look at space guys autowrench (maybe)
Not only does your code not help in the slightest, but he's already figured it out.

^ is meant to represent [TAB], it works now
:D
you'll note that in syntax errors, tabs are converted to ^'s.

you'll note that in syntax errors, tabs are converted to ^'s.
That's how I figured it