[quote:3pclflqo]On the debugger, I can see the "spawn" variable changing exactly as I wanted to, but the sprite never appear. Any idea what I did wrong ?
- Add a family containing all the sprites, e.g."Sprites"
- Add a family instance variable, e.g. "index"
- Edit that variable for every Sprite and set it to the Sprite's number (don't set it in the event sheet, set it in the object properties)
- Delete that long chain of conditions you referred to (Spawn=X, Spawn=Y,...) and replace it by this:
[quote:3pclflqo]I know I will be working with exactly 18 players, so I want to have exactly 6 in each room, but it has to be random.
[quote:3pclflqo]I found a way to lead players to different chatrooms, but I am not satisfied since I have no way to keep balance between the different rooms.
In your .capx, I can't find the way you are managing the different chatrooms...
The way I would go about this, is the following:
- since the Multiplayer-plugin included rooms can't communicate between each other, we need to have multiple game rooms in one actual multiplayer room
- To assign peers to different rooms on joining, I'd use a global variable storing the room number you are in and using that variable to differentiate between messages that come from the host (to determine whether that message is important to you).
I'd also use three dictionaries, one for each room, to determine how many people there are in one room and whether it is full or not.
Those dictionaries are used by the host. When a peer joins, the host will go through the dictionaries one by one. As soon as one room is found where the dictionary's keycount is below 6, it will send the room number to the peer and add the peer to the dictionary. Randomness should be easy to add here.
[quote:3pclflqo]I want the "creatures" (presently represented with big numbers from 1 to 30) to appear in a random order and appear only once.
I'd recommend you using blackhornet 's Smart Random plugin which allows you to get a random value out of a set amount of numbers while assuring that a set amount of numbers doesn't appear multiple times.
[quote:3pclflqo]A new one should appear every time the timer reaches 0. Here, I can't even make them appear at all and I don't understand why.
I'd recommend giving the "creature distribution" task to the host only.
The host would either have a "Every X seconds" or a "timer" behavior.
(If you use the timer, broadcast the random value under the "On timer" event. Immediately after that, start a new timer)
Try to transfer this task to the host only and see whether that fixes the issue, we will deal with that later if the problem remains.
[quote:3pclflqo]I still have no idea at all for how to compare what players wrote in the "answer" textbox and give them point for every other player that gave the same answer.
Again, the best solution is to give those tasks to the host.
When a peer submits the content of the "answer" textbox, it will send it to the host. The host will store that in a dictionary, one for each room, or a single array.
When the host receives an answer, he will check whether that answer already exists in the appropriate dictionary/array coordinate. If it does, it will add one to the value (dictionary) or the array's Z/Y value (array).
If it doesn't exist yet, the host will add a new key (dict) or a new Y value (array).
(In the array, the X value will be the room.)
Note: dictionaries for this will be easier to handle, while an array will be more compact.
Points for players:
This will be a combination of host-/peer-sided to improve performance on the host.
The host will use the same dictionaries /array as mentioned above.
(But since points are room-independent, we don't need to compare the room variables here)
Depending on whether you want the points to be given immediately after one creature round is over or after the whole game is over, there are different approaches.
When the peer submits an answer, he will save what he submitted in a variable to be able to send that to the host at the end of the creature round.
When the round is over, he will send that value to the host.
The host then checks with his dictionaries/array and see whether (and how many times) that answer has been given and send the appropriate amount of points to the peer that sent the answer.
At the end:
The peer will store all his answers in a dictionary, sorted historically.
When the game is over, the peer will send his dictionary (as JSON) to the host. The host will have a dictionary for each peer which he loads from the JSON he just received.
he will then go through his dictionaries/array and see how many times each item in the dictionary has been given before and give points.
Note: since it's probably very unlikely that the same name will appear multiple times across different creatures, we can compare all the dictionaries/the whole array without differentiating between rounds.
[quote:3pclflqo]tell me if you think this seems possible
Not a casual task, but yes, it is possible.
Though I'd recommend you exporting the project to NW.js later since all that comparing on the host-side will take up some CPU and NW.js can use more CPU power than a browser tab.
(Assuming, you don't use necessarily use high-end PCs only for that project)
[quote:3pclflqo]what tutorial I should read
That depends on what topics you think you need help with. I won't put out links for every single object/behavior that will be used in this project, since that would be quite an amount.
And since your project is a very specific, non-generic one, there won't be a tutorial tailored to your project.
If you don't feel sure about a specific element in your project (e.g. arrays or dictionaries), just search for a tutorial for that or ask here or in the forum.
That should be about it.
PS: Don't think I am a C2 expert. I started using C2 in September this year, so I am in no way worth saying that I know everything about it. I just provide what I think is the best option.
I am sure there are better ways to do this (that I don't know of), but this is the way I would do it.