Hey guys , where did I see you pointed out PF sizes you were using? Such a mission to go through thread & find where it was said and the search isn't helping.
2048x2048 ? 4096 x 4096? 2048 x 4096?
Duh, I never went over 2048, but Unity theorically andle those. Be carefull however to the targeted CG cards: need a lot of memory! I thinnk you should not go over 2048*4096... but this needs investigation!
OK playfield looking better now, and plunger and credit and start keys working.
Still to do:
Subway system
Kickers
For the subway is it all in the script or do I need to add something to the table in FP?
Glxb
Haha
. Subway can be very tricky without documentation... it is only by script, you don't need to add something in FP.
As I said in a very old post (can't find it anymore), it is a simulation of all non visible paths... The idea is, at the end, to provide a graphical editor for it.
Basically, you have Input Kicker (entering subway) and Output Kicker (exiting subway). You need to create the Virtual equivalent of those objects, called Subway Nodes (class BxSwNode).
Every BxSwNode can trigger a switch when a virtual ball comes in, and can hold one ball or more as long as a solenoid is not fired or just for a given time.
There are helper functions to create it directly from kickers:
BxSwNode drain = subManager.AddEntrance("Drain"); // Entrance kicker without switch (no additionnal parameter)
BxSwNode pkick = subManager.AddExit("PlungerKicker",9); // Output kicker driven by solenoid 9
You then can add a switch to a kicker for example:
pkick.m_switchSlot = 32; // Through eject switch
The next step is to link those nodes by virtual paths, called edges (BxSwEgde):
BxSwEdge mainThrough = subManager.LinkNodes(m_drain,pkick,0.5f); // main Through edge link (from drain to kicker) taking 0.5 seconds for a ball to cross it)
So if you insert a virtual ball into the drain node, the subway simulation will make it travel through the edge until it reaches the pkick exit node or encounter another ball.
As you can see, there is no "Ballstack" in the VP sense, but you can simulate one by adding switches ON the edge:
BxSwEdgeSwitch throughBall1Sw = mainThrough.AddSwitch(33, mainThrough.m_length - swL * 0.5f, swL); // First switch on the edge
BxSwEdgeSwitch throughBall2Sw = mainThrough.AddSwitch(34, mainThrough.m_length - swL * 0.5f - Global.Physics.g_BallDiameter, swL); // Second switch on the edge
BxSwEdgeSwitch throughBall3Sw = mainThrough.AddSwitch(35, mainThrough.m_length - swL * 0.5f - Global.Physics.g_BallDiameter*2 , swL); // Third switch on the edge
This is equivalent to vp ballstack (switch number 32 is on the exit kicker):
bsTrough.InitSw 0, 32, 33, 34, 35, 0, 0, 0
This is a bit tedious by script, but it has more sense "visually" (press the "M" key in UP to see the subway in action, Link to very old video: http://unit3dpinball...deo=Ngd4VCSMmM0). I will add a utility function to directly create ball stack in futire release, but that will not be needed by the future subway editor...
Finally, you just add balls in the main drain:
// Insert 4 balls in the main through
for(int i=0;i<4;i++)
{
BxSwVirtualBall b = new BxSwVirtualBall();
m_drain.InsertBall(b);
subManager.ReportNewBall(b);
subManager.DoStep();
}
NOTE: on the next release, this last code will nedd to be on a specific function for VPM restart
Well, this is for a quick overview of subway. There is a lot more to learn and to develop. You can for example create nodes without kickers from FP, link multiple inputs to one output, create subway diverters, etc... IMO, subway is very powerfull and can handle a lot of this in a meaningfull way, but it needs documentation (coming) and a visual editor.
I hope this micro tutorial will help you understand it.
Good luck, and do not hesitate to ask if you are a bit lost (this is normal, specially wthout API doc!!!).