Jump to content

Leadwerks 3 "How do I ____?" Questions and Answers


Chris Vossen
 Share

Recommended Posts

But this is used in the demo game included? It is attached to the camera? And has barberian as its target in the editor? But how was that set is what I'm trying to find out? I'm sure josh could tell us?

 

Andy

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Link to comment
Share on other sites

Guest Red Ocktober

and i'm still tinkering with the lightmapping thing...

 

pray for me happy.png

 

btw... nice looking terrain and sky you've got going there...

 

--Mike

Link to comment
Share on other sites

self.entity:GoToPoint(20,0,-15,2.5,1);

 

xpos=self.entity:GetPosition().x

zpos=self.entity:GetPosition().z

xpos=self.entity:GetPosition().x

 

rotx=self.entity:GetRotation().x

roty=self.entity:GetRotation().y

rotz=self.entity:GetRotation().z

 

camera:SetPosition(xpos ,3,zpos )

 

camera:SetRotation(rotx,roty,rotz)

 

self.light:SetPosition(xpos,2,zpos )

 

*****************

 

but it don't work, caus the camera should be positionnned behind the model in some normal distance from the axe.

So it will need some normal calculation i think.

Stop toying and make games

Link to comment
Share on other sites

Nope , in the demo game the barbarian have only

AnimationManager and Player scripts attached.

It's a simple travelling camera.

 

 

 

The Camera in the demo has the 3rdperson script attached. I could not find where it was set either. Are you ment to set in Editor but bugged?

 

I set a Camera with basic controls in the App Script at the moment, I didn't need a 3rd person camera.

Elite Cobra Squad

Link to comment
Share on other sites

Ok i just find in the editor you can create BSP stuff , but also lights, and also Camera (Miscellaneous list)

I attached "3rdPersonFollow" to that camera i created on the editor and placed behind the golbin.

I put on target field of the camera the Goblin model (from the "scene" panel view)

 

So it should work , as my goblin just uses Navmesh and go to a point.

But no way, the camera do anything and remains at same place.

 

I think the scripts have some problems.

 

I'll try to do my own camera script perhaps later.

 

@Josk :

A camera that follow the player staying always behind, this is 3 rd person camera :)

In the demo this is a simple camera only moving along X and Z axis, that never rotates, thats not the same system.

Stop toying and make games

Link to comment
Share on other sites

The camera needs a target value set so it know what to follow. Drag the entity node you want it to follow from the scene tree to the target field of the camera script.

 

post-1-0-57051100-1362346218_thumb.png

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Strange bug :

I added a simple debugger line and the game just stops after launch ?

 

 

function Script:Start()

self.smoothness=60

if self.target==nil then

return

--Debug:Error("Script must have a target.")

end

Debug:Error("Script ok.")

self.firstframe=true

 

What is the problem with Debug:Error() ?

Stop toying and make games

Link to comment
Share on other sites

@Josh :

It will be complicated as i would need to save scripts, scene dierctory locations,.

Because my project points to my own custom directories and assets.

 

The simple way if you want to test is to use the demo game project.

1) remove camera from code.

2) create and place a camera using the editor

3) attach camera script to the new camera

4) drag barbarian player character to that camera target slot

 

The camera shoudl follow the player.

Stop toying and make games

Link to comment
Share on other sites

It works in the game demo.

 

I retested on my demo test.

It seems to work also.

 

What is wrong :

This is not a rela 3rd person camera but a simple travelling camera , the script name should really be changed.

 

It don't change camera placement and orientation :

When you place your camera in the level created from the editor: the camera will keep that initial position.

 

The camera is not visible like a mesh on the scene, it's just a point , os it's hard to see where the camera points ?

And if you rotate it, you don't knwo anything about where you rotated it and where it points also.

 

So yes the editor should have a real camera mesh representation.

Stop toying and make games

Link to comment
Share on other sites

Josh I too cannot seem to drag a model into the target box of the 3rdpersoncam script. I just get a red circle mouse icon?

 

EDIT, dragging and dropping does work, but its obviously a bit decieving showing the wrong cursor icon.

 

Andy

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Link to comment
Share on other sites

Yu must drag a model or skinMEsh from the "Scene" view panel :

- select camera in the scene viwe : you have the field target appearing

- on the scene view : drag the Barbarian model on the target field and release the mouse.

 

After releasing the mouse the circel red icon will disappear and the barbarian will appear in the target.

 

I think it's a display bug of drag and drop.

Stop toying and make games

Link to comment
Share on other sites

Guest Red Ocktober

going back to the Lightmapping question that was asked above http://www.leadwerks...rs/page__st__40 , i got an external hybrid lightmapped technique working...

 

http://www.leadwerks.com/werkspace/page/gallery/_/giles-lightmapped-scene-in-leadwerks-3-r167

 

this is the same Giles lightmapped mesh that i got into Leadwerks 2... i just copied the folder over and massaged the .mat files for the new Editor...

 

it doesn't use any of the lights or lightmapping (just the ambient light) effects... the results are exactly what youd see in Giles...

 

i dunno if this is what Shad was looking for or if this is the preferred way of doing this... i'm still evaluating the capabilities of 3 and was curious to see if this methodology was feasible...

 

--Mike

Link to comment
Share on other sites

Guest Red Ocktober

1 - original model lightmapped in Giles...

2 - exported out as .x and .x_lmap

3 - load .x into UU3d

4 - merge .x_lmap in UU3D

5 - get rid of extensions in Group and Material names in UU3D

6 - save as .gmf from UU3D

7 - copy folder over to Leadwerks and make mat files (using corresponding ModelView surface references as guide)

 

this should give you a usable .gmf for Leadwerks 2 Editor...

 

you should be able to omit step 7 if exporting to Leadwerks 3 and let Editor make up mat files...

 

use a diffuse shader for the lightmap materials, diffuse + normal shader for the others...

 

 

note that this is a hybrid method... it doesn't need to be run through the lightmapper...

just another way to get a lightmapped scene into L3... i'm still playing around to see

what are the downsides of doing it this way...

 

 

now, all i need is some water and fog... :)

 

--Mike

Link to comment
Share on other sites

Feww , i can't imagine the day you'll have to procuce some 50 or 100 models for a game if you should keep that painfull workflow.

I would let down lightmaps and go for dynamic lightq and shadows instead.

 

LE3 Beta is a hard experience.

Trying to get some stuff running, learning non so trivial Lua specific features and stuff, how works Lua in LE3 etc ...

Lot of stuff, problems, stuck with Android compilation.

 

But staying in the PC version for now, waiting for stable working Android version will be best.

I think i can begin some PC version of a future mobile game.

Stop toying and make games

Link to comment
Share on other sites

Guest Red Ocktober

yeah... hopefully that day will be loooooong in coming...

 

50 models!! smile.png

 

actually, it's not that bad... i use 3DRAD to prototype a lot of my stuff (submarine interiors, buildings, rooms, etc)... so this is right up my alley... 3DRAD uses .x... i do my walkaround in 3DRAD, and when i'm satisfied i load the scene into Giles for the lightmap run...

 

Giles scenes can be built up over time as you complete each new element... then, just let the lightmapper do its thing and save out the results...

 

loading em into UU3D is painless... the only painful part is editing the group and material names to delete the extensions... then it's ready to go into Leadwerks...

 

of course L3 would dave me some time and effort... but i need the intermediate walkthrough step just make sure the levels are scaled and spaced properly... and to check the appearances before i commit to lighting...

 

Leadwerks 2 was the best as i could use the dynamic lighting... no need for lightmapping... but i found dynamic lights to be expensive in L2...

 

Leadwerks 3 promises vast improvements... but right now i can't seem to get the same results that i get in Giles from the L3 Editor lightmapper...

 

we'll see what happens... right now i'm sitting on the fence, still evaluating the Eval copy...

 

 

oh yeah... i'm gonna play around with b3d meshes and using 2 uv maps... see if that reduces the workload any...

 

--Mike

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...