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 »
Proposed change to entities
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
Proposed change to entities
06-03-2015, 08:25 PM,
#1
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
Information  Proposed change to entities
I'm adding bindings to physics objects to Starfall, and I've made it so that if you try to do anything with an invalid physics object, it throws an error instead of returning nil or doing nothing.

This makes it much easier for me to bind stuff and handle the behaviour.

I want to make the same change to entities, but I'm aware this may break people's stuff. I wanted to ask what people who use Starfall regularly think of the idea, rather than go ahead and change it without warning.

Pros:
  • Using an invalid entity is immediately obvious, not hidden behind a nil return value/do nothing method.
  • Encourages stricter validity checking.
Cons:
  • Makes IsValid checks essentially mandatory, which can add boilerplate code to places.

Also, to help with this, I'm going to make IsValid a standard function in the global table, which will check for both nil values and valid entity/panel/physics object values.

Note that for now only the new Physics Object type has this behaviour.
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
Proposed change to entities - by Person8880 - 06-03-2015, 08:25 PM
RE: Proposed change to entities - by Person8880 - 07-03-2015, 10:00 AM
RE: Proposed change to entities - by TheOneAndOnlyTee - 07-03-2015, 11:59 AM
RE: Proposed change to entities - by Person8880 - 07-03-2015, 03:03 PM
RE: Proposed change to entities - by LocInt - 07-03-2015, 03:30 PM

  • 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.