Author Topic: VCE Slot Machine  (Read 1311 times)

I am requesting a modification of Swollow's slot machine brick that, instead of using points to spin, it uses VCE variables.

If that can't be done (or if it's just not worth the effort), then could I have a save of a VCE slot machine made using bricks and events?

$Pref::Swol_SlotMachine::PlayerVariable "score" the variable to decrement/increment from/to
that might be the only thing that you need to change

unsure about what youre talkin about but i just have one premade that i did a while ago
i attached a new dup save, it goes into blockland > config > newduplicator > saves

unsure about what youre talkin about but i just have one premade that i did a while ago
i attached a new dup save, it goes into blockland > config > newduplicator > saves
I am requesting a modification of Swollow's slot machine brick
he wants the brick addon to be modified, not a multiblock structure with events

he wants the brick addon to be modified, not a multiblock structure with events
oh balls i misunderstood completely

he wants the brick addon to be modified, not a multiblock structure with events
If that can't be done (or if it's just not worth the effort), then could I have a save of a VCE slot machine made using bricks and events?
works nearly the same, I'll take it
(but i still kinda want the single brick)

that might be the only thing that you need to change
not sure how exactly to change that

I think you would just do
$Pref::Swol_SlotMachine::PlayerVariable = "othervariable";
in the console
I also kind of remember VCE saving variables on the client/player, so you'd need to make them match up

went looking through VCE
Code: [Select]
// Introduced in v5, variables are now stored in brick groups.
// Basically if you are working with variables, all variables that you modify will only exist in your brickgroup, so now one else can modify them.
lol that's weird
I think v4 variables stored it directly

edit: found the variable
it's <client>.processingBrick.getGroup().varGroup.valueClient_<clientID>_<variable name>
just it's not quite as easy to put into the slot machine preference variable as I had hoped

edit: was looking through the slot machine code
Code: [Select]
registerOutputEvent("fxDTSBrick","slotMachine","list pullLever 0 setPowered 1" TAB "string 200 72",1);
$Swol_SlotMachinePoweredWords["enabled"] = " enable enabled yes on power powered 1 true affirmative ";
$Swol_SlotMachinePoweredWords["disabled"] = " disabled no off false 0 unpowered negative ";
$Swol_SlotMachinePoweredWords["toggled"] = " toggle toggled switch -1 biloveual ";
lol@phrases

Code: [Select]
function fxDtsBrick::setColorFx(%br,%fx)
{
if(%br.isSlotMachine)
if(%fx == 5)
return; //Looks like stuff
parent::setColorFx(%br,%fx);
}
function fxDtsBrick::setShapeFx(%br,%fx)
{
if(%br.isSlotMachine)
if(%fx > 0)
return; //No
parent::setShapeFx(%br,%fx);
}
and very against people having fun with paint cans

but onward to the important bits
Code: [Select]
function gameConnection::slot_getVariable(%pl)
{
%vname = $Pref::Swol_SlotMachine::PlayerVariable;
%str = getSubStr(%vname,0,1);
%ret = getSubStr(%vname,1,strlen(%vname));
switch$(%str)
{
case "a": return %pl.a[%ret];
case "b": return %pl.b[%ret];
case "c": return %pl.c[%ret];
case "d": return %pl.d[%ret];
case "e": return %pl.e[%ret];
case "f": return %pl.f[%ret];
case "g": return %pl.g[%ret];
case "h": return %pl.h[%ret];
case "i": return %pl.i[%ret];
case "j": return %pl.j[%ret];
case "k": return %pl.k[%ret];
case "l": return %pl.l[%ret];
case "m": return %pl.m[%ret];
case "n": return %pl.n[%ret];
case "o": return %pl.o[%ret];
case "p": return %pl.p[%ret];
case "q": return %pl.q[%ret];
case "r": return %pl.r[%ret];
case "s": return %pl.s[%ret];
case "t": return %pl.t[%ret];
case "u": return %pl.u[%ret];
case "v": return %pl.v[%ret];
case "w": return %pl.w[%ret];
case "x": return %pl.x[%ret];
case "y": return %pl.y[%ret];
case "z": return %pl.z[%ret];
case "_": return %pl._[%ret];
}
}

function gameConnection::slot_setVariable(%pl,%amt)
{
%vname = $Pref::Swol_SlotMachine::PlayerVariable;
%str = getSubStr(%vname,0,1);
%ret = getSubStr(%vname,1,strlen(%vname));
switch$(%str)
{
case "a": return %pl.a[%ret] = %amt;
case "b": return %pl.b[%ret] = %amt;
case "c": return %pl.c[%ret] = %amt;
case "d": return %pl.d[%ret] = %amt;
case "e": return %pl.e[%ret] = %amt;
case "f": return %pl.f[%ret] = %amt;
case "g": return %pl.g[%ret] = %amt;
case "h": return %pl.h[%ret] = %amt;
case "i": return %pl.i[%ret] = %amt;
case "j": return %pl.j[%ret] = %amt;
case "k": return %pl.k[%ret] = %amt;
case "l": return %pl.l[%ret] = %amt;
case "m": return %pl.m[%ret] = %amt;
case "n": return %pl.n[%ret] = %amt;
case "o": return %pl.o[%ret] = %amt;
case "p": return %pl.p[%ret] = %amt;
case "q": return %pl.q[%ret] = %amt;
case "r": return %pl.r[%ret] = %amt;
case "s": return %pl.s[%ret] = %amt;
case "t": return %pl.t[%ret] = %amt;
case "u": return %pl.u[%ret] = %amt;
case "v": return %pl.v[%ret] = %amt;
case "w": return %pl.w[%ret] = %amt;
case "x": return %pl.x[%ret] = %amt;
case "y": return %pl.y[%ret] = %amt;
case "z": return %pl.z[%ret] = %amt;
case "_": return %pl._[%ret] = %amt;
}
}
probably easiest way is to overwrite these functions

so put
Code: [Select]
function gameConnection::slot_getVariable(%client)
{
return %client.processingBrick.getGroup().varGroup.valueClient_[%client @ "_<variable name>"];
}

function gameConnection::slot_setVariable(%client, %amt)
{
%client.processingBrick.getGroup().varGroup.valueClient_[%client @ "_<variable name>"] = %amt;
}
in the console, replacing <variable name> with your variable name
(ie, for testing I was using ducknugget as my variable name, so [%client @ "_ducknugget"] for the whole square bracket section)

... except these won't fit in the console
so probably just edit the file directly
« Last Edit: June 12, 2017, 02:13:00 PM by phflack »