(21-04-2015, 02:51 PM)Destinys Player Wrote: ...aaaaand the code you've given me doesn't work. Doesn't even show the render for a moment. In fact, it appears like it doesn't run on the server at all, i.e. there's no instances when I check it with the profiler, and I really have no idea why it doesn't work.
Sorry if I sound as a douchebag, but that's one way I can tell people that stuff doesn't work. And also I'm slightly angry due to some RL issues, so don't mind me if I do act like a douchebag for some time now...
How about you show the decent code. I see a lot of suggestions but I would love to see how you added these lines to your code.
тѕсм.Person8880 hovers the nerf bat over Tetryon damage
(21-04-2015, 02:42 PM)T-16 Wrote: same, I should've looked at your code and tried to help him get that working.
also one question, are DTVars better than tables for screens? (assuming i was only sending ~12 variables)
DTVars are the best choice for values you need to be always available to the client.
They do 3 things that make them the best choice in this case:
Only get sent when the value is different to what's already set, no matter if you call the setter function with the same value or not.
Network automatically to all clients, even those that join after you've set the value.
Use the built in Source engine entity networking functionality which makes them network quicker and more reliably than net messages.
The times you shouldn't use them, is if you want to invoke an action on the client. Then you need to use a network message so you can run the action on the client when you get the network message.
(21-04-2015, 02:51 PM)Destinys Player Wrote: ...aaaaand the code you've given me doesn't work. Doesn't even show the render for a moment. In fact, it appears like it doesn't run on the server at all, i.e. there's no instances when I check it with the profiler, and I really have no idea why it doesn't work.
From what I see, DTVars simply don't work for me, they never return anything.
Sorry if I sound as a douchebag, but that's one way I can tell people that stuff doesn't work. And also I'm slightly angry due to some RL issues, so don't mind me if I do act like a douchebag for some time now...
The code I posted on its own definitely works, I made sure of that before posting.
Sounds like you might have lost the --@sharedscreen annotation at the top? Could you check that and post back.
21-04-2015, 06:23 PM, (This post was last modified: 21-04-2015, 06:23 PM by Destiny's Player.)
Yep, somehow I've managed to loose the --@sharedscreen annotation. Dunno how, but now it works.
And still, I still don't really understand how do DTVars work. When I try to use them in my code, they always return nil.
if SERVER then
Faction = faction.getOnlineMembers()
net.setDTVar("Table",1,Faction)
else
CFac = net.getDTVar("Table",1)
printConsole(CFac)
end
This, for example. I'm sure that I'm messing something up, but what? I don't know. My theory is that DTVar's are not compatible with Tables, but I'm not sure.
Thank you for your help! I hope that I'll slightly slow down with the noobyng from now on, as I think that I've finally gotten the basics of Starfall and this kinda thing...