Blockland Forums > Suggestions & Requests
Client-Sided Relay
TristanLuigi:
--- Quote from: boodals 2 on October 19, 2013, 01:21:42 PM ---I've built these systems. Before i learnt about VCE loops, i simply used a database, where when a player 'bought' the spell, it fired a relay up a chain of bricks until it found one that hadn't had a relay, which then fired the relay to the side, where the spell events were. Hell, i could probably find a save of it.
However, it is much easier just to use VCE loops. onVariableTrue > Self > VCE_IfValue > "1" "Equals" "1" "Blah" will loop every however long, but it will work with as many clients as you can give it.
Another less-popular way is using functions. State a function called <var:cl:bl_id>, then call it, and have onVariableFunction > Self > CallFunction > "<var:cl:bl_id>" " ". That way, each client can only have one loop, and buying the spell multiple times will not make it fire twice as often, i think.
Edit: Turns out those spell database systems i built were for VCE v4.
--- End quote ---
This is genius. Can you write a more in-depth tutorial on the <var:cl:bl_id> method?
boodals 2:
0 [X] [ 0 ] OnInput > Self > VCE_StateFunction > "<var:cl:bl_id>" "2 3"
1 [X] [ 0 ] OnInput > Self > VCE_CallFunction > "<var:cl:bl_id>" " "
2 [X] [ 100 ] OnVariableFunction > Self > VCE_CallFunction > "<var:cl:bl_id>" " "
3 [X] [ 0 ] OnVariableFunction > Client > DoStuff
Line 0, 1: States and calls the function which is named the clients bl_id.
Line 2: Loops the function every 100ms.
Line 3+: Does stuff with the client.
TristanLuigi:
--- Quote from: boodals 2 on October 19, 2013, 07:25:28 PM ---0 [X] [ 0 ] OnInput > Self > VCE_StateFunction > "<var:cl:bl_id>" "2 3"
1 [X] [ 0 ] OnInput > Self > VCE_CallFunction > "<var:cl:bl_id>" " "
2 [X] [ 100 ] OnVariableFunction > Self > VCE_CallFunction > "<var:cl:bl_id>" " "
3 [X] [ 0 ] OnVariableFunction > Client > DoStuff
Line 0, 1: States and calls the function which is named the clients bl_id.
Line 2: Loops the function every 100ms.
Line 3+: Does stuff with the client.
--- End quote ---
Thanks, that's going to be very useful.