Jump to content
JohnMFSteel

How do you create game logics via text-script?

Recommended Posts

I am looking for examples or help with some script.

Specifically, I am wanting to learn how to properly spawn other game logics with defined properties.
Maybe with their own predefined scripts or maybe linking to the origin script from one origin game logic.
The goal being to make a dynamic system that evolves as the player progresses and maybe removes logics that are currently out of use while logging a coordinate reminder incase the player's coordinates come back in proximity then the necessary logics can be respawned.

Some additional info:
I am seeing that the various logics have a spawn method that uses YLogicTemplate, and I am seeing that YLogicTemplate has a constructor, but I'm not understanding how to properly use the constructor.

I think I understand that I use the name of the class as the name of the YLogicTemplate, but the proper syntax for defining the properties of the template is unclear.

Getting the material Ids with .material is proving confusing, when I try to get the material Id from an existing terrain volume logic its returning none.

Which I assume isn't true so I'm thinking I must need to convert the YVoxel to the Id, but the how of this is something I'm also unclear on.

Also I must admit I have my fingers crossed here that the lack of a YWaterVolume class is simply due to the water volume logic being specialized usage of YTerrainVolume

Additional explanation of what I am wanting to do:
I am wanting to create a game I can play on mobile and PC. I want to dynamically spawn or move around terrain volume logics based on rules to shape my world layer by layer.

Then I want to store its details in an array for a moment to populate the region with entities and logics.

I'm thinking that aspect should be from dynamic templates created based on rules so I can try to create an evolving story by capturing some details about what has been spawned as a code and creating a sort of flow chart for what to do next in the presence of existing codes.

I plan to mostly stick with base game themes and features as I quite enjoy the game, but I want to tell my own story with factions and maybe some companions. I also want to arrange resources throughout the world in a way that feels a bit more natural to me.

I'm also hoping that if I can gain understanding of how to dynamically spawn logics as needed I can create a sort of global map and track the players position to determine when to move them to a new region or creating a sort of transit system between settled regions.

Update: I figured out how to do what I want to do and I now understand I don't need any logic templates or anything like that I just need the global game storage. Now working on a background simulation to inform the world generation. That's going to take awhile so I've also been putting together a universal game, I'm nearing the memory limit so it might take some tweaking to get just right but I hope it turns out enjoyable.

 

collaborative note: All collaborators are welcome on my projects. However, I have no plans for microtransactions ever, and I plan to share anything I learn with the community openly. 

Edited by JohnMFSteel
resolution of query.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×