Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Bainto on June 24, 2018, 10:38:48 PM
-
Im Also trying to figure out how to use playmaker in order to create a transition from 1 vegetation system layout to another based on a trigger or something along those lines. upon entering a building and reaching a point the vegetation changes so when they exit they see the new vegetation.
-
Hi.
There are probably different ways to do so, but it depends a bit also what platforms you are targeting.
But i think Load Scenes Async 'additive'would be the best way to go.
But if you are still new with PlayMaker, i would suggest you to follow some tutorials and make some simple projects to get familiar with PlayMaker.
And then start your main project
You can find many tutorials on the user tutorials wiki page (https://hutonggames.fogbugz.com/default.asp?W548), on the tutorial page (http://www.hutonggames.com/tutorials_game_design_with_playmaker.php) and on youtube
Here is a little tutorial about Load Scenes Async Additive :
-
I appreciate the help. Thank you :D
-
Ok so i watched the video but it didn't really answer my question on how to do this but ima do a few tests and try and figure it out. The video mostly covered different ways you may have errors but not on how to do this. a step by step video showing the setup would have been more helpful.
Also each package is an asset not a scene or a level. so maybe i need to know how to load and unload assets.
-
Hi.
On the video i am 1st showing these errors as it is very important to know this.
After that (around 6th minute) it is showing how to load/unload.
But you can have multiple scenes loaded and load/unload several parts.
Like in this tutorial (this is a c# tutorial, but if you understand the previous video then you can understand what is happening in this video)
So in your case you would load 'vegetation scene 2' and unload 'vegetation scene 1' upon entering a building and reaching a point .
-
The building blocks you are essentially asking about are:
-make a global variable, lets call it "gameprogress", in a fsm that sets up everything, set this global to "0"(just in case it isn't 0 at startup)
-when you walk into the house, set up a trigger to check what progress is, if 0, maker it 1, if 1, make it two
-in the fsm that sets up your garden, have it look at gameprogress. if 0, load the dirt. if 1, load the sprouts. if 2, load full crops.
now walk in and out of the building, look at your crops. walk in and out again, they should be fully grown.
when it gets tested successfully, move it from global to a fsm int inside your garden fsm, and when you walk in the house(or whatever its set to), int add 1 to the fsm int. (but then again, that might not work, the garden may not be active when you are inside the house. you might need a gardenmanager object that stays active all the time? or just keep the global)
-
ty for the help :D ill take a look and see if i cant figure it out when i get home.
-
My problem so far is ending up with how to order everything is there a diagram someone can draw up or anything XD
-
Hi.
That is very depending on your game flow.
What do you have so far and what are you trying to achieve?
-
so far i tried using a trigger object (a cube set as trigger with mesh render off) set on a path as a test for when the player enters to do a Load Scenes Async Additive however that wont work as it wont work with the asset when i try to add it it comes up with a grayed out box with 2 choices that i cant click, so i added a path to the asset and that comes with no errors but wont work either.
-
Hi.
What asset?
-
Vegitation System on the unity asset store
-
Hi,
Can you share a link to that asset.
you will need to do things differently as you are using an asset
-
https://assetstore.unity.com/packages/tools/terrain/vegetation-studio-103389
-
Hi.
As i don't own the asset, i can't really see how they change the vegetation.
Best is to contact the Author and ask if he could support with playmaker actions.
You can also let him contact me if the author needs some help with that.
-
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
-
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
-
will do, ty :D
-
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.
-
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.
-
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 :
using (namespace from script package)
void OnEnter()
{
SetVegetationPackage("package 1")
}
-
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#
-
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.
-
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
-
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.
-
Hi.
Get/Set properties can indeed be buggy sometimes especially for mobile.
You will need to use the Linker Wizard (http://hutonggames.com/playmakerforum/index.php?topic=11126.0)
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.
-
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?
-
Also i tried using the SetProperty action but it didnt get the results i wanted
-
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
-
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.
-
would this work?
"It seems like you can not destroy objects in the trigger event.
Try setting a local boolan to true and then testing this in Update() doing the code there.
Then setting the boolean back to false.
this way you move the code to update from the trigger. "
this is what the author said. and how would i add this in if so?
-
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.
I like this idea, if Lennart do not want to port to PM, we could do the sponsorship way some time in August. Until then we could gather action requests here.
-
that would be awesome lol
-
so i actually full screened the game to see more of what was happening when i got this error both of it not being able to be used on multiple arrays as well as for when it gives me the visual error with this grey splotch on the screen where as i move it goes crazy. When i actually max screened the game and got this error the other trees from the original package were shooting out of it and moving. idk if this helps but its some extra info. Ill post a pic of the problem.
-
Thank you :D
For? XD
-
I've tried both creating a c# script and using playmaker
Playmaker lets me get to the error so it actually does something but the script does nothing lol, even though it came untested from the creator
-
Hi.
If you get the error also in script it is best to contact the author :)
-
i created a script in collab with the author and they said it was untested, just a thought on how it should go, and it did absolutely nothing. Ive also contacted them about the error on the actually working but screwy playmaker script i made lol
-
Hi.
If he can send me a copy/voucher from his asset i can make the action and he can add then to his asset.
I can't really help if i do not have the asset.