Jump to content

I am really am not getting this?


Andy Gilbert
 Share

Recommended Posts

Ok.. Al im trying to do is in the lua editor outside of the editor, load a scene and place a model inside it?

 

The code..

 

RegisterAbstractPath("")

--Set graphics mode
if Graphics(1024,768)==0 then
Notify("Failed to set graphics mode.",1)
return
end

world=CreateWorld()
if world==nil then
Notify("Failed to initialize engine.",1)
return
end

gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),1+2+4+8)


scene=LoadScene("abstract::scene.sbx")

model1=LoadMesh("abstract::simple_1.gmf")
PositionEntity(model1,Vec3(-1,2,0))


camera=CreateCamera()
camera:SetPosition(Vec3(0,20,0))
camera:Turnf(0.0,42,0.0)

Collisions(1,1,1)


while AppTerminate()==0 do



UpdateAppTime()
world:Update(AppSpeed())

SetBuffer(gbuffer)
world:Render()
SetBuffer(BackBuffer())
world:RenderLights(gbuffer)

DrawText(UPS(),0,0)
Flip(0)
end

 

Ok the above just crashes when you try to run it, remove the line PositionEntity(model1,Vec3(-1,2,0)) and it loads, but cannot see the model?

 

am i doing it wrong?

 

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

 

 

am i doing it wrong?

 

Andy

 

 

As far as I know lua does not use Josh's Abstract file system.

 

So could be a path issue.

 

Having said that, you are attempting to write a lua script in the lua editor?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

It loads the scene fine?? and thats set using the abstract system?

 

Just the model.

 

And its crashing when the entityposition line is there, loads fine without it?

 

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

well ill post a demo if you want but it can easily be replicated? the scene it nothing but a terrain and the model is a cube?

 

But the loading of stuff doesnt seem a problem..

 

It just literally crashes when i try to use the commands PositionEntity and also ive noticed EntityType?

 

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

Without a demo, I can only guess what you might be doing.

 

 

Ok ,well ive now found out what the prob is (which i thought you might of picked up on)

 

I was using the command PositionEntity where as in lua it seems its SetPosition? I was under the impression most commands where the same?

 

is there not a compiled list of the lua commands for LE as it seems its just a guessing game?

 

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

Hmm, do you have a ETA (i know your busy) with a list of commands?

 

and just so i know... are ALL LE commands avaialble via lua?

 

Cheers

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

They should all be. If you want to see exactly how they are exposed, see my thread in this forum talking about exposing Lua commands in BMX.

 

Hmm not sure if i understand that, all i need know is commands, which im sure many others do to: for isntance like now, im trying to set the entity type in lua?

 

I havnt got a clue what it is, ive tried the obvious:

 

model1:EntityType(1) - nope

model1:SetType(1) - nope

model1:CollisionType(1) - nope

 

I dare say you could tell me... but then ill only get to the next command i need and same prob.

 

Also whilst your here...

 

Ive noticed some commands arnt syntaxed? or color coded?

 

For instance:

model1=LoadMesh("abstract::simple.gmf")
model1:SetPosition(Vec3(0,2,5))
model1:SetScale(Vec3(0.1,0.1,0.1))
model1body=CreateBodyBox(2,2,5)
model1:SetParent(model1body)
model1body:SetMass(1)

 

SetScale , Setmass arnt yet they work fine.

 

Thanks

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

Keep trying till it goes blue :blink:

 

 

 

But STOP if you turn blue :(

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

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