Tell VALVe to use notepad++ :v: Its probbably due to UTF-8 or something
[QUOTE=Tobba;22899713]Their not, its some windows bullshit that gets put there, notice how if you open a .mdl in notepad. then save with notepad without changing anything the file gets corrupt[/QUOTE]
I've never had that problem.
[QUOTE=CombineGuru;22898864]:downs:[/QUOTE]
I assumed it took a path, my bad.
PhysObj:GetID()
[QUOTE=ralle105;22901117]PhysObj:GetID()[/QUOTE]
[lua]
local physobj_idtable = {}
setmetatable(physobj_idtable, {__mode = "k"})
local meta = FindMetaTable("PhysObj")
function meta:GetID()
if not physobj_idtable[self] then
local e = self:GetEntity()
physobj_idtable[self] = -1
if ValidEntity(e) then
for i=0,e:GetPhysicsObjectCount()-1 do
if e:GetPhysicsObjectNum(i) == self then
physobj_idtable[self] = i
break
end
end
end
end
return physobj_idtable[self]
end
[/lua]
There are probably better ways, but whatever.
I know how to get it, but it should be in GLua by default.
The reason you can't correctly CRC a binary file is because the file usually will have a few bytes of non null bytes and a null byte. All text reading will stop at that null byte.
Is that intended? Because all text-editors seem to read null bytes fine.
That's because they've evolved overtime to read the file in binary mode anyways and converts them to another encoding later on. This makes sure you can edit text inside of a binary file without hurting the structure.
More functions that accept Tables as arguments would be nice, especially for sending data to the client (like NWVars and Effect Data).
Most of the time, when you need to send a table to the client, it typically requires a custom usermessage or a mass of NWVars to be created, which is, needless to say, rather inefficient. I would think that something built into gmod that could do the same thing would probably be both faster and more efficient.
That, and I've lost track of the number of times i've used CEffectData:SetOrigin (or something similar) to send color information to an effect. It would be nice to have a function like :SetAdditionalData() that we could use to send extra stuff without having to use inappropriately-named functions.
To load weapons from other mounted games. :v:
[QUOTE=Chad Mobile;22915619]To load weapons from other mounted games. :v:[/QUOTE]
That is very nearly imposable, to do so would require loading entities from a dll, with that you could load the entire game into garrysmod.
I want to be able to use window's image helper to do stuff like hot loading dlls and invoking functions in other dlls.
[QUOTE=Arania;22915398]More functions that accept Tables as arguments would be nice, especially for sending data to the client (like NWVars and Effect Data).
Most of the time, when you need to send a table to the client, it typically requires a custom usermessage or a mass of NWVars to be created, which is, needless to say, rather inefficient. I would think that something built into gmod that could do the same thing would probably be both faster and more efficient.
That, and I've lost track of the number of times i've used CEffectData:SetOrigin (or something similar) to send color information to an effect. It would be nice to have a function like :SetAdditionalData() that we could use to send extra stuff without having to use inappropriately-named functions.[/QUOTE]
This.
[QUOTE=Arania;22915398]More functions that accept Tables as arguments would be nice, especially for sending data to the client (like NWVars and Effect Data).
Most of the time, when you need to send a table to the client, it typically requires a custom usermessage or a mass of NWVars to be created, which is, needless to say, rather inefficient. I would think that something built into gmod that could do the same thing would probably be both faster and more efficient.
[/QUOTE]
Datastream can be used to send tables to the client and it's included with GMod. It's not as efficent as it could be though.
Keep in mind that you should rarely need to send a table to the client. Most of the time you can use usermessages for the same thing.
what about
[lua]
if SERVER then
local tbl = {"ima serverside table", 438, true}
SendUserMessage("ATest", unpack(tbl))
end
if CLIENT then
local tbl = {}
usermessage.hook("ATest", function(um)
local tbl = {um}
end)
end
[/lua]
[QUOTE=Arania;22915398]More functions that accept Tables as arguments would be nice, especially for sending data to the client (like NWVars and Effect Data).
Most of the time, when you need to send a table to the client, it typically requires a custom usermessage or a mass of NWVars to be created, which is, needless to say, rather inefficient. I would think that something built into gmod that could do the same thing would probably be both faster and more efficient.
That, and I've lost track of the number of times i've used CEffectData:SetOrigin (or something similar) to send color information to an effect. It would be nice to have a function like :SetAdditionalData() that we could use to send extra stuff without having to use inappropriately-named functions.[/QUOTE]
Datastream?
Although I think that you should never send anything over the umsg limit, make the table shared and then modify the values via umsgs?
[QUOTE=ZenX2;22918409]what about
[lua]
if SERVER then
local tbl = {"ima serverside table", 438, true}
SendUserMessage("ATest", unpack(tbl))
end
if CLIENT then
local tbl = {}
usermessage.hook("ATest", function(um)
local tbl = {um}
end)
end
[/lua][/QUOTE]
Wouldent work, your just putting the bf_read object in a table. the client must know which order and type the variables is in
If you need to sync a table create it shared then predict on the client.
[QUOTE=ZenX2;22918409]what about
[lua]
if SERVER then
local tbl = {"ima serverside table", 438, true}
SendUserMessage("ATest", unpack(tbl))
end
if CLIENT then
local tbl = {}
usermessage.hook("ATest", function(um)
local tbl = {um}
end)
end
[/lua][/QUOTE]
[lua]
require("glon")
if SERVER then
local tbl = {"ima serverside table", 438, true}
SendUserMessage("ATest", glon.encode(tbl))
end
if CLIENT then
local tbl = {}
usermessage.hook("ATest", function(um)
local tbl = glon.decode(um:ReadString())
end)
end
[/lua]
This would work for small tables like yours and if you need anything bigger just use datastreams.
[B]Edit:[/B] Don't use more then 256 bytes in a ussermessage.
[QUOTE=commander204;22919294]If you need to sync a table create it shared then predict on the client.[/QUOTE]
It is hard to make dynamic tables shared because you have to make all your functions shared that uses them. To avoid using any usermessages would open large security holes in the code.
How hard would it be check how big the table is, and then split up the content into x amount of usermessages so it won't overflow?
[QUOTE=ralle105;22919835]How hard would it be check how big the table is, and then split up the content into x amount of usermessages so it won't overflow?[/QUOTE]
That is basically how data streams work.
[QUOTE=polkm;22919882]That is basically how data streams work.[/QUOTE]
Ah I see.
A function to draw a material partially, if there already is one please let me know.
Only way I can think of is to draw it in a panel and then set the panel's size and position so it will only draw a specific part of that material.
PhysObj:SetMassCenter(offset)
[QUOTE=thomasfn;22851151]Of course clientside has physics, or prediction wouldn't work.[/QUOTE]
There is no physics simulation clientside for predicated objects.
The values of Position and Velocity are predicted for server side physics objects.
Client side physics objects(stuff like gibs) are physically simulated client side.
Doors, Ragdolls and Dynamic Props are physically simulated on the client side. These are the exception to the rule.
[QUOTE=whitespace;22920222]A function to draw a material partially, if there already is one please let me know.
Only way I can think of is to draw it in a panel and then set the panel's size and position so it will only draw a specific part of that material.[/QUOTE]
Easy way: [b][url=http://wiki.garrysmod.com/?title=Render.SetScissorRect]Render.SetScissorRect [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
More advanced way: [b][url=http://wiki.garrysmod.com/?title=Surface.DrawPoly]Surface.DrawPoly [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
You should try to understand how DrawPoly works, it's quite useful because not only you can draw only part of a material, but you can also deform and rotate it.
To create clientside physics for props you create them using an effect, but that's lame anyway.
I want more clientside stuff! Ragdolls, ropes, trails (can be recreated though) and all that stuff.
] lua_run_cl ents.Create('prop_ragdoll')
Can't find factory for entity: prop_ragdoll
If gmod just had the factory stuff or whatever that is for all entities clientside then it would be awesome.
[QUOTE=CapsAdmin;22926125]To create clientside physics for props you create them using an effect, but that's lame anyway.
I want more clientside stuff! Ragdolls, ropes, trails (can be recreated though) and all that stuff.
] lua_run_cl ents.Create('prop_ragdoll')
Can't find factory for entity: prop_ragdoll
If gmod just had the factory stuff or whatever that is for all entities clientside then it would be awesome.[/QUOTE]
It would also rock to be able to create info_particle_system and env_projectedtexture on the client.
[QUOTE=CapsAdmin;22926125]To create clientside physics for props you create them using an effect, but that's lame anyway.
I want more clientside stuff! Ragdolls, ropes, trails (can be recreated though) and all that stuff.
] lua_run_cl ents.Create('prop_ragdoll')
Can't find factory for entity: prop_ragdoll
If gmod just had the factory stuff or whatever that is for all entities clientside then it would be awesome.[/QUOTE]
The reason we don't have this is because the engine isn't written to allow a client side entity factory for server side entities, else it would just not work and probably crash trying to do serverside things.
Maybe something to make an entity rotatable by using it and moving the mouse. :v:
Sorry, you need to Log In to post a reply to this thread.