playMaker

Author Topic: Vegetation System  (Read 8393 times)

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Vegetation System
« Reply #15 on: July 02, 2018, 09:30:09 AM »
i know it works within the vegitation studio to where you can open each inside the studio, however he also advertises you can set it up to change seasons and other things while playing

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Vegetation System
« Reply #16 on: July 03, 2018, 08:39:53 AM »
Hi.

To change season you will need to do that in a script with some code.

But..
Many 3rd party asset uses certain code to work with their assets.
That code (which you would use i a script) can also be used for making actions for PlayMaker to be used with that asset.

The author can make PlayMaker actions to support its assets, or someone else can make them (but they would need to have a copy from the asset to see what code is used).

So it is best to contact the author from that asset 1st

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Vegetation System
« Reply #17 on: July 03, 2018, 11:04:47 AM »
will do, ty :D

verybinary

  • Junior Playmaker
  • **
  • Posts: 81
    • The Museum of Digital
Re: Vegetation System
« Reply #18 on: July 03, 2018, 11:06:32 AM »
that asset seems to be an extension on unity's terrain. I cant recall seeing any scripting that can change those at runtime...
unless im wrong about the usefulness of the terrain system, you might have to use the terrain system to build your world, and use standard game objects to create your vegetation that grows based on code.

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Vegetation System
« Reply #19 on: July 03, 2018, 11:25:39 AM »
What you can do is create 2 vegetation packages. 
They can both have different grass, trees etc.

when you want to, trgger or other game logic you call SetVegetationPackage on the VegetationSystem component and it will load the new vegetation.

I have not used Playmaker but I do not think there should be any problem to use both in the same project.

This is the reply i got.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Vegetation System
« Reply #20 on: July 03, 2018, 01:00:21 PM »
Hi.

Probably the author has no idea what playmaker is...

You can explain to him that Playmaker is a 'visual scripting solution' that works with 'Action' (small scripts do do certain things in unity)
So that no coding is required when using PlayMaker.

I can see if i can make the action, but i need to know how to call SetVegetationPackage

Maybe you can find something in the documentation.

Probably the call is done, something like this :
Code: [Select]
using (namespace from script package)


void OnEnter()
{
SetVegetationPackage("package 1")
}

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Vegetation System
« Reply #21 on: July 04, 2018, 08:01:20 PM »
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Load_Vegitation : MonoBehaviour
{
     public VegetationSystem VegetationSystem;

    void OnTriggerEneter(collider other)
{
   VegetationSystem.SetVegetationPackage(1,true);
 
}
}

rough setup with c#

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Vegetation System
« Reply #22 on: July 05, 2018, 01:43:32 AM »
I have it, you can change certain things at runtime with SetProperty action, but it may be buggy don't know why, it works on build but on editor it throws error sometimes.
Would be great if it had actions for PM.

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Vegetation System
« Reply #23 on: July 05, 2018, 01:45:36 AM »
I have it, you can change certain things at runtime with SetProperty action, but it may be buggy don't know why, it works on build but on editor it throws error sometimes.
Would be great if it had actions for PM.

what do you mean by this statement how would i add this and how would it help?

also this is what i got as a good start it allows me to setup the actual vegitationstudio and everything however upon entering it still does not change from the 0 package to the 1 package

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AwesomeTechnologies;

public class Load_Vegitation : MonoBehaviour
{
    public VegetationSystem VegetationSystem;

    void OnTriggerEneter(Collider Load_Vegitation)
    {
        VegetationSystem.SetVegetationPackage(1, true);

    }
}

also i know Vegetation was misspelled, its just what i had called it and didnt change it .. brain fart lol
« Last Edit: July 05, 2018, 01:48:29 AM by Bainto »

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Vegetation System
« Reply #24 on: July 05, 2018, 02:51:56 AM »
I am using to change spawn rate at runtime.
Drop the Vegetation system script in Set Property and it will show available options to change.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Vegetation System
« Reply #25 on: July 05, 2018, 04:09:09 AM »
Hi.
Get/Set properties can indeed be buggy sometimes especially for mobile.
You will need to use the Linker Wizard

I have contacted Lennart (the author from this asset) thru discord,
So lets see what will happen :)
Worst case you can sponsor me so that i can purchase (i do not need this asset so i am not planning the purchase this myself) the asset and i can make actions for you.

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Vegetation System
« Reply #26 on: July 05, 2018, 01:41:44 PM »
ok so i figured this out so far... i tried using playmaker and logically doing this and got it to work but it throws an error on trigger enter. it actually throws 655 if the same error.
ArgumentException: only single dimensional arrays are supported for the requested action.

this is what i came up with

Trigger Enter -> Call Method (Behaviour = VegetationSystem, Method = SetVegetationPackage, Index = 1) -> Exit Trigger -> Destroy Object (trigger)

This actually works and calls the correct asset however it really lags the scene almost like it freezes and and then actually freezes the char but i can still ctrl p and stop the game to edit

any ideas?

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Vegetation System
« Reply #27 on: July 05, 2018, 01:42:30 PM »
Also i tried using the SetProperty action but it didnt get the results i wanted

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Vegetation System
« Reply #28 on: July 05, 2018, 01:56:39 PM »
ok so i shrunk the trigger to basically the player runs into and and runs out of it causing the trigger to trigger and be destroyed almost immediately. this removes the freeze problem (idk why) but it comes up with 655 different errors saying that i cant use destroy object i must use destroy. And just like before however, i get this wierd gray blob the moves on the screen at the center of the screen. lol

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Vegetation System
« Reply #29 on: July 06, 2018, 10:33:51 AM »
this is one of the errors i get. I redid the setup and now its not giving me the other 1 and i dont even have it set to destroy so i think it has something to do with the fact that its destroying the 1st vegetation package. This also contains the visual error probably having to do with the Destroying GameObjects immediately error.