Jump to content

eleXity

Members
  • Posts

    18
  • Joined

  • Last visited

Posts posted by eleXity

  1. ok thanks for your tips :P

     

    I will try the lua version of it, but i don´t understand how it works..

    lets say I run your lua script with RunScript(), how can I then call the function

    TItemClass:New()

    from blitzmax to create the new class, or

    the OnUpdate() function ?

     

    or must I only call it like this :

    lua_getglobal(VM, "TItemClass:New");
    lua_call(VM, 0, 1);
    

     

    Ps.: sorry for the noob questions but I never worked with lua before LE

  2. mhh but this is not what i expect,

    I not want to do something with the entity-lua scripts, I only want that for the entity´s and nothing more B)

    the item scripts should be separate...

     

    I have another question, is it possible to create a lua class from blitzmax and/or invoke functions from within blitzmax

    like this :

    function classname:Bla()

    ?

  3. Hi,

    I want to make some item scripts in XML like this

     

    <class name="item">
    <item> 
    	<!-- Function block-->
    		<function name="OnPick">
    			local itemClass = {}
    
    			itemClass.light = CreateSpotLight()
    			itemClass.light:Hide()
    
    		</function>
    
    		<function name="OnUseSwitch">
    			if (bItem_Used=true) then
    				itemClass.light:Show()
    			else
    				itemClass.light:Hide()
    			end
    		</function>
    
    		<function name="OnUpdate">
    			itemClass.light:SetMatrix(this.tItem_PositionPivot.mat)
    		</function>
    
    </item>
    </class>

     

    I load every function block into an ScriptFunction type in blitz max and they all have one new instance of a TLuaState

    so that I can run it with DoString(), but with the new tLuaState the lugi functions are not registered, how should i do that ?

    hope you understand my problem

     

    PS.: sorry for my bad English B)

×
×
  • Create New...