playMaker

Author Topic: Never copy paste your code! works for playmaker?  (Read 1468 times)

dougbello

  • Playmaker Newbie
  • *
  • Posts: 32
Never copy paste your code! works for playmaker?
« on: August 04, 2015, 12:11:06 PM »
After reading and watching this video...

http://gamasutra.com/blogs/JesseAttard/20150728/249741/Effective_Coding_Dont_Repeat_Yourself.php

It got me thinking if the logic is the same for playmaker...

I'm very new in all this programing/gaming thing, but I'm already making some money and nice games, after a 3 months start, thanks to playmaker.

But I'm thinking about the "philosophy of coding here" (if that exists).

In my playmaker programing I use a ton of copy/paste and I was thinking if this is because im really new on all of that or its just the way things should work in playmaker.

I'll give an example that could clarify things.

I'm making a game with checkpoints... In all checkpoints i'm using trigger that activates a bunch of commands, but each checkpoint has his own bool variable (check_01, check_02, and so), so I'm copying all the code and changing only the variable on each checkpoint... I tried using fsm templates, but you can not change anything inside it, and it would be the same as copying code.

That is what I want to know, am I doing it right? Is that the way on playmaker? copy and pasting is ok in playmaker, that is the nature of this system?

Cheers,
Doug

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Never copy paste your code! works for playmaker?
« Reply #1 on: August 04, 2015, 01:21:30 PM »
Hi,
Personally i think that's fine and in many cases less chance thing don't work the way it supposed to and it saves a lot of time.

But what you should always do is Name all your states!
and comment as much as you can inside the descriptions! ( that i still forget to much myself and regret it every time ;) )

I actually miss that in PM,
to have a way to export fsm's (i know it can be done with the normal export)
to use in different games.

Templates values can be edited if the variables inspector is checked
you can change them in the fsm component under Controls