The Difference between a Library and Scope?

Beetlebomb

New Member
Reaction score
43
Hey guys,

I'm just wondering if someone could explain to me the difference between a Library and a Scope?


They seem to appear the same, and I'd like to use these things in some of my projects.

Thanks for the help,

Beetlebomb
 

Beetlebomb

New Member
Reaction score
43
>Library code is moved to Map Header, making it useful for systems
What do you mean by Map Header? And are you refering to Attachment systems when you say 'systems'?

>Scope code isn't moved anywhere, only advantage AFAIK is that the initializer call is inlined by Map Optimizer (I think)
And I thought scopes were used to remove some worry about syntax errors. I don't quite understand what you meant by this either.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
If a scope uses a function in another scope, there's no guarantee that the "another scope" will be placed before the "a scope". However, if you place that code in a library, it will automatically work, as libraries will always be placed before scopes.

If you put them both in a library, you can always have one library require the other, so it can use the other's functions.

That's the only difference. ;)
 

Flare

Stops copies me!
Reaction score
662
Map Header is the very top part of your map script. And systems can mean anything - attachment systems, damage detection systems, whatever the hell you want to be a system. A system doesn't have to be in a library, but it's generally the best choice since it lets you plan things better

Scopes don't do anything with regard to syntax errors (unless you have public/private syntax located outside a scope/library :p)

I don't quite understand what you meant by this either.
Just means that the function call is made faster (since it'd be a single-line function, I think, can't remember what exactly determines if a function gets inlined)
 

Joker(Div)

Always Here..
Reaction score
86
Use libraries for codes that are called by other codes (i.e systems, scripts, etc.). Use scopes for everything else.
 

SFilip

Gone but not forgotten
Reaction score
634
Please, read the manual before asking questions like this.

yoda-rtfm.jpg
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top