playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - GonerGames

Pages: [1]
1
General Discussion / Re: Activating objects between scenes
« on: January 06, 2018, 11:27:11 AM »
Use a global variable in Playmaker.
eg. Weapon 1 - Bool - True or false. (true unlocked)

You can reference global variables from any scene.


2
Playmaker Help / Re: High precision numbers with PlayMaker
« on: January 05, 2018, 08:06:02 AM »
Moving to a float would also get you a higher value allowable.
int = 2.1e+09 or 2,100,000,000
float= 3.4e+38 or 340,000,000,000,000,000,000,000,000,000,000,000,000

Converting float to string with a format 0 will remove the decimal places from showing. You can also format the string to allow the number to more human readable.

eg. 3 Billion -> 300 billion -> 3 trillion etc. instead of 3,000,000,000 -> 300,000,000,000 -> 3,000,000,000,000

If you are tracking scores above a trillion I, personally, wouldn't be too concerned that float may not give the precision you need as you are getting into massive numbers that start to lose meaning. Not a lot of people even know what comes after a Trillion  :)

Thanks

3
Playmaker Help / Re: Changing backgrounds
« on: December 23, 2017, 06:10:59 AM »
Simplest way I found to change sprites at runtime is make a c# script and use the Playmaker Call Method to access when needed. You will need to make a Resources Folder and then a sub-folder to hold your sprites. In the example we called our sub-folder test.

Code: [Select]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SpriteTest : MonoBehaviour {
   
    //this is the folder in the first level of your Resources Folder
    private string spriteFolder = "test"; //<--Change this string to match folder name

    //The number in the array where the sprite is 0,1,2 etc.
    public int spriteVersion;

    //to get the sprite render component
    private SpriteRenderer spriteR;

    //to dump the sprites into an array from the folder listed above. Note that the sprites get added in order that they are in the folder. First sprite is 0, second is 1, etc.
    private Sprite[] sprites;


// Use this for initialization
void Start () {
        //Get the renderer of the sprite that this script is on.
        spriteR = this.GetComponent<SpriteRenderer>();

        //load the sprites from the Resources Folder for the folder you specified above
        sprites = Resources.LoadAll<Sprite>(spriteFolder);
       
       
            }

    //call this function to update your sprite. use 0,1,2 etc to define which sprite you want to pull from the array.
    public void ChangeBackground(int background)
    {
       
        spriteR.sprite = sprites[background];
    }

4
Playmaker Help / Re: Install playMaker manually for every project?
« on: December 20, 2017, 12:17:29 PM »
When you create a new project in the Unity window, beside the 2/3D selection there is an add asset package button. You can select the packages to install at that time.

Thanks

5
You have your value set as INT. This has the largest value allowable of 2147483647.
Changing this to a float will allow 3.40E+38 = 34 with 37 zeros behind it.
Doubles (which are not natively supported in Playmaker or PlayerPrefs) will get you 1.7E+308 = 17 with 307 zeros behind it.

It is possible to use Doubles with Playmaker. You will need to use a script to store the Double value and then convert to string to save, load and display.

You need to save the string value into PlayerPrefs and then convert it back into a double.

quick example: (just to give an outline)

Code: [Select]
//set up variables
public double scoreCounter;
public string scoreDisplay;

//get double to string value every frame
void Update()
{
//use the scoreDisplay to show value in game - use get property to dump into FSM
scoreDisplay = DoubleToString(scoreCounter);
}

//Functions for converting Double to string or string to double - C format used for currency display
    private static string DoubleToString(double doubleValue)
    {
        return doubleValue.ToString("C");
    }

    private static double StringToDouble(string stringValue)
    {
        if (string.IsNullOrEmpty(stringValue))
            return 0d;

        return double.Parse(stringValue);
    }


EDIT: Buy EasySave 2 from the asset store. This way you can keep the string in Playmaker Globals to save and load easily.
EasySave method:
FSM to save all global variables on exit or pause
FSM to load global variables then a call method to pass the StringToDouble function.
So much easier and secure than playerprefs. (Personal Opinion)

6
Playmaker Bug Reporting / Re: Compilation error
« on: December 08, 2017, 10:38:14 AM »
I know this one is a bit old, but it just happened to us.

Scenario:
I updated to Unity 2017.2.0F3.
Opened an existing small project from 5.6
Tried to build in VS 2017 - errors with Playmaker
Noticed that the namespace for Hutong was not referencing anymore/properly in VS 2017.

Solution:
In the VS 2017 solution explorer window on right hand side, double click on your project name (not the ones with the .editor etc) -> double click references -> look for Playmaker.
In my case I had a yellow triangle in the icon. Once I clicked on the Playmaker reference once it seemed to resolve itself.

Not very technical, but I have had this work on 3 different projects now. 

7
Playmaker Tutorials / Re: Playmaker Array - Truncate / Number Formatting
« on: October 12, 2017, 07:38:45 AM »
Thanks for all the help djaydino. Great support from everyone here is the reason why I try to give back to this group.

8
Playmaker Tutorials / Re: Playmaker Array - Truncate / Number Formatting
« on: October 12, 2017, 05:04:11 AM »
Link fixed now (I hope).
just in case http://www.youtube.com/watch?v=f0CEykKZoXA

9
Playmaker Tutorials / Re: Playmaker Array - Truncate / Number Formatting
« on: October 11, 2017, 01:26:28 PM »
Just re-uploaded with better sound.  Thanks


10
Playmaker Tutorials / Playmaker Array - Truncate / Number Formatting
« on: October 11, 2017, 08:26:18 AM »
Howdy Folks,

Was working on an tap/auto increment game. Here is a simple way to format the numbers using playmaker array.  Hope you all find it helpful.


11
Playmaker Tutorials / Simple IAP and Playmaker Add Funds Button
« on: September 19, 2017, 09:33:29 AM »
Howdy Folks,

Just a quick and simple way to use Playmaker Call Method to add funds in Simple IAP.

https://youtu.be/CR54HUOrvPw


Thanks


12
Playmaker Tutorials / Simple nGUI and Playmaker Timer Related Progress Bar
« on: November 17, 2016, 11:55:27 AM »
Here is a fairly quick (10 min) tutorial on how to make a nGUI progress bar go from 0 - 100 % tracking a countdown timer without scripts.



Hope it helps some of you out

Pages: [1]