Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 14 15 16 17 18 Next »
Problems with an emitter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pages (2): « Previous 1 2
Threaded Mode
Problems with an emitter
21-04-2015, 05:32 PM,
#11
LocInt Offline
Long gone
****
Posts: 489
Threads: 91
Joined: Aug 2014
RE: Problems with an emitter
(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
Website Find
Reply
21-04-2015, 05:52 PM,
#12
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Problems with an emitter
(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:
  1. 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.
  2. Network automatically to all clients, even those that join after you've set the value.
  3. 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.
Find
Reply
21-04-2015, 06:23 PM, (This post was last modified: 21-04-2015, 06:23 PM by Destiny's Player.)
#13
Destiny's Player Offline
A passing by member
***
Posts: 237
Threads: 35
Joined: Dec 2013
RE: Problems with an emitter
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.
Find
Reply
21-04-2015, 08:06 PM,
#14
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Problems with an emitter
There's no table type. DTVars only types are "Angle", "Bool", "Entity", "Float", "Int", "String" and "Vector".

DT = Data Table, i.e it's already a table.
Find
Reply
21-04-2015, 08:22 PM,
#15
Destiny's Player Offline
A passing by member
***
Posts: 237
Threads: 35
Joined: Dec 2013
RE: Problems with an emitter
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...
Find
Reply
21-04-2015, 09:41 PM,
#16
Iajret Offline
Valued donator and member
****
Posts: 15
Threads: 4
Joined: Jul 2014
RE: Problems with an emitter
With "chip" parameter in DTVar I can send values to another SF chip? Or how it works?
Find
Reply
22-04-2015, 05:18 AM,
#17
LocInt Offline
Long gone
****
Posts: 489
Threads: 91
Joined: Aug 2014
RE: Problems with an emitter
(21-04-2015, 09:41 PM)Iajret Wrote: With "chip" parameter in DTVar I can send values to another SF chip? Or how it works?

Actually you send values to another SF chip by

Code:
if (net.start(Screen)) then

Screen is the screen entity.

Note: this work only between your own chips.

тѕсм.Person8880 hovers the nerf bat over Tetryon damage
Website Find
Reply
22-04-2015, 05:41 PM,
#18
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Problems with an emitter
(21-04-2015, 09:41 PM)Iajret Wrote: With "chip" parameter in DTVar I can send values to another SF chip? Or how it works?
The chip parameter lets you pass in another Starfall entity that you own to get/set DTVars for.

Basically,
net.setDTVar( "Bool", 1, true )
is the same as:
net.setDTVar( "Bool", 1, true, ents.self() )
so you can put whatever Starfall entity you own instead of ents.self() and it'll get/set for that.
Find
Reply
« Next Oldest | Next Newest »
Pages (2): « Previous 1 2


  • View a Printable Version
Forum Jump:


Users browsing this thread:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.