A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by LaireonGames, Feb 15, 2017.
@LaireonGames - The discord invite link on the asset store has expired. May want to fix that
I have a feeling I have already replied to your email so figure I will repeat myself publicly
I took down the Discord since I got sick of unreasonable requests turning into 1 star reviews, thought I had updated the store page to show this but seems not so gonna do that now
Can you tell on which script i will put the break point in monobehaviour so that i can understand the work flow of generating the world as well as blocks interactions?
The world itself is in two places: TerrainGenerator and BiomeMap. This will populate the worlds shape but has nothing to do with mesh creation (guessing that is currently your interest). Terrain generator should be pretty self explanitory, from the comments, but the biome map is a bit trickier, its better to get used to the editor first with that one before diving into the code
Block interaction is all through block events. They are called and driven mainly from CameraEventsSender which raycasts into your world and applys the correct events depending on the block hit
On empty scene from where i should start if i want to add two functionalities. One is generating world and other is blocks interaction.
Don't start from an empty scene There are too many settings and scripts interacting with each other to easily explain how to start from scratch, this sort of methodology is what keeps the engine running quickly rather than having to constantly check if certain components are around or not.
Can you elaborate it properly?
Im trying to do the following:
1>Introduce a custom FBX mesh into the scene so that when when I add it in, it works like any other cube mesh
i.e when I click my custom FBX mesh adds onto the terrain.So im trying to create an animated switch for example.
2>When I create a new class in Custom Block Events called Switch , and Im trying to put my custom FBX in that.
3>Im trying to add that custom block into Terrain Generator however it throws a null exception
4>Which script should I modify ,so I can introduce a custom FBX?
Bottom line, no. This is not how complete projects work, its not designed to be easily broken apart since doing so will require a LOT of extra engineering and at the expense of speed and stability.
If you want to break apart any complete project you just gotta dig through the code.
Take Facebook messenger as an example. Imagine asking them to just give you the chat code so you can host it on Amazon. It doesn't work like that... They will have hooks everywhere for things like profile and analytics that are specific to them. So to take chat you need to take profile which is probably the majority of their code but profile probably doesn't work without timeline since your profile has timeline built in and you unravel this HUGE thread.
1) that can be done in the block editor, there is a section for custom meshes. However for animating you probably want a prefab which is what the existing chest objects do, they spawn an empty block in the world, then a Unity prefab on top which passes events into the system
2) Events are linked to blocks, not a specific mesh/prefab. Take a look at the custom events video on my vimeo. So you make an event, register it in CameraEventsSender and then in the block editor you select that event so it can apply to multiple blocks. This way, there is no garbage and 1 event can effect any number of blocks.
3 and 4) no need to edit any scripts for a custom mesh Just drag it into the custom mesh section of the block editor
Atleast you can tell on which script i put breakpoint in monobehaviour, so that i can check the flow in your demo scene?
I told you this before :/ The files are heavily commented to explain what each method does. E.G I think TerrainGenerators first method is called GenerateTerrain and thus generates terrain As I said, BiomeMap is trickier and I would recommend getting familiar with its editor before going through its code. There are 2 videos on how to do that on my vimeo
1>I am trying to add a custom mesh , for instance an animated lever that will spawn like
other blocks in the world like Stone etc.
2>Can you tell me how to add it?Ive tried Wooden Chest , but its a Game Object.
3>Ive tried searching Structure Editor for Wooden Chest and Block Editor but have found no reference to the Wooden Chest
4>Im trying to add Wooden Chest into the game scene so I can see how its animation setup is and will try to duplicate its behaviour to add my own custom mesh with animation
5>After adding custom mesh ,can I add/remove that inside world just like normal blocks and also interact with chest?
6>How can I get rid of water because right now in demo scene ,water is everywhere and I get infinite null reference errors when I run the base package?Im using Unity 2017.
Enclosing the console debug here:
ck(Int32, BlockType, Int32, Int32, Int32, Boolean) (at Assets/Laireon Games/Laircraft/Scripts/Meshes/ChunkMeshCreator.cs:284)
Laircraft.ChunkMeshCreator:CalculateMesh() (at Assets/Laireon Games/Laircraft/Scripts/Meshes/ChunkMeshCreator.cs:161)
Laircraft.ChunkMeshManager:CalculateMesh() (at Assets/Laireon Games/Laircraft/Scripts/Meshes/ChunkMeshManager.cs:115)
Laircraft.Chunk:CalculateMesh(Boolean&) (at Assets/Laireon Games/Laircraft/Scripts/Chunk.cs:938)
Laircraft.ChunkManager:CalculateMesh(Chunk, Int32, Boolean&) (at Assets/Laireon Games/Laircraft/Scripts/ChunkManager.cs:1250)
Laircraft.ChunkManager:RunThreadedTasks(Int32, CachedList`1, ThreadTask, ThreadTaskCheck) (at Assets/Laireon Games/Laircraft/Scripts/ChunkManager.cs:781)
Laircraft.<StartThreadWork>c__AnonStorey1:<>m__0() (at Assets/Laireon Games/Laircraft/Scripts/ChunkManager.cs:721)
Dude, slow down and watch some of the videos!
For the block editor, its not the code its the editor window. So press Ctrl+E (whilst the game is not running) or use the top menu Laircraft/Editors. Then go to the blocks tab and search for Oak Chest. It will show you a setup where an empty block is spawned along side the chest prefab.
If your making a new block what you need is:
Ensure empty mesh is checked (this means the usual cube doesn't spawn)
Ensure the collider is set to cube (if your prefab is cube shaped, if not set it to mesh and drag in a mesh for its collisions)
Drag your prefab into the spawn on create section
At this point you can spawn your prefab into the world and interact with it as a normal block, but it wont animate. To check your block works go to the inventory tab at the top (So Ctrl + E again, then inventory) and within that go to starting inventory. Then change one of the starting block types to your new block (or to Oak Chest to test that). Make sure the first setting is block, not item, since you can have items that are not blocks, e.g a pickaxe.
To get it animating, you need a custom block event which means making a new script. Everything up until now has been in the editor and has involved 0 code. For your event I suggest checking out Chest.cs and copying what you need which is the OnMouseDown method, I use TriggerTransition (my custom animations class) to animate opening of the chest.
Once you have the class made, you need to register it in the CameraEventsSender. If you stuck here, watch the video on custom events/blocks, it explains all this in detail.
Water issues sound like you have changed something in the engine, I would suggest starting from a fresh copy of the engine from the store and seeing if it still happens there.
Is it possible to loop through opening and closing oak chest again and again (opening and closing animation goes into infinite loop) OR it will work only by player interaction?
That is entirely up to your code/object/prefab, there is nothing in the engine that wouldn't allow that.
E.g if your prefab animates itself to open and close again in a loop, then it will do the same thing when its spawned into the world using this system
but there are transitional object scripts and i saw looping drop down and looping variables there. I thought that will help to solve my problem but nothing happened. What exactly does those variables used for?
If you hold your cursor over the variables your confused about in the transitional object (whilst Unity is Not playing) then it will give you more information about what it does.
These can certainly be used to loop something opening and closing constantly as you described if you turn TriggerInstantly: on, Stay Forever: off, Looping: on
Ok thanks man. Really appreciate your work and giving time to reply.
Just got the kit and it looks really awesome, good job! Quick question, how do I change the HUD position? I changed it manually and set the anchor but it stays in the same position. I also changed it via the set to position script in the inspector but it still doesn't want to move?
Glad your liking it
The position is controlled by the animations, so even if you it the animation is restoring it to the original as it runs. Take a look at it TransitionalObject component (on the HUD) then within that expand, Position, then Data and change its end position (or move it to the end position you want and hit Update in the end position ssection)
Wow, that was a quick response. Just did what you said and it worked perfectly! I have just published a review for this superb kit.
Sweet really appreciate it!
I have the following questions really need your support!
1. In fly mode, the player goes in between the blocks can you check on this.
2. Once game start how I can add more blocks what is the parameters controlling this. as the default start maximum 3 or 4 blocks.
1: This is currently intentional Fly mode is intended to make development easier rather than being a fly mode for players. If your wanting that it should be pretty easy to disable gravity in the player controller and rigidbody.
2: Not really sure what your asking here sorry! If you mean starting inventory so you have more blocks hit Ctrl+E then go to the invetory tab, then starting inventory so you can add more starting blocks
hope that helps!
Thanks really helped me and I found it.
Last point from where you controlling the player movement as trying to use CrossPlatformInputManager and I modified InputController but no impact. As I am changing the game to Andriod Versio
Ah sorry I was not very specific. What you are looking for is FPSInputController, which sends input to the motor, and CharacterMotor which handles the movement itself. These are just modified versions of the Unity standard assets: https://assetstore.unity.com/packages/essentials/asset-packs/standard-assets-32351
I've not followed this tutorial but from a quick google something like this should apply to those scripts and listen to android input: https://unity3d.com/learn/tutorials/projects/2d-roguelike-tutorial/adding-mobile-controls
Your aim is to have an on screen UI (I imagine) and feed input from it to the motor, just as the FPSInputController does. If you want to take it in simpler steps, then try adding 4 UI buttons to start with, rather than an actual on screen joystick, and get them to feed into the motor. Should make it easier to figure out the joystick stuff from there
All are ok I am able to control the player and UI from Mobile now.
only the problem for changing the mouse click 0,1,2 to mobile touch I did search and found you are using block events for mouse click but I am facing a challenge to convert to touch input.
let me know if I am correct or no please, also need your help in converting mouse click to mobile touch input if you can.
awesome glad you you got it
Yup your in the right place, BlockEvents is indeed where I listen for mouse clicks although I'm not really sure how I can help from there since it depends on your game! E.G there is of course no right click on a mobile so you will need to decide what you want to replace that.
If you just mean touches instead of clicks overal then this might help: https://docs.unity3d.com/ScriptReference/Input.GetTouch.html
All working fine complete touch platform and customized for Andriod.
Only small suggestion if the player can walk from block to another no need to jump.
also building block once I am on top of the block is not allowed can you advise how to enable it.
Thanks for your support and really amazing asset saved a lot a lot of work.
Glad your up and running!
Oh yeah hm... I will have to take a look at the code tonight to see where I disable building at your feet. I think its in block events somewhere but not got the code in front of me to check (in my 9-5 job)
Ah ok this is the line:
if(Vector3.SqrMagnitude(adjacentPosition - Player.Instance.transform.position) > 0.5f || //if not trying to place where the player is standing
So this is giving a sensible distance before placing a block which is pretty important! So if you jump, you should be able to place below you. I would advice against removing this check since once you place a block below where you are standing, you drastically increase the chance of instead shooting miles up into the air!
If you really want to do this, I would suggest having a specific check (can probably be done by using an else to the if statement above) when trying to place a block very close to the player and the moving the player away from the block to make sure Unity physics don't kick in and launch the player into the sky
For the network part? any plan or is it implemented as so many codes related to the network.
I am afraid not. Originally I was considering multiplayer very hesitantly since I still want to actively avoid asset flippers (people who just buy packs like this, invest minimal work and upload to steam etc. Close to a scam as it gets!) and gives people willing to look after their project a clear advantage.
However currently its looking much less likely that it wont happen. Last week I started negotiating with 2 publishers to publish a game I am making using this engine, if it goes ahead I don't think I will have any spare time to add new features since my version has been tailored from this engine specifically towards the project I have in mind.
I will still provide support by answering questions, but probably wont add new features if I get a good deal from one of them. Come to think I'll make sure the store page is updated as well to reflect this
no demo scene for noob?
sorry I was boiled. Here are my questions.
I could press Main Scene(other were empty and stopping) then I could play in flooded map. but I could not find the path to reach what I want to see.
How can I modify map like diorama by mouse.
Do I have any other press-able scene like quick spawn start on visible map data without through main menu.
sorry for my bad english
You probably got unlucky with your see to start over an ocean. If you head to your ChunkManager in the scene and look for the GameData component, it will have a variable World Seed. When its set to 0 it will randomly select a new seed each time you hit play. Once you find one you like, copy it and then when the scene is Not running paste that seed to replace 0 and you will always start in the world. I find this helps a lot for development.
You can also press R to enter flying mode and quickly look over the terrain.
Its a little more complex, but the biome editor gives you a preview as you mention, there is a video on the store page talking about the biome editor at length and showing how to use its preview functionality
thank you for reply, I understand a little bit about auto generating system.
I am satisfied with your maps, also what I wanted to create were flooded ocean and tunnel map.
but my question was like what do I have to do if I want to put 3D realistic submarine to this game.
I want this to my working scene tab,
I copied all gaming hierarchy, but It was not working.
I am sorry I am idiot.
if you mentioned me save in 0, fly, take photo, remember XY then place new on terrain. Ill try that too.
If you have simple solution, please teach me.
I did it in this way.
I cannot pick up blocks, after I played few hour.
I need to delete saves and rebuild to fix it.
my block stack was 999. Inventory row were 20,
I did not touch anything, it was happen during built game demo.
sorry for that I did not read what they wrote on previous thread.
Sorry but is there any written documentation or tutorial?
Got loads of tutorial videos here: https://vimeo.com/user15077144
And documentation should be in here: https://drive.google.com/drive/u/0/folders/0B0-9u0TALF10OFY5TEtiOC1Nek0
I did used to have a link to documentation on the store page, not sure where/why its gone :/