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 2 3 4 5 … 18 Next »
Find by Class
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Find by Class
30-04-2022, 11:13 PM, (This post was last modified: 30-04-2022, 11:13 PM by 4N0NYM.)
#1
4N0NYM Offline
absens
****
Posts: 561
Threads: 211
Joined: Dec 2014
Find by Class
So i encountered a very interesting thing:

If someone spawns a Ship Core on another Galaxy (i.e. i am in Universe space and someone spawns a Ship Core on Shakuras) and you track it via Server find.byClass and then net broadcast it to Client it gets turned into a NULL Entity

--@shared 

if SERVER then
    timer.create("U",2,0,function()
        SC  = find.byClass("ship_core")
        for i=1,#SC do
            printConsole(SC[i],"Server")
        end
        net.start()
        net.writeTable(SC)
        net.broadcast()
    end)
else
    hook("net","net",function()
        Table = net.readTable()
        for i=1,#Table do
            printConsole(Table[i],"Client")
        end
    end)
end


Output : 

Entity [533][ship_core] Server
Entity [764][ship_core] Server

Entity [533][ship_core] Client
[NULL ENTITY] Client
Find
Reply
01-05-2022, 02:11 AM,
#2
57e11a Offline
Cheating Donating Member
***
Posts: 198
Threads: 68
Joined: Apr 2019
RE: Find by Class
Well, it makes sense, considering entities out of area aren't guaranteed to exist on the client.

she/her
Founder of The Anisu Corporation
[Image: iZUefQi.gif]
Find
Reply
01-05-2022, 08:49 AM,
#3
4N0NYM Offline
absens
****
Posts: 561
Threads: 211
Joined: Dec 2014
RE: Find by Class
But i transfer them from the Server to the Client, so it should still work. If I searched them via Client it would make sense, but I am searching them on the Server side and then sending them to the Client.
Find
Reply
01-05-2022, 02:11 PM,
#4
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Find by Class
You're sending the entity ID which the client uses to lookup the entity. If the entity hasn't been seen by the client then it'll be null.

This is expected behaviour, you can't force an entity to be networked when it's not visible to the client in Starfall for obvious reasons.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


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

Powered By MyBB, © 2002-2026 MyBB Group.