MovieSandbox Puppet Implementation
From Moviesandbox
(3 intermediate revisions not shown.) |
Current revision
Explanation of Puppet implementation for MSB
Every Character (Pawn) has a PawnInputControl that gets Spawned when creating the Pawn -> in the appropriate Button.
In case of the GATech Puppet, the Spawning Button would be MSBCreatPuppet.uc in the MSBMenuButtons Package.
The PawnControl that we create here is called MSBPuppetControl (in the MSBCode Package).
As a Link to the outside world, every PawnControl gets a udpLink and a reference to the Mouse, where all the native unreal input is being processed.
For now, all we need is the udpLink, which in our case (cause we're special) is a MSBPuppetUdpLink ( in the MSBCode Package).
What is done when?
The event ReceivedBinary(...) function in MSBPuppetUdpControl takes care of incoming data. It can either store it in variables inherited from its superclass (like joyXAxis, etc...) or create its own variables. When creating variables, keep in mind that you will need a Cast when dealing with them in MSBPuppetControl!
MSBPuppetControl creates its own udpLink in the initUdp() function. Actual code can get executed in Tick(). The Pawn is referenced through the myPawn variable defined in the SuperClass.
Next steps
The implementation is basically integrated into Moviesandbox, wich would be impractical for future moviesandbox updates. I therefore restructured all the classe needed into a seperate package called GATech Puppet, to work more as an add-on than as an integrated part. It's something we can do with your implementation as well.
You need to change the MSBPuppet reference in MSBCode.MSBMenuButtonActor.uc to the new packagename for the code to work (it will compile even if you forget to change, but th actormenu will be weird...).