Hello,
I'm looking for something that is basically, a live table editor. The main table would be server side.
You'd open a menu, type in table name, and then it would show all the data in that table, in text boxes, for to be edited. There'd be of course a save button, to save changes.
Options to remove specific records would also be nice.
How would you see Multi Dimensional tables then?
Okay, well, perhaps it couldn't be as dynamic as I imagined. Couldn't the output of PrintTable() be grabbed though, and then the menus formulated from there?
Basically, I want to be able to edit a table similar looking to this (table is server side), but in real time, using some kind of interface.
[lua]
1:
type = repeldown
bsize = 136
origin = 1545.6088 4.0011 329.5780
2:
type = repeldown
bsize = 136
origin = 1555.3121 541.8204 328.3240
3:
type = repeldown
bsize = 48
origin = 1451.1088 287.2677 437.4353
4:
type = repeldown
bsize = 48
origin = 1449.1088 184.9512 436.8861
[/lua]
Just like. Some sort of derma menu, Like, loop through a table, draw something along the X line.
Loop through inside the other loop drawing down Y?
Just out of my mind.
[QUOTE=Freze;29865731]Just like. Some sort of derma menu, Like, loop through a table, draw something along the X line.
Loop through inside the other loop drawing down Y?
Just out of my mind.[/QUOTE]
Something alike that, yes.
[lua]
for k,v in pairs(MapExploits) do
-- Draw label for each record in table (k), and corresponding values (v)
-- Draw text box for each element in v (type, bsize, origin)
-- Allow editing of that textbox value, and then saving, and perhaps removing.
end
[/lua]
For the origin element, you could even break it into 3 numbers, and have some sliders.
For the saving, I don't believe you can actually edit a value inside a table, can you? So you'd have to remove such record, and add it again with the changed values?
This is a quick outcast. I don't know what else I could do.
Psuedo also.
[lua]
for k, v in pairs(tbl) do
drawshitx()
for n,m in pairs(v)
drawshity()
end
end[/lua]
I don't know what I'm talking about.
Still looking for something like this...
[lua]
local function ReturnTableValues( table )
for key, value in pairs( table ) do
return {key, value}
end
end
[/lua]
untested but should help handle the information the table outputs
[QUOTE=c-unitV2;29947454][lua]
local function ReturnTableValues( table )
for key, value in pairs( table ) do
return {key, value}
end
end
[/lua]
untested but should help handle the information the table outputs[/QUOTE]
That'd return the first key and value in the table as a table.
I've been thinking about this a bit and I think it would be tricky at best, but I might be able to do it.
But the biggest thing I'm wondering, how would you feed it what table you want to edit?
[editline]21st May 2011[/editline]
Idea:
[img]http://dl.dropbox.com/u/9780864/live%20table%20editor%20example.png[/img]
[QUOTE=Feihc;29969996]I've been thinking about this a bit and I think it would be tricky at best, but I might be able to do it.
But the biggest thing I'm wondering, how would you feed it what table you want to edit?
[editline]21st May 2011[/editline]
Idea:
[img]http://dl.dropbox.com/u/9780864/live%20table%20editor%20example.png[/img][/QUOTE]
Looks nice.
Perhaps a concommand? EditTable <table name> ?
Well it would depend on where the table is.
If it's on the client then you just need a way to feed it to the menu.
If it's on the server then you need to umsg it to the client and (depending on table size) that could get slow / would need a lot of umsgs to send the entire table.
Honestly I dont know if this would be worth doing. You can already edit your table in code why do you need to do it in game?
You could edit it manually in the console but ideally if you need to edit a value you would have a function that would do it for you based on the index of the item in the table.
The table I'd want to edit would be server sided.
It would be highly useful for me here to be able to manually edit it ingame. Yes, I could do it via lua directly, but a menu interface would be easier. I could see this being a useful developer tool too?
[QUOTE=Feihc;29971121]Well it would depend on where the table is.
If it's on the client then you just need a way to feed it to the menu.
If it's on the server then you need to umsg it to the client and (depending on table size) that could get slow / would need a lot of umsgs to send the entire table.
Honestly I dont know if this would be worth doing. You can already edit your table in code why do you need to do it in game?
You could edit it manually in the console but ideally if you need to edit a value you would have a function that would do it for you based on the index of the item in the table.[/QUOTE]
I use datastreams to send tables to clients; [url]http://luasearch.overvprojects.nl/?keywords=datastream.StreamToClients[/url]
Doesn't seem to make the gamemode laggy, or anything.
[QUOTE=mcormack1994;29971924]I use datastreams to send tables to clients; [url]http://luasearch.overvprojects.nl/?keywords=datastream.StreamToClients[/url]
Doesn't seem to make the gamemode laggy, or anything.[/QUOTE]
Datastream is slow compared to umsg's - yes, it's easier but you should avoid using it, imo.
[QUOTE=Feihc;29971960]Datastream is slow compared to umsg's - yes, it's easier but you should avoid using it, imo.[/QUOTE]
That's what I heard, but it's not like you're going to be sending tables THAT often?
[QUOTE=mcormack1994;29972058]That's what I heard, but it's not like you're going to be sending tables THAT often?[/QUOTE]
Depends on the table in question and the size of said table. If you have to send a table on certain frequently used hooks or if its a large table you'll notice it starts getting noticeably slower.
[QUOTE=Feihc;29972156]Depends on the table in question and the size of said table. If you have to send a table on certain frequently used hooks or if its a large table you'll notice it starts getting noticeably slower.[/QUOTE]
Ah, I see, I'll watch out for that then - thanks.
Sorry, you need to Log In to post a reply to this thread.