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 - Doh

Pages: [1] 2 3 ... 5
1
Playmaker Help / Re: Raycast return list or array?
« on: February 16, 2018, 09:58:10 AM »
Hey, "Raycast All" will give you a list of all the objects hit, use "store hit objects" in that action. You define the depth through a "distance" float too.

2
Hey, just had a little look into this.

In response to this part of your query "so I'm trying to find the child and apply a mesh filter with a specified mesh inside" I've done something that seems to answer that and taken a screen shot, it finds the child object (a cube) and turns it into a capsule. It's attached, hope it helps!


3
Sorry I've been away for the last day.

Just watched your video, awesome work!

4
Playmaker Help / Re: Creating a Room-Brush system with Playmaker?
« on: February 14, 2018, 04:23:22 PM »
I don't understand what you mean, could you elaborate? Have you tested this and found an issue? If so could you illustrate or more clearly explain.

5
Playmaker Bug Reporting / Possible "get closest" bug
« on: February 14, 2018, 06:47:43 AM »
I've found that in my scenario using "array get closest game object" finds the wrong (the furthest) result between the 2 objects I have on the array, though if I replace it with an array maker array list and swap the action for "array list get closest game object" in the the same scenario it finds the correct (the closest) game object.

Using Unity 2017.3.0f3 and the latest stable release of Playmaker.

More details can be provided if this cannot be replicated.

6
Playmaker Help / Re: Creating a Room-Brush system with Playmaker?
« on: February 14, 2018, 06:36:38 AM »
It shouldn't matter as long as all five (1xFoundation 4xEdge) are children of the Snap Marker. This is just so the Foundation and Edges inherit the position of the Snap Marker.

All you'll need to do to limit the building area to your 300x300 grid would be to prevent the Snap Marker from operating outside of the XZ coordinates of your building area.

7
Playmaker Help / Re: Creating a Room-Brush system with Playmaker?
« on: February 14, 2018, 06:05:51 AM »
Cheers for the video, from what I can see there I totally misjudged the scale of the building area. The idea proposed in reply #14 of this thread is far more efficient.

So I'd go with no pre-placed Foundation Markers or Edge Markers. Just the Snap Marker that moves with the cursor, as a child of the Snap Marker have one Foundation Marker and it's four Edge Markers. Each with an appropriately placed collider set as trigger. An FSM on the Foundation Marker and each of the Edge Markers, you want the "trigger event" action to check if an object already exists in its space.

8
Playmaker Help / Re: Creating a Room-Brush system with Playmaker?
« on: February 14, 2018, 05:09:59 AM »
Actually, just had a ponder, your child idea might work far better. Try making it so the snap marker has a trigger in place of the floor and one for each edge. Then just check for building objects already in their places. This way you can avoid having the surplus of game objects. If you want to extend this to extra floors you'll have to add in checks for lower levels and another set of triggers for each extra floor. Though I'd keep it as simple as possible.

9
Playmaker Help / Re: Creating a Room-Brush system with Playmaker?
« on: February 14, 2018, 04:56:28 AM »
Sorry could you clarify the size of the area you're going to build on? 300x300 is larger than I thought. I'd be hesitant of making enough colliders to cover that, there are more efficient ways to find the adjacent markers, the ways I am aware of will just take longer to set up.

Could explain what the green area is and whether it is 300x300 meters?

Could you explain also what a tile of 10x10 does/is?

Is the building mode only active for short isolated periods?

In my solution I was expecting each object to be it's own game object or at most siblings, not children, you'd have neighboring Edge Markers overlapping in that case.

10
Playmaker Help / Re: Creating a Room-Brush system with Playmaker?
« on: February 13, 2018, 10:07:10 AM »
You can work with scripts to some extent, check out the "ScriptControl" category in your action list.

Back to doing it all in Playmaker though, as you've got a very specific building location with a finite grid area I'd consider getting creative with how you lay down sections.

I've attached an image to try to illustrate how I'd begin approaching this.

I'd begin by creating an empty game object (Foundation Marker) at the center of each grid square and another empty game object (Edge Marker) on each edge within the grid. I'd then create two FSM templates in Playmaker, one called "Foundation Data" (add an FSM with this template to each Foundation Marker) and another "Edge Data" (add an FSM with this template to each Edge Marker), inside these FSMs I'd create variables like a bool called "inUse", and maybe a string (objectType) for things like "wall" or "door" and various others as required to contain information on the building that has or hasn't been done there. I'd create a layer called something like "Edges", I'd then add all of the Edge Markers to this layer. I'd then add a collider to each "Edge" game object so that the raycasts in the next part have something to hit. I'd also create a global array (called foundationMarkerList) with all of the Foundation Markers added to it.

In the image you can see the cursor is hovering over a grid square, the "Snap Position" has been moved to the center of that square. From the snap object you can get all of the information you may need using two techniques, firstly I'd use the action "array get closest game object" and check the "foundationMarkerList" array, the result should be the Foundation Marker under the snap position, I'd then raycast out 4 directions (-x,+x,-z and +z) to find the adjacent Edge Markers (limit the raycasts to the Edge Markers layer using the layer mask on the action).

You now have the game object for your current foundation piece and it's adjacent potential wall parts, you can now access the variables you set up in the two templates made earlier by using actions like "get FSM variables". With the data you query you can enable/disable GUI elements etc to let the player know what options they have in that particular grid position. I'd be tempted to make it so they have to click on the square to lock the Snap Position in place and bring up a menu with options from there. When they choose something make sure to set the relevant variables ("inUse" = true, "objectType" = stoneFloor etc) on the marker object it's related to and the whole system should come together nicely.

Final note: make sure to disable collisions between the "Edge Markers" layer and things that shouldn't collide with it (player controller, enemies etc).

I hope this suggestion holds some use for you!

11
Playmaker Help / Re: Creating a Room-Brush system with Playmaker?
« on: February 11, 2018, 03:01:23 PM »
So what you need to do it set the position of a series of game objects along the sides of the rectangle, with the appropriate rotation too.

You'll need to use the two vectors you've rounded to work out how long each side of the rectangle is. I'd probably find out the difference between the two X positions and the difference between the two Z positions (use whatever you find easiest from the "math" category of actions). You should now know the dimensions of the rectangle. With the dimensions you can create an array for the X length and another for the Z length, each array would store the positions where the meshes would need to be placed on that edge of the rectangle. Once you've got an array of all the points on a side you can loop through those using the "array get next" action and apply the position to the next piece using "set position".

At this point if you haven't used arrays yet you will need to. I'd recommend going through some tutorials on that. The most suitable way you populate the arrays according to the dimensions of the rectangle are beyond my guessing at this point.

Once you've managed to use these hints to create a working system of your own you should look into pooling. I'd recommend PoolManager as there are Playmaker actions for it.

https://assetstore.unity.com/packages/3d/characters/poolmanager-1010

I use it to pull meshes I require from a group of pre-existing meshes waiting to be used, in your case that would be your wall pieces among other things. It avoids creating and destroying game objects at runtime.

Good luck with all that, it will take some doing to get the array stuff going if you're new to the concept but it'll pay for itself many times over in the future.

12
Playmaker Help / Re: Creating a Room-Brush system with Playmaker?
« on: February 11, 2018, 01:28:51 PM »
No bother, I think I understand you pretty well.

I've never seen a tutorial on this personally but I have built similar dungeon-like pieces.

Once again there are many ways to accomplish the different components involved. You're going to have a lot of trial and error attempting to create this.

The most straight forward way I can think of would be to create modular building blocks that your code can pick from when building the rooms. So you could make a corner piece, a wall piece and a door piece (each of these should be 1 meter wide for simplicity), make sure that they all slot together seamlessly in your modelling program of choice (set their pivot points in a position that is universally shared across each piece). Once in Unity use these in your room setup script (doors you would likely make the player place manually after a room is generated).

If the modular pieces don't suit you then yes you can just scale wall pieces and either scale the UVs of each mesh as well or use a tri-planar shader. I'd use a mixture if it were me, I'd have modular wall pieces and a scaled floor plane.

If you have fairly constrained room building dimensions, lets say a room can be a minimum of 2m x 2m and a maximum of 6m x 6m then you could even build prefabs of all possible room sizes in advance. Though as you want to paint them I think working on a modular wall system would be best.

Sorry if this is a jumble of information. Let me know if you'd like me to attempt to elaborate on a particular part.

13
Playmaker Help / Re: Creating a Room-Brush system with Playmaker?
« on: February 11, 2018, 11:39:11 AM »
I hope it goes well!  :)

14
Playmaker Help / Re: Creating a Room-Brush system with Playmaker?
« on: February 11, 2018, 10:15:09 AM »
The cut away effect in the video you provided could be done many ways too depending on the complexity of your use.

You could have a mesh object that represents one grid square of stone and simply disable it when something is built in its place, though this could impact your performance if the landscape is large, I wouldn't recommend that method unless you're working small scale.

There is a method of masking that would probably be more efficient. It involves render queues and depth masks. It is explained very well in this video https://www.youtube.com/watch?v=cHhxs12ZfSQ in the description there is a link to download his project, you could use that to get his shaders if you wish. So if you imagine you could use the shader he uses in his green material for the stone and the shader used in his grey material for your rooms, then have a plane placed just above ground level with his depth mask shader. If you watch the video you'll understand how he does it.

15
Playmaker Help / Re: Creating a Room-Brush system with Playmaker?
« on: February 11, 2018, 09:17:32 AM »
This question is extremely broad. Though I can suggest something that may start you off in a viable direction.

I'd start by using "get mouse button down" in one state, then in the next state I'd grab the position of the cursor (one of the "mouse pick" actions could do it) and round each vector to a whole number (you may want to use one of the vector XYZ actions that allow you to break up a vector into a series of floats, then use "float round to nearest" on each value). I'd then use "get mouse button up" and once again in the following state grab the position of the cursor and round each vector again.

You've then got 2 opposing corners of a rectangle to lay out your rooms. From there you'll need to work out how you'll place your rooms within that rectangle.

As I said though there are many ways to accomplish this effect, this is one way that is fairly straight forward in Playmaker.

Pages: [1] 2 3 ... 5