Jump to content

AndyGFX

Members
  • Posts

    124
  • Joined

  • Last visited

Posts posted by AndyGFX

  1. or when you want wait to end of executed program, try this:

     

    ...
    'Execute application
    	Local process:TProcess = CreateProcess(app)
    	Repeat
    		Local error:String = process.err.ReadLine()
    		If error <> "" Then
    			Notify error
    		EndIf
    		If process.Status() = 0 Then Exit
    	Forever
    
    ...
    
    

     

    Where app is path/name of exec. program.

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

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

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

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

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

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

×
×
  • Create New...