Problem with $getNumRoles() function

8 views
Skip to first unread message

Minxi Lin

unread,
Aug 13, 2025, 11:45:36 PM8/13/25
to classEx - Help and Discussion Forum
Hello all,

I wanted to develop a game with four different roles, and I chose "role and group" with four roles in "assignment and matching." 

I have a problem with $getNumRoles() function when I was trying to retrieve the number of people in each role. The code was "$var_name = $getNumRoles();" and it returned an empty role. I am not sure if this problem is because of the code itself or the role assignment. 

Thank you for your support!

Sincerely,
Minxi

Marcus Giamattei (classEx Team)

unread,
Aug 15, 2025, 5:16:39 AM8/15/25
to classEx - Help and Discussion Forum
Hej Minxi,
I tried it and it works. It only does not work in the first stage of a game when people are coming in. If you need it in the first stage, you need to add a stage (eg. Welcome stage) and only use the function in the second stage.

Best, Marcus
Reply all
Reply to author
Forward
0 new messages