Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Posts posted by AggrorJorn

  1. When you are editing an objects lua file, you don't run the file(F5).

    You must save it. only game scripts can be run.

     

    For the basic lua menu just use:

    require("scripts/class")
    local class=CreateClass(...)
    
    function class:CreateObject(model)
           local object=self.super:CreateObject(model)
    )

  2. We should have 3 kinds of tutorials:

    1) How to start with LE (doesn't exist yet, although the official tutorials cover an essential part of that)

    2) How to use LE (looks like this tutorial is gonna do that)

    3) How to make a game with LE as fast and efficient as possible (Power Tutorial tries to cover that)

    When Josh is back from his weekend of I will ask him what kind of tutorials he is making. I hope to see some updated videos instead of new feature tutorials.

    • Upvote 1
  3. I like the concept and its very generous of you to take the time and even open yourself to the inevitable onslaught of questions. Perhaps just focus on LUA since its the common language that most of us will be using alongside whatever other language. As for the dexsoft models, eh... actually it would apply to basically any model... the problem is there are so many different possible conversion methods... so do you just focus on the model after its been converted to gmf or do you try to cover all of the conversion processes?

    At first I''l just try to make a non-coding User guide. There are a few lines of code in it, but they are not explained in usage. They are just examples.

    I will probably only make somehting Lua. Going into another language would be suïcidale.

    I see that conversion of models needs more attention then I originally thought. I wrote a few lines about the conversion tools, but that probably isn't enough. I'll spend some time on how the conversions work, but i'm goign to finish the guide first, so that I can release it this weekend.

  4. Thanks for the comments :D

     

    - I don't buy models from Dexsoft so I wouldn't know how this works. Maybe someone else has experience with this. This can be added later though because there a lot of people who buy these assets. :huh:

    - I can't program, I just try some code and see if it works. Although I understand LUA a bit better then C++, I sometimes don't know exactly how commando's work. However, when Josh makes some new tutorials I might get better at it. I think I'll make a separate Lua user Guide for this. ;)

    - I'm trying to make this User guide at a way so that every one can work with the engine. It doesn't mater whether you can program, model, animate or texture. When there are chapters that are unclear to users they can report that and I'll make some adjustments. B)

  5. I'm putting together a Leadwerks 2.3 User Guide. It has all the basic functions inside and outside the editor explained. I

     

    Download the LUG here.

     

    Current version: 1.01

     

    106 pages of useful information that helps you getting around with the Leadwerks engine 2.3. This user guide is ideal for beginners but can also be used by advanced members as a reference guide.

     

    *new in version 1.01

    fixed several typos

    fixed incorrect explanations

    updating the light and shadow options (Leadwerks 2.31)

    Camera path

    road node

    corona

    edit menu

    better mat file explanation

    Explanation about shaders

    shader usage

     

    Things that need to be added in LUG:

     

    sounds

    ini file and lua representative

    • Upvote 3
  6. if KeyHit(KEY_F)==1 then 
    FreeFramework(fw)
    fw=CreateFramework()
    SetGlobalObject("fw",fw)        
    scene=LoadScene("Maps/newscene.sbx")

    Using the fpscontroller.lua code..

    This deletes the old scene and loads the new. I have mouselook but seem to be stuck under the new scene with no movement.

    I had the same problem a while ago. The level loading worked good but the character controls seemed all to stop working. instead of freeing the entire world you can make every object member of group. The character controls are then defined outside the group and wont be removed.

     

    scene = LoadScene(test.sbx)
    group1=CreateGroup()
    SetEntityGroup(scene,group1)

    I don't know if this code works with LUA, I can't find it directly.

  7. briljant this works! It's not entirely perfect as the position sometimes changes when I go back from game mode to editor mode. However, I can just drag the candle inscreen when I'm done editing the level. here is the code I use and a screenie.

     

    function class:CreateObject(model)
    local object=self.super:CreateObject(model)
    
    
    --position candle at the camera	
    object.model:SetPosition(fw.main.camera:GetPosition(1))
    object.model:SetParent(fw.main.camera,0)
    object.model:SetPosition(Vec3(0.5,-0.5,1.35),0)
    

    The flame isn't final yet. It looks more like a stick of dynamite....

  8. Rick gave me the following advice via the chat:

     

    • the lua scripts won't run if you load the object. the engine and editor has code in it to make the lua scripts run
    • you should be able to place the candle in the scene still and when you run your game, move it to the fw.camera location and offset it slightly in front to give the same effect
    • so in the candle lua file you can position the model relative to the camera
  9. require("scripts/class")
    
    local class=CreateClass(...)
    
    function class:CreateObject(model)
    local object=self.super:CreateObject(model)
    
    --Create light
    object.light=CreatePointLight(4,model)
    object.light:SetColorf(1,0.6,0.25,1,1)
    object.light:SetPositionf(0,1.2,0,0)
    object.light:SetShadowOffset(0,0.91,0)
    
    
    	object.fire=CreateEmitter(100,100,Vec3(0,1,0),0,object.model)
    	object.fire:SetPositionf(0,0.5,0,0)
    	object.fire:Paint(LoadMaterial('abstract::candleflame.mat'),0)
    	object.fire:SetRadius(0.02,0.02)
    	object.fire:SetColorf(0.2,0.2,0.2,1,1)
    	object.fire:SetWaver(0)
    	object.fire:SetVelocity(Vec3(0,0.01,0),Vec3(0,0.01,0))
    
    --Declare initial values
    object.fluctuation=1.0
    object.smoothedfluctuation=1.0
    
    function object:SetKey(key,value)
    	if key=="color" then
    	elseif key=="intensity" then
    	else
    		return self.super:SetKey(key,value)
    	end
    	return 1
    end
    
    
    function object:GetKey(key,value)
    	if key=="color" then
    	elseif key=="intensity" then
    	else
    		return self.super:GetKey(key,value)
    	end
    	return value
    end
    
    function object:Render()
    	self.fluctuation=self.fluctuation+math.random(-100,100)/1000.0*AppSpeed()
    	self.fluctuation=math.min(1.0,self.fluctuation)
    	self.fluctuation=math.max(0.2,self.fluctuation)
    	self.smoothedfluctuation=Curve(self.fluctuation,self.smoothedfluctuation,5.0/AppSpeed())
    	self.light:SetColorf(1.0*self.smoothedfluctuation,0.6*self.smoothedfluctuation,0.25*self.smoothedfluctuation,1,0)
    end
    
    end
    

  10. The titel might be a bit unclear but I couldn't think of anything else. I have a candle model which you can drag into the scene. Via the attached lua file I load the particles that are used to show a small flame on top of the candle. If I drag the candle in the editor everything works fine.

     

    In the fpscontroller script I load this model like the gun. The candle loads and positions itself fine, but the particles that create the light don't. It is like the lua file for the candle is not being used.

     

    Is it even possible to load a model via script and that the attached script runs with it?

     

    This is the script (before the loop):

    --candle
    candle = LoadMesh("abstract::candle.gmf",vwep)
    candle:SetParent(fw.main.camera,0)
    candle:SetPosition(Vec3(0.5,-0.5,1.35),0)

  11. They were probably positioned in the modeling program so that when they're imported they're at the correct offset.

     

    Thats what I thought at first. But when you open the drawers in the model viewer, you can see that the pivot point of the drawers lies in the back. I don't know why exactly but when you drag the drawers in the editor, the pivot point is indeed with the correct ofsett.

  12. I'm a bit puzzeled with the lua code at the moment. I'm wondering how the drawers are positioned. I can't see any bones or pivots inside the desk mesh and neither do I see the code that positions the drawers at a pivot. I have to be totally blind here or I'missing something completely.

×
×
  • Create New...