Re: Where is the C# documentation?

#4
Thanks for the reply, and the links :),, those are very much appreciated. I had a look at them earlier, but didn't find what I was looking for.

However there is something very interesting if you follow this link that you provided: http://docs.cryengine.com/display/CEPRO ... Reference#

On the page i states: The Scripting Documentation offers code samples and explaination for the use of various CE# Framework classes and CRYENGINE features. But If I click the link, nothing happens. How do I find the documentation with code samples and explaination?

Re: Where is the C# documentation?

#5
Hi Inscope, thanks for telling us about the dead-link. Since it wasn't linking to anything I've removed it so there won't be any more confusion about it. We are still working on adding more tutorials and samples about using C#, so expect more documentation in the future.
Can you tell me more about what you are trying to find in the documentation? I might be able to answer your questions or it might help me with improving the documentation.

Re: Where is the C# documentation?

#6
Thanks for your answer. :)

It's just general Code examples. For example I want to use Class or Method XYZ, then it would be nice if I could go to the documentation and search XYZ and get a simple code example where the function or class is used.

Another example, I have an entity class in my game. I would like to do some collision checking on it. I can search through the documentation and find that the Raycast class has a collider on it. But what do I need to do with it, do I need to add a new component, does all entities have colliders on them by default, do I need to override a specific method to get info about collisions, do I even need to use the raycast class? I can read about the members in your doxygen, but I don't even know where to begin to do some collision checking from my code.

For example if I compare with Unity documentation, I search for Collider in their documentation. There is a whole list of members variables, functions etc. There is something called OnTriggerEnter, I click it and there is a code example and an explanation. That's kinda what I'm missing.

EDIT: Maybe you can answer this. I created a simple entity, just to try it out. It has a function called Move:

Code: Select all

public void Move() { Entity.Transform.AddTranslation(new Vector3(1, 1, 1)); }
Inside SampleApp.cs I'm trying to execute the function like so inside OnKey. The entity is instantiated inside SampleApp's constructor.

Code: Select all

if (e.KeyPressed(EKeyId.eKI_P)) { myEntity.Move(); }
When I press the P key, sandbox just shutsdown instantly without any errors or anything, it's just shuts down in a split second. What am I doing wrong here?

EDIT v2:

Im trying to follow this guide in your documentation: http://docs.cryengine.com/pages/viewpag ... d=25531348 Right away it states that I need to inherit from BaseEntity, the class doesn't exist in 5.3. What alternative class do I need to inherit from? It states that it should be inside Cryengine.Common namespace, I included it, but I still can't find the class.
Last edited by inscope on Thu Mar 02, 2017 9:46 am, edited 3 times in total.

Re: Where is the C# documentation?

#9
I think what you're looking for is the SpawnEntityWithComponent method. So first you will have to create a new EntityComponent with the behaviour you want to have, and then spawn it at the location where you want it.
Example:

Code: Select all

//By using the EntityClass attribute it will also show in the Sandbox in the Create Object menu. [EntityClass("Player", "Game", null, "User.bmp")] public class Player : EntityComponent { public override void OnPrePhysicsUpdate(float frameTime) { base.OnPrePhysicsUpdate(frameTime); if(Input.KeyDown(Common.EKeyId.eKI_W)) { Entity.Position += Vector3.Forward * frameTime; } } } //In SampleApp.cs private SampleApp() { Entity.SpawnWithComponent<Player>(Vector3.Zero, Quaternion.Identity); }
We've just released 5.3.3 with the new Rolling Ball template for C# which is a basic example on how to use the EntityComponent. More information about that can be found here: http://docs.cryengine.com/display/CEPRO ... l+Template

Who is online

Users browsing this forum: No registered users and 2 guests

cron