Jump to content

Help setting up


Calimaw
 Share

Recommended Posts

I'm really not sure where to begin, so I may not even ask the right questions; please assume I know nothing, as that's probably the case.

 

I'm wanting to start with getting an environment loaded from a sandbox map, including water and environment lights, textures ect, but I'm completely new to setting anything up to work with C#, the project configuration utility doesn't seem to have any templates for C#, which is confusing to me because I thought it was officially supported.

 

If some one could take the time to help me set things up by provide an 'idiot tutorial' I would greatly appreciate it. In return if there are projects you may be working on that require sound effects and or music I am also available to provide my services; as I that is my forte.

 

I'm attempting to pull together some very basic code to run an environment and populate it with my audio work.

Link to comment
Share on other sites

check out the tutorials on the wiki such as the character controller tutorial. They are written in c so you should have no problems converting to csharp.

Start with a simple level at first the learn from it.

Only a minority of people are using csharp and the header files are third party designed.But you will find example code on this forum.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

The following are the simple steps to begin a new C# project for LE (I'm building a project template to add to the solution wizard or even on ProjectWizard if he likes):

 

1. Open the IDE (Visual C# Express or Visual Studio)

2. Create a new Console or Windows Forms project

3. Add reference to the Leadwerks.dll wrapper (download the latest from here)

4. In the main procedure (or where you want to start the game) write the following code (haven't tried but it is similar to what I'm using):

 

// Graphics initialization
Graphics.Initialize(800, 600);

// Framework initialization (the parameter enables/disables LUA)
Framework.Initialize(true);
if (Framework.Layers.Main.World.Pointer == World.NullPointer)
return;

// Details process
Texture.TFilterMode = 1;
Texture.AFilterMode = 4;

// Collisions initalization (to change as you need)
Collisions.Set(1, 1, true);

Scene yourScene = Scene.Load("abstract::YOURMAP.sbx");
yourScene.CollisionType = 1;

while (!Leadwerks.Window.HasRequestedClose())
{
Framework.Update();
Framework.Render();

Graphics.Flip(0);
}

Engine.Terminate();

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

Cool, you can message me on aim as CalimawMAP or Yahoo! as Wamilac if you don't get a hold of me on the forum.

 

Is there a list of all the commands any where? I'm trying to figure out how to get the position of entities in the sandbox, I.E. the water plane.

Link to comment
Share on other sites

Unfortunately the wrapper is not documented, but it is enough OOP to let you discover everything (I usually search the functions I need in the wiki for C++, then open the wrapper source and search inside for Core.TheSearchedFunctionName method to see what is the relative method call).

 

For positions and rotation every Entity has the properties Position and Rotation, which are Vector3.

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

Try to use GetChild on your Scene object, you can pass it the property "name" that you assign to the object in the Editor (not sure if it is, maybe you should cycle through the Children array of the Scene to find what you want).

 

Scene yourScene = Scene.Load("abstract::YOURMAP.sbx");
Vector3 waterPosition = yourScene.GetChild("YOUR_WATERPLAN_NAME").Position;

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

How do I set the fluid plane? I have a mesh parented to a body and its floating mid air, I assume thats because the fluid plane is assumed to be at that position, but Im having trouble figuring out how to format the values correctly for Core.SetFluidPlane.

Link to comment
Share on other sites

Have you setup the Mass (at least 1) and CollisionType (remember to initialize the collisions with Collisions.Set) of your body? Instead of using directly Core.SetFluidPlane you can use the OOP way of the wrapper with Fluid.SetPlane

 

There is an example for C in the wiki, try that code (you have to convert from C to C# but it should be an easy task).

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

Im using Framework.Effects.Water.Enabled and have set its position in the scene (havent built a loader to do it for me yet), problem is, I create a mesh, which I parent to a body, and this body would 'float', or what looked to be floating (bobbing up and down a bit) at a different location than the visual location of the water, so I assumed that was the fluid plane, which Im unable to quite figure out how to set its position correctly. My water plane is at 0, 28, 0.

 

In addition to this, when I set the physics body (the one with the mesh attached to it) to myBody.CollisionType = 1; while myScene.CollisionType = 1; and Collisions.Set(1, 1, true); with a mass of any amount the body will drop down with gravity for a brief moment, then shoot off in an unlikely directly very quickly and vanish from sight.

Link to comment
Share on other sites

Right now Im just playing with values and determining their ranges and setting stuff manually so I can better build a separate class to automatically create the scene for me, at which point I want to create a few entities for the sandbox editor so I can then add those to that class as well. I've not used C# in a long long time, nor did I use it very much when I did, so I'm learning syntax as well. I understand the logic at least :)

Link to comment
Share on other sites

Whats up with the editor not being able to render my sky? I select it like the default 'FullskiesBlueClear...' and it does a "hall of mirrors" no-draw effect.

 

The *.mat file contains the following (it works correctly in the engine)

 

texture0="abstract::sky.dds"
clamp0=1, 1, 1
blend=0
depthmask=0
depthtest=1
depthmask=0
alphatest=0
overlay=0
zsort=0
castshadows=1
shader="abstract::skybox.vert","abstract::skybox.frag"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...