Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Posts posted by AggrorJorn

  1. just out of curiosity, did you try creating the baked texture at a larger resolution? the default you are using is 512x512... seems kind of small for detailed images :P

    Macklebee: I tried creating resolutions with 2048 but the result is the same.

  2. Thanks for replying Micheal Betke :P

     


    •  
    • I have a model which consists out of multiple small models.
    • Every single model has a texture applied to it and has uw mapping modifier attached to it.
    • I attach all the model together, because I want only one texture.
    • In the render to texture menu I use the diffuse color output for baked textures.
    • I save the uv coordinates via the flattened uw that is apllied to the model.
    • I remove the flatten modifier.
    • Then I apply the new baked texture to the object
    • I attach the modifier unwrap uvw.
    • I load the uw coordinates so that the baked texture gets positioned right.

     

    The texture coordinates are right but the texture is realy bad afterwards. I made a video of how I do this.

    http://www.visualknights.com/baked/clock_controller.swf

  3. Does anybody have a good resource for baked texturing in 3ds Max? I know how to bake textures on an object. But everytime I apply the baked texture to the object, I see that there is a lot of texture quality loss.

    for example this pendulum clock.

  4. A mesh oriented to face the camera.

    Sorry but I don't know how that would work. Do I have to think about a deforming mesh (which would complicate the situation) or are you suggesting an old style plane that is faced towards the camera with an animated texture?

  5. object.fire:SetVelocity(Vec3(0,0.5,0),Vec3(0,0.05,0))

     

     

    what are you trying to do here ? velocity is a Vec3 the above might act as x,y,z so you have direction in X and Y when you probably only want direction in the +y .. :o

    hmm I used it to ad a litlle motion to the the flame. The velocity is effective when you create the particle and says in which direction the particle goes. I don't think the vilocity is the problem, since the values are going only in the y direction. But even if I would remove the vilocity then the flame texture still has a random angle.

  6. is the flame an emitter ?

    yes.

     

    object.fire=CreateEmitter(25,100,Vec3(0,1,0),0,object.model)
    	object.fire:SetPositionf(0.01,0.52,-0.01,0)
    	object.fire:Paint(LoadMaterial('abstract::candleflame.mat'),0)
    	object.fire:SetRadius(0.1,0.1)
    	object.fire:SetColorf(0.2,0.2,0.2,1,1)
    	object.fire:SetWaver(0)
    	object.fire:SetVelocity(Vec3(0,0.5,0),Vec3(0,0.05,0))
    	object.fire:SetRotationSpeed(0)
    	object.fire:SetArea(Vec3(0.05,0.05,0.05))

  7. Documentation should always be the top priority. That was one of the biggest complaints with Torque and GarbageGames paid for it.

    Totally agree on that.

     

    But there is going to be an official documentation site for Leadwerks 2.3 soon. First of there is the Pages section which contains already some usefull information.

  8. I have this candle with a small flam particle attached to it. the particle itself is correct, but everytime I insert the candle in the scene. The flame is going into another direction. (see image).

     

    Is there some way to control the angle of a particle? (the rotation of the particle itself is set to 0)

  9. It works just as I want it now. Thanks for the help everyone. (Community +1 (couldn't find the + sign :) ))

     

    1 question though: When the fuse is turned of, all lights that were shown, have to be automaticly hidden. I used this code and it works:

    function object:Update()
    	if lightsHide == 1 then
    		local n,target,targetmessage,args,delay
    		for n=0,7 do
    			target=self.model:GetTarget(n)
    			if target~=nil then
    				target:Hide()
    			end
    		end	
    	end
    end

     

    Instead of object:Update() I can also use object:Update(). The result is the same, but I would like to which one is better.

     

    I'm also thinking of putting up a tutorial about this. nice lua code sample...

  10. It is kinda embarrassing :lol: , but after reading your replies I see what you mean. In the first place I didn't need to create those links at all. I totally focused on the wrong problem. I linked the fuse to the lights even before I started trying to make the script, because I thought I would need it. After the script was pretty much done, I must have totally forgotten that those links are not being used by the script. (no messages doink :blink: )

     

    I know that using links wasn't good anyway because if I had more than 8 lights, I would have a problem. But then again, it was more testing if it really worked.

     

    On the other hand: the fuse has links in the scene, so 'target ~= nill'. This would mean that the script works, independent from whether the script is logical.

     

    Cant wait to try this at home...

     

    Thanks for your replies. I'll let you know how it goes.

  11. well you have a local n in the function and a local n in the if loop.

     

    Which one are you calling here:

    target=self.model:GetTarget(n)
    

    Are you getting target is nil error?

     

    because as soon as you exit the for loop, n becomes nil.

    Well the local variables just overwrite each other and are not giving an error. But I removed them since they are pointless. Thx

     

    Since it looks like you want fuseActive to be local to this thingoid try doing this instead:

     

    object.fuseActive = 0

     

    Then use that to check in the ReceiveMessage()

    if object.fuseActive then ...

    That certainly works but that's not the problem of the disfunctioning I think. The lightswitch script doesn't seem to read the lightHide value from the fuse.

  12. Spot the error! no seriously, perhaps I'm declaring the value in the wrong location.

    fuse:

    require("scripts/class")
    local class=CreateClass(...)
    
    function class:CreateObject(model)
    local object=self.super:CreateObject(model)
    
    local fuseActive = 0
    lightsHide = 1
    
    function object:ReceiveMessage(message,extra)
    	if message=="use" then
    		local n,target,targetmessage,args,delay
    		for n=0,7 do
    			target=self.model:GetTarget(n)
    			if target~=nil then
    				if object.fuseActive == 1 then
    					fuseActive = 0
    					lightsHide = 1
    				else	
    					fuseActive = 1
    					lightsHide = 0
    				end
    			end
    		end
    	end
    end	
    end

  13. I'm wondering how to use global variables with LUA. I have a fuse/generator which you can turn on and of. Every single light in my scene can be turned on or off depending on whether the generator is active (on).

    These are the variables that i use in the generator script. I have declared them before I create the object.

    fuseActive = 0
    lightsHide = 1

    I can activate the generator with a use message. The fuseActive variable is used to either turn on or off the generator. When the generator is activated, all the light-switches have to make use of the lightsHide variable.

    This is a part from the light-switch script:

    if lightsHide == 0 then
    if lightOn==1 then
    	target:Hide()
    	lightOn=0
    else
    	target:Show()
    	lightOn=1
    end
    end

    The lightsHide variable in the light-switch script should use the value from the variable in the generator script. How can I make the lightHide variable in the generator script global, so that I can use it in the light-switch script? Any other suggestions whether scripting like this is efficient, is also welcome.

  14. Cloud level editing would be cool, but I have to say that I can hardly imagine people working together while sculpting a terrain.

    How about instead of just the terrain, you can edit the entire scene. One computer is the host, and every lua file that is adjusted, gets updated to the other editing person. When someone drags an object in the scene, the other editor sees this happening, but if you don;t have the same model in the your local folder, than you don't see it happen.

  15. how did this work out for you?

    Well I tried your way, and the the script in the switch was no correct. I think it would have worked, but I had the problem that light that was created inside the lamp, could shine through walls. If I would drag a regular lamp in screen, this didn't happen. Also I would like to leave the script for the light alone.

     

    Hide the light, don't set the color to pure black. A black light will still have to be rendered, even if its effect is invisible.

     

    You also don't have to use messages at all, since its all a single Lua state.

     

    It can be overwhelming to try to imagine all the possibilities these kind of systems might have, but it's not hard to implement simple relationships. This is exactly the kind of thing I wanted to see users start doing with script. :)

     

    I tried this and it worked! Instead of sending messages, I just used the show() and hide() commando's. This is script for the switch:

    require("scripts/class")
    
    local class=CreateClass(...)
    
    class.sound_switch=LoadSound("abstract::switch.wav")
    
    function class:CreateObject(model)
    local object=self.super:CreateObject(model)
    
    local lightOn=1
    
    function object:ReceiveMessage(message,extra)
    
    	local n
    	local target
    	local args
    	local delay
    
    	if message=="use" then
    
    	if class.sound_switch~=nil then
    		PlaySound(class.sound_switch)
    	end
    
    		local n,target,targetmessage,args,delay
    		for n=0,7 do
    			target=self.model:GetTarget(n)
    			if target~=nil then
    				if lightOn==1 then
    					target:Hide()
    					lightOn=0
    				else
    					target:Show()
    					lightOn=1	
    				end
    			end	
    		end	
    	end
    
    end
    end
    

×
×
  • Create New...