-
Posts
124 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by AndyGFX
-
-
I think that this link, help you. Third person camera - ball game example
-
Probably yes.
-
I have same result - FB option missing.
-
When you have done above post and problem still, try rebuild leadwerks mod. bmk makemods leadwers from bin folder of blitzmax folder.
this help you
-
This little sample shows how-to and when is possible call function/method with . and when with :
-- | --------------------------------------------------------------------------- -- | Define class name -- | --------------------------------------------------------------------------- TMyClass = {} -- | --------------------------------------------------------------------------- -- | Define class properties -- | --------------------------------------------------------------------------- TMyClassProp = { var1 = 10, var2 = null, my_fnc = function (a) print(a) end } -- | --------------------------------------------------------------------------- -- | CONSTRUCTOR -- | --------------------------------------------------------------------------- function TMyClass:New() o = TMyClassProp setmetatable(o, self) self.__index = self return o end -- | --------------------------------------------------------------------------- -- | Method #1 -- | --------------------------------------------------------------------------- function TMyClass:SetVar1(v1) self.var1 = v1 end -- | --------------------------------------------------------------------------- -- | Method #2 -- | --------------------------------------------------------------------------- TMyClass.SetVar3 = function (v1) TMyClass.var1 = v1 print(TMyClass.var1) end -- | --------------------------------------------------------------------------- -- | Method #3 -- | --------------------------------------------------------------------------- function TMyClass:GetVar1(v1) return self.var1 end -- ***************************************************************************** -- USING -- ***************************************************************************** -- create instance of TMyClass myClass = TMyClass:New() -- call class method myClass:SetVar1(100) -- direct acces myClass.var2 = 101 -- test result print (myClass:GetVar1()) print (myClass.var2) print (myClass.SetVar3(222)) myClass.my_fnc(123)
Note: Every functions in LUA are values. More here: Lua Functions
-
Your problem is very simple:
Method in LUA is seperated by :
change this line
local h = class.GetTerrainHeight(pos.x, pos.z, self.model.world)
to:
local h = class:GetTerrainHeight(pos.x, pos.z, self.model.world)
-
Property name "class" is used internaly by engine and is created/added to sbx, when model is drag&drop to scene, when exist ini file with same name as model, then is added your property names from ini file to SBX too.
From my point of view, for you is better, create property name like "gameclass" or "classname" to ini file, when you don't need change value.
When you want use lua, then add to section
function class:InitDialog(grid) self.super:InitDialog(grid) group=grid:AddGroup("MyProperties") group:AddProperty("gameclass",PROPERTY_STRING,"OBSTACLE","My game class" end
Note: this code is only example, not tested.
-
When you need define your class category, then you have 2 ways:
1) create ini file with same name like model and define (i.e. classname="OBSTACLE")
2) add new property to lua script
-
... sorry ... i absolutly forgot rebuild LE mods, Yes. Framewerk and Framework works really cool now.
-
I tried Framewek and Framework with BMX, here is result with same scene:
1) Framework - works good
2) Framewerk - crash on fw.Render() - DEBUG output shows:
~>@$BMXPATH/mod/leadwerks.mod/framewerk.mod/Renderer.bmx<425,4> ~>Local <local> ~>@C:/Documents and Settings/Josh/Desktop/Projects/Engine/Source/Entity.bmx<1832,3> ~>Function SetWorld ~>Local Self:TEntity=$0ad81a30 ~>Local world:TWorld=$0acc9d20 ~>Local group:TGroup=Null ~>} ~>
Note: looks like crash when [Loading shader "e:/andygfx/agfx_leadwerks_engine_framework/media/shaders/mesh/mesh_shadow.vert", ""...] is loaded, because this line missing and all after this one.
-
Change fw.main.camera to fw.Main.camera, when you have updated SDK from today.
-
ActionSnake LUA
Extract to LE 2.3 SDK folder and execute RunActionSnake.bat file.
-
looking forward to it... quick question tho, what files do we need to add to get the program to work? anyway of providing an executable?
Which program?
-
I found where was problem. Because LUA is case sensitive and I had wrong class/properties name of framework ( Josh fix naming to same for all languages).
Now my ActionSnake works again. Today will be updated on my server.
-
LUA Layer Commands:
GetFrameworkLayer(mode)
GetLayerCamera
GetLayerWorld
doesn't work too.
-
is there away to prevent the road appearing like it is doing in the picture? It looks....rather bad.
Because you haven't anisotr. filtering enabled. try set to 8
Thanks
Andy
-
When you look inside folder Models/Entities/Light, you have ini file only for Point and Spot light, for Ambient and Directional misssing.
When you need parse classname like above - create missing ini file light_directional.ini and light_ambient.in with classname="light_directional" and classname="light_ambient".
Note: Because you have scene created with this lights, you need fix (add classname to entity in sbx file) manualy or remove it and drag to scene again, then will be classname added to scene.
-
You have to create ini file for this two entities with your default values.
-
Nice.. New LE release and new forum. Great idea.
Note: on iPhone looks different missing avatar images and theme is white.
Button to launch
in Programming
Posted
or when you want wait to end of executed program, try this:
Where app is path/name of exec. program.