Sorry that I didn't reply earlier.
I don't get a notification when you edit your post without mentioning my username.
Let's go through your questions one by one:
From the first post:
[quote:30npxdth]I see no way to ask for the "first" value in the meaning of "the first of the randomly generated string of value" but only in the meaning "lowest possible value (the opposite of end value)"
[quote:30npxdth]asking for the "next" value for the first time will actually give the first value in the string
Since Smart Random's Expression "next" starts at the minimum of the second value and only "start" returns the first value, you won't be able to simply always use "next".
I suppose you use a function.
You will call the function with the parameter of the random number index you want.
(If you want the first random number, call the function with parameter 1, for the second, choose parameter 2 and so on)
The function itself will check what the parameter ( Function.Param(0) ) is.
If it is 1, it will set the function's return value to "SmartRandom.Start".
If it is bigger than 1, it will set the function's return value to "SmartRandom.Next".
Like this, you can simply call this function with the appropriate parameter when you need a new random number.
[quote:30npxdth]Actually I have trouble now I am using families
Try this .capx I created:
From the second post:
[quote:30npxdth]I can't find a way to synchronize the "timer" global value. Everybody should have the host "timer", but I see no way to broadcast a number value.
When the "timer" value is changed by the host, add an action "Multiplayer: Broadcast message".
- From ID: Leave this like it is, since "" indicates that the message comes from the host, which is what we want
- Tag: Change to what you like, for example "timer"
- Message: Obviously, you put your global variable in this.
- Mode: Leave this like it is too. This is only really important for real-time games (e.g. Multiplayer Shooter)
Also, make sure that you add an event for the peers:
"Multiplayer: On message "timer": Set timer to: 'Multiplayer.Message'".
And make sure, no other action apart from this changes the global variable when you aren't the host.
[quote:30npxdth]I can't find a way to send to each peer, upon connection
There are multiple ways to do this.
First of all,
add this event:
"Multiplayer: On peer connected".
This triggers when somebody joins the same room.
Then, under that event, you can save the ID of the player that just connected or any other information you want by using "Multiplayer.From____" (e.g. FromID, FromAlias). This will return the information of the peer that just connected.
Instead, you could also use "Multiplayer: PeerAliasAt(PeerCount-1)/PeerIDAt(PeerCount-1).
This will return the same values since the player that just connected has to be the most recent player in the room and therefore, this will return his information. ("-1" since PeerAliasAt needs an index which starts at 0 and the PeerCount starts at 1)
When you saved those values (to a dictionary, for example), you can send the needed information, e.g. the group number, to this peer using the aforementioned values.
You need to add an action "Multiplayer: Send message" under the "On peer connected" event.
As the peer ID, use the values mentioned above.
The rest is the same as above.
(Note: you don't have to save the ID/Alias, but it might be useful later)
[quote:30npxdth]Is there a way to simplify the list of 30 events for spawning creatures using family ?
See the .capx I posted above.
[quote:30npxdth]I feel like dictionnaries and arrays will come in handy here, but I am not yet familiar with those. Anyway, next step will be implementing the scoring system, so I will have to learn about it quite soon.
Just tell me where you need help if the C2 manual didn't help you.
Dictionary manual entry
Array manual entry