I am testing multiplayer and need a way to calculate with the number of players which are online. The chatbox message works fine, so the game has a way to access the variable I need.
But if I try to use this as a variable for a conditional branch, the integer remains 0. (You see this in the picture in the text line "..you are the only player online...", which depends on the condition: number of players =< 1).
There is an event trigger "login", will there be the counterpart "logout"?
The reason why I have to find a solution is that re-arrangement of pathways and resetting of dungeons is preferably done when the first player logs in on the empty server.
The game has access to the variable, since the correct value is displayed in the chatbox. But it is presented as a string, not as an integer, hence I can not calculate with the variable.
Quote
Set Variable > Online Players Int = Online Players String
Since with numbers, the string is the same as the integer, this works fine as a substitute for functions like Int to String, Float to Int and so on, which are not (yet) in the engine.
I rewrote the event which now works fine. I will do some testing with players that logout during battles.
EDIT 2:
...Afterthought:
For the purpose of creating such a simple condition as in the event shown above, without having to calculate, you could skip the conversion from string to integer and use the condition: NOT [PlayersActiveString = 1].
Question
Uranochos
I am testing multiplayer and need a way to calculate with the number of players which are online. The chatbox message works fine, so the game has a way to access the variable I need.
But if I try to use this as a variable for a conditional branch, the integer remains 0. (You see this in the picture in the text line "..you are the only player online...", which depends on the condition: number of players =< 1).
There is an event trigger "login", will there be the counterpart "logout"?
The reason why I have to find a solution is that re-arrangement of pathways and resetting of dungeons is preferably done when the first player logs in on the empty server.
Any suggestions?
____________________________________________________________________________________________________________________________
EDIT:
Thank you, AisenArvalis!
The game has access to the variable, since the correct value is displayed in the chatbox. But it is presented as a string, not as an integer, hence I can not calculate with the variable.
Since with numbers, the string is the same as the integer, this works fine as a substitute for functions like Int to String, Float to Int and so on, which are not (yet) in the engine.
I rewrote the event which now works fine. I will do some testing with players that logout during battles.
EDIT 2:
...Afterthought:
For the purpose of creating such a simple condition as in the event shown above, without having to calculate, you could skip the conversion from string to integer and use the condition: NOT [PlayersActiveString = 1].
Simple solution found
Link to comment
Share on other sites
4 answers to this question
Recommended Posts