playMaker

Author Topic: Placing buildings, selecting buildings, displaying info, templates  (Read 3189 times)

DuaneDog

  • Playmaker Newbie
  • *
  • Posts: 9
Working with playmaker and loving it.  I'm very close to where I need to be and can create the building objects, have them create their own objects from the buildings and all that. But I could really use some help on how with playmaker to best handle clicking and selecting a building. 

For now, I've been prototyping where the buildings just spawn in a column one after another... ideally I would like people to be able to click and place a building. Next, I'm having trouble figuring out how I can click the building and have that FSM available.

I've watched a lot of tutorials and looked for this but I just seem to be missing what it takes to wire something up like this.

Also... from a design standpoint I would like an opinion. Since I'm going to have multiple players in the future I somewhat see having 2 manager layers. One layer is at the player to centralize all events for the building, selling, leveling, skills, etc.... Then another high level manager that coordinates any necessary interactions for managing the players.

Finally templates...  From a re-usability standpoint I want all the placement, selection, showing info, buying, selling... to be like the foundation for my buildings. But then depending on the building and faction there could be dependencies that are different. For example a level 3 mage tower has a lot of dependencies while a farm has none. Yet ideally I could start with a base fsm on my 'building' model, then sub-class as if I were in C# to have a 'barracks' which then could have additional variables and actions in the states.  Is this possible or feasible design?

I think if I could just get a rough high level perspective from people who know Playmaker well it would go a long way. Right now I can make it work but I'm copying and pasting a lot and would approach so much differently if I understood how to use the templates/sub-classing and all that like with C# and so forth. I realize there is not THAT level of power but at least a best practice for reusing core components.

We can't expect every deviation of a monster, NPC, or structure to have one off versions that would need to be manually changed if core behavior of the base class requires changes... or is that just the way it is?

Many thanks in advance!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Placing buildings, selecting buildings, displaying info, templates
« Reply #1 on: January 30, 2014, 06:14:16 AM »
Hi,

 Using templates should do the trick very well. for sure avoid duplicating fsms, that's a bad idea.

 If your buildings are build programmatically, there is no reason not to also add components programatically, such as required Fsm acting as interfaces.

 I use this all the time. Each object thst are not necessarly prefabs can still expose the SAME interface with the following trick:

the top level Object of this element iny our game would have an fsm called "INTERFACE" or something standardize in your framework.

that "INTERFACE" Fsm would feature the same and expected variables and implement expected global events.

 then from the outside world it's easy to communicate with ANY elements that comply with the define interface above. Use actions like "Get Fsm XXX" and rely on this action to fail silently if the interface if not found or return one of its value if defined.

Do you think that could help in your situation?

bye,

 Jean