whitevo
Feeling good, thats what I do.
On protocolgame.cpp file we can find some network messages what assume source uses.
But trough Lua we can also send those messages to server? (or client?)
I picked up 3 useful NetworkMessages
Here are the problems I ran into:
But trough Lua we can also send those messages to server? (or client?)
I picked up 3 useful NetworkMessages
Here are the problems I ran into:
here is the c++ code found in source
and here is the lua function I made
I tested with iconByte's:
0x00 = nothing
0x01 = poison
0x02 = fire
How do you set more than 1 icon at once?
because only one icon was allowed at once.
How do you remove that icon?
Excluding using the 0x00 code to remove all
Code:
void ProtocolGame::sendIcons(uint16_t icons)
{
NetworkMessage msg;
msg.addByte(0xA2);
msg.add<uint16_t>(icons);
writeToOutputBuffer(msg);
}
Code:
function Player.sendIcons(player, iconByte)
local msg = NetworkMessage()
msg:addByte(0xA2)
msg:addU16(iconByte)
msg:sendToPlayer(player)
msg:delete()
end
0x00 = nothing
0x01 = poison
0x02 = fire
How do you set more than 1 icon at once?
because only one icon was allowed at once.
How do you remove that icon?
Excluding using the 0x00 code to remove all
source function
my Lua function
Well couldn't get that work at all. crashed every time xD
What am I doing wrong?
What colorBytes I can use?
Code:
void ProtocolGame::sendCreatureSquare(const Creature* creature, SquareColor_t color)
{
if (!canSee(creature)) { return; }
NetworkMessage msg;
msg.addByte(0x93);
msg.add<uint32_t>(creature->getID());
msg.addByte(0x01);
msg.addByte(color);
writeToOutputBuffer(msg);
}
my Lua function
Code:
function Creature.sendCreatureSquare(creature, colorByte)
local msg = NetworkMessage()
msg:addByte(0x93)
msg:addU32(creature:getId())
msg:addByte(0x01)
msg.addByte(colorByte);
msg:sendToPlayer(creature)
msg:delete()
end
What am I doing wrong?
What colorBytes I can use?
source function
Here I just want to know, can I use it on creature like every 500milliseconds?
So that he wont even try to move?
Right now when I want to make creature not able to move. I set the ground ActionID which makes him teleport back where he cam from on step out.
Code:
void ProtocolGame::sendCancelWalk()
{
NetworkMessage msg;
msg.addByte(0xB5);
msg.addByte(player->getDirection());
writeToOutputBuffer(msg);
}
So that he wont even try to move?
Right now when I want to make creature not able to move. I set the ground ActionID which makes him teleport back where he cam from on step out.