Difference between revisions of "Package Protocol"

From RAGE Multiplayer Wiki
Jump to navigation Jump to search
 
Line 4: Line 4:
 
For example, a file located in '''client_packages\index.html''' can be referred to with <code>package://index.html</code>   
 
For example, a file located in '''client_packages\index.html''' can be referred to with <code>package://index.html</code>   
 
A file located in '''client_packages\my-resource\index.html''' can be referred to with <code>package://my-resource/index.html</code>
 
A file located in '''client_packages\my-resource\index.html''' can be referred to with <code>package://my-resource/index.html</code>
You can also require json files with it <code>package://my-resource/beasts.json</code>, so it'll be <code>const beasts = require('package://my-resource/beasts.json')</code>
+
You can also require json files with it <code>package://my-resource/beasts.json</code>, so it'll be <code>const beasts = require('package://my-resource/beasts.json')</code>  
 +
 
 +
*'''NOTE''': JSON Require only works in '''CEF'''.

Latest revision as of 13:00, 2 December 2019

When referencing to other files in client_packages, you use package:// The root of this protocol is the client_packages folder.

For example, a file located in client_packages\index.html can be referred to with package://index.html A file located in client_packages\my-resource\index.html can be referred to with package://my-resource/index.html You can also require json files with it package://my-resource/beasts.json, so it'll be const beasts = require('package://my-resource/beasts.json')

  • NOTE: JSON Require only works in CEF.