Blockland Forums > Help
Modifying another player's VCE variables?
SectorC:
--- Quote from: phflack on July 17, 2013, 04:43:29 AM ---what are the variables being used for besides this brick?
and I think doom means to have a relay that's going which was triggered by the old player, toggle an event on which sets their value to not clicked it, and stop the loop
then after a delay it starts the new loop with the new player
--- End quote ---
The variables are for a mini-empires server, for keeping score and managing the server's many different statistics, such as food, water, technology level, population, and then I plan to use it later on with a turn-based strategy game to keep score as well. As it gets painful to do the math yourself, I'm attempting to have the server keep track of them.
What you describe is pretty much what I did, but it seems that by activating a toggle to turn on-off relay events the ownership for doing so is passed to the new player.
Doomonkey:
--- Quote from: SectorC on July 17, 2013, 05:04:43 AM ---What you describe is pretty much what I did, but it seems that by activating a toggle to turn on-off relay events the ownership for doing so is passed to the new player.
--- End quote ---
Don't you want the ownership to be passed on to a new player? So that way the next person to control a brick will effect the newest player to have done so.
SectorC:
--- Quote from: Doomonkey on July 17, 2013, 12:23:25 PM ---Don't you want the ownership to be passed on to a new player? So that way the next person to control a brick will effect the newest player to have done so.
--- End quote ---
Yes, but what I meant is that the ownership of the relay events is passed to the person who toggles the modvariable events, making the newest player the target of both modvariable.
Doomonkey:
--- Quote from: SectorC on July 18, 2013, 03:48:12 PM ---Yes, but what I meant is that the ownership of the relay events is passed to the person who toggles the modvariable events, making the newest player the target of both modvariable.
--- End quote ---
I think you are doing it in the wrong order then, but maybe it is impossible with just VCE.
tredden:
--- Code: ---0 onActivate self vce_retrocheck bl_id != <var:br:currentID> 1 7
1 onVariablefalse client centerprint "You have this already"
2 onVariabletrue self vce_modvariable currentID set <var:cl:bl_id>
3 onVariabletrue self vce_modVariable looping set false
4 onVariabletrue client vce_modvariable tech add 2
5 onVariabletrue client centerprint "Tech acquired"
[1000] 6 onVariabletrue self vce_modvariable looping set true
[1000] 7 onVariabletrue self fireRelay
8 onRelay self vce_ifvariable looping == true 9 11
9 [1000] onVariabletrue self fireRelay
10 onVariablefalse client centerprint "Tech lost"
11 onVariablefalse client vce_modvariable tech sub 2
--- End code ---
Bleh... That was boring to type...
Anyway: clicking this the first tine will give the player tech, set their id to the brick, and fire a relay. Onrelay, it checks to see if its looping. If it is, it'll fire another relay a second later [delay is changable].
Then when someone else clicks it, looping becomes false, and within a second the first persons looping is canceled and they lose tech.
After making sure no one is looping anymore, looping is turned back on for the next person.