Jump to content

[Help] how to start make map or world ?


witawat
 Share

Recommended Posts

If you can find the 'Leadwerks User Guide' by Aggror then I would highly recommend that but I currently have no idea where it is. The link in the Leadwerks Wiki is broken!

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

thank you all, now i can make start map

 

and step 2 how to add map and coding in pascal. ?

but i see in start kit i not know any more.

why use lua, and why load file from shaders.pak ?

 

ps. why program editor hang any time, i not idea ?

 

Windows 7 64 bit

 

i use notebook

 

cpu i7, Ram 8GB

 

Leadwerks Engine 2.5

Initializing Renderer...

OpenGL Version: 4.1.10834 Compatibility Profile Context

GLSL Version: 4.10

Render device: AMD Radeon HD 6470M

Vendor: ATI Technologies Inc.

post-5357-0-93591000-1334214381_thumb.jpg

Link to comment
Share on other sites

witawat,

If You are asking about programming, do it rather at "Programming" section, please.

Now to look "LE2 Starter Kit for Delphi and FreePascal", but not document about load my map or any for beginer

i think about document is small ..

Starter Kit contains ready to compile and run examples (commented Pascal source code) generally only for beginners (beginners on LE, not in programming...). Most examples are based on official tutorials, so, for full understanding, you should start from these documents and videos: http://www.leadwerks...e2/_/tutorials/

Official tutorials are written with C++, so for fast startup with Pascal, use corresponding code from "LE2 Starter Kit for Delphi and FreePascal". For example: if you analyze "Making a spectator" tutorial, use "MakingASpectator.pas" as Pascal syntax reference for this tutorial.

 

And now, step-by-step instruction how to make simple program in Lazarus for loading scene file created in Editor.

 

1. Create new folder and copy header files here (LEUtils.pas, LECore.pas, LEObjects.pas).

2. Open Lazarus IDE.

3. Make new project (File->New->Console application), then [Cancel] on creator window.

4. Replace code in source editor window (copy-paste from here):

 

program project1;
{$MODE DELPHI}
uses LEUtils, LECore, LEObjects;
var // Entities
lua : Pointer;
fw : TFramework;
camera : TCamera;
// Camera moving and rotation variables
camrotation : TVec3;
mx, my : Single;
move, strafe : Single;
begin
 // Initialization
 RegisterAbstractPath ('');
 Graphics(800,600);
 HideMouse;
 MoveMouse (GraphicsWidth div 2, GraphicsHeight div 2);
 // Setup framework
 fw := CreateFramework;
 lua := GetLuaState;
 lua_pushobject(lua,fw);
 lua_setglobal(lua,'fw');
 lua_pop(lua,1);
 fw.SetHDR(1);
 fw.SetBloom(1);
 // Create player camera
 camera := fw.Main.Camera;
 camera.SetPosition(-4,2,0);
 // Load a scene created in editor
 LoadScene('abstract::tunnels.sbx');
 // Startup camera transformation values
 with camrotation do begin X:=0; Y:=0; Z:=0; end;
 mx:=0; my:=0; move:=0; strafe:=0;
 // Main loop
 while (not AppTerminate) and (KeyHit(KEY_ESCAPE)=0) do begin
  // Camera mouse look
  mx:=Curve(MouseX-GraphicsWidth/2,mx,6);
  my:=Curve(MouseY-GraphicsHeight/2,my,6);
  MoveMouse (GraphicsWidth div 2, GraphicsHeight div 2);
  camrotation.x := camrotation.x+my/10;
  camrotation.y := camrotation.y-mx/10;
  camera.SetRotation(camrotation);
  // Camera movement WASD
  move := Curve(KeyDown(KEY_W)-KeyDown(KEY_S),move,20);
  strafe := Curve(KeyDown(KEY_D)-KeyDown(KEY_A),strafe,20);
  camera.Move(Vec3(strafe/10,0,move/10));
  // Render by framework
  fw.Update;
  fw.Render;
  Flip;
 end;
end.

 

 

By the way, no offense, but if you don't understand what these commands do, try start from analyzing tutorials and documentation.

 

5. Save project in folder created on step 1.

6. Build project (Run->Build or Ctrl+F9). In messages window you should see "Project "project1" successfully built"

7. Copy "project1.exe" file from project folder to your Leadwerks Engine root folder (where Editor.exe and engine.dll exists).

8. Run project1.exe from engine root folder.

 

Now you should see tunnels scene (and you can fly around: mouse + WASD). You could try loading your own scene (instead "tunnels.sbx"). In next step you can extending this project by programming some gameplay.

 

post-42-0-14319200-1334253525_thumb.png

 

I hope this helps.

  • Upvote 1
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...