Sign In Register

How can we help you today?

Start a new topic
Answered

Hearthstone Tutorial - processRank module?

Hi, I'm trying to do the Hearthstone tutorial and I'm a bit confused about the processRank module. What exactly is a module and where does this code go?


Sorry if this is an obvious question, I'm just getting started with Gamesparks.


Thanks!


Best Answer

Under Cloud Code there is a folder in the scripts sidebar called Modules.  Click the + sign next to the folder to create a new Module.


When you want to load a module in a different script you can use either:

Require("name of module")

RequireOnce("name of module")


Keep in mind that you are continuing execution within the module.  It's not self contained.  Meaning that if you had var animal = "Cat"; in the parent script, that exists and can be altered inside of the module.

1 Comment

Answer

Under Cloud Code there is a folder in the scripts sidebar called Modules.  Click the + sign next to the folder to create a new Module.


When you want to load a module in a different script you can use either:

Require("name of module")

RequireOnce("name of module")


Keep in mind that you are continuing execution within the module.  It's not self contained.  Meaning that if you had var animal = "Cat"; in the parent script, that exists and can be altered inside of the module.


2 people like this
Login to post a comment