I don't do a lot of javascript programming so I'm wondering with Cloudscript how do we create and use custom objects? In C# I will have a bunch of classes, Player, Item, etc. that I then reference in various places. What is the equivalent in Cloudscript? If I wanted to create a custom "Item" object and re-use it in a bunch of various cloudscripts how would I do that?
Secondary question, can we import external javascript libraries in Cloudscript?
Thanks.
Best Answer
C
Christopher Bonnell
said
almost 6 years ago
1. require("MODULE_NAME"); will import the script in MODULE_NAME to the current script.
1. require("MODULE_NAME"); will import the script in MODULE_NAME to the current script.
2. Nope.
Y
Yaser Prog
said
almost 6 years ago
Hello.
For the second question: You should put the scripts of the library in a Zip archive, then add the archive to the cloud script using import button.But note that the scripts in the archive must be grouped under a folder that exists on the cloud code (if you want to add the library to real-time modules, for example, you must group them in a folder named rtModules)
Dustin Weirich
I don't do a lot of javascript programming so I'm wondering with Cloudscript how do we create and use custom objects? In C# I will have a bunch of classes, Player, Item, etc. that I then reference in various places. What is the equivalent in Cloudscript? If I wanted to create a custom "Item" object and re-use it in a bunch of various cloudscripts how would I do that?
Secondary question, can we import external javascript libraries in Cloudscript?
Thanks.
2. Nope.
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstChristopher Bonnell
2. Nope.
Yaser Prog
Hello.
For the second question: You should put the scripts of the library in a Zip archive, then add the archive to the cloud script using import button.But note that the scripts in the archive must be grouped under a folder that exists on the cloud code (if you want to add the library to real-time modules, for example, you must group them in a folder named rtModules)
2 people like this
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics