-
Posts
4,816 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by AggrorJorn
-
try to set the blend value higher. 2 or 4 might do the trick. tex1 = the diffuse color tex2 = the normal mapping (bump map) tex3 = specular map (for glossines, making it more shiny)
-
I'm trying to push an object forward. To do this I use the AddForceAddPoint command. I've searched the rest of the forum and I kind a get stuck with difining the force. pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,2.0),0,0) if pick~=nil then if MouseDown(1)==1 then centerY=(GraphicsHeight()/2) if (centerY >= currentY) then texty = 1 campos = EntityPosition(fw.main.camera); force= Vec3(pick.x-campos.x,pick.y-campos.y,pick.z-campos.z) NormalizeVec3(force); force.x=10 force.y=0 force.z=0 entity:AddForceAtPoint(force,pick.entity) When I hold down the left mouse button and try to move a box, I recieve the error: index for obect is a valid filed or method. Can someone tell me what I'm doing wrong here?
-
maybe this topic helps. http://leadwerks.com/werkspace/index.php?/topic/329-lua-how-to-animate-models/
-
Now that I have a direction I can look into I can start puzzeling. I've created this sofar: before main loop: currentY = MouseY() main loop: centerY=(GraphicsHeight()/2) if (centerY >= currentY) then texty = 1 elseif (centerY <= currentY) then texty = 2 else texty = 0 end after the update: fw:Update() --get the current Mouse Y position currentY = MouseY()
-
I'm looking for a way to see wether I'm moving my mouse in the Y direction (forward and backward). if MouseDown(1)==1 then if MouseY = "Y moving forward" then do stuff if MouseY = "Y moving backwards" then do stuff end Any suggestions?
-
I assume you are going to buy a license of the program? most of the tutorial on the leadwerks frontpage should help you get going for a few weeks. After that. try to make some content, (models, animations). If you are going for the sdk with LUA integration then I can suggest looking around in the example levels to see how lua files are set up. when you are familiar with programming you could try to start with very short game scripts or so. Also, make good use of the forum, don't hesitate to ask here and there.
-
grayed out? didn't know that. Still ctrl + Z also never worked.
-
make a feature request. This feature could be handy.
-
File Name: Projection light File Submitter: Aggror File Submitted: 27 Dec 2009 File Updated: 27 Dec 2009 File Category: Lua Scripts This spot light lets you choose a projector map via an extra menu. By default it display the leadwerks logo. The material file contains this line: texture0="abstract::projectormap.dds" Click here to download this file
-
The projector LUA is updated now, because of the latest 2.3 sync.
-
it doesn't appear when saving. It happens when I press run. I normally press run to update the file so that every instance in the scene gets the new code. I could use the save button and nothing is wrong. I just wonderd what happens with the code when I run the script (F5). It does this every time I run it.
-
The firepit code: require("scripts/class") local class=CreateClass(...) class.sound=LoadSound('abstract::campfire_01_15.wav') function class:CreateObject(model) local object=self.super:CreateObject(model) object.model.aabb.x0=-5 object.model.aabb.x1=5 object.model.aabb.y0=-5 object.model.aabb.y1=5 object.model.aabb.z0=-5 object.model.aabb.z1=5 --Create light object.light=CreatePointLight(4,model) object.light:SetColorf(1,0.6,0.25,1,1) object.light:SetPositionf(0,0.8,0,0) object.light:SetShadowOffset(0,0.91,0) object.light:SetShadowmapSize(1024) --Create emitters if world_transparency~=nil then if world_main~=nil then SetWorld(world_transparency) object.heathaze=CreateEmitter(10,4500,Vec3(0,1,0),0,object.model) object.heathaze:SetPositionf(-136,52,-662,0) object.material_heathaze=LoadMaterial('abstract::heathaze.mat',0) object.heathaze:Paint(object.material_heathaze,0) object.heathaze:SetRadius(0.25,0.25) object.heathaze:SetWaver(1) object.heathaze:SetOrder(1,0) object.heathaze:SetVelocity(Vec3(0,0.375,0),Vec3(0,0.05,0)) object.heathaze:SetRotationSpeed(0.05) object.heathaze:SetArea(Vec3(0.2,0.0,0.2)) object.heathaze:SetPositionf(0,0.50,0,0) object.fire=CreateEmitter(25,750,Vec3(0,1,0),0,object.model) object.fire:SetPositionf(0,0.25,0,0) object.fire:Paint(LoadMaterial('abstract::fire.mat'),0) object.fire:SetRadius(0.4,0.1) object.fire:SetColorf(0.2,0.2,0.2,1,1) object.fire:SetWaver(1) object.fire:SetVelocity(Vec3(0,1.5,0),Vec3(0,0.05,0)) object.fire:SetRotationSpeed(0.01) object.fire:SetArea(Vec3(0.2,0.1,0.2)) object.sparks=CreateEmitter(5,800,Vec3(0,1,0),0,object.model) object.sparks:Paint(LoadMaterial('abstract::fire.mat'),0) object.sparks:SetRadius(0.01,0.01) object.sparks:SetColorf(1,0.6,0.25,1,1) object.sparks:SetVelocity(Vec3(0,1.5,0),Vec3(0.05,0.5,0.05)) object.sparks:SetRotationSpeed(0.1) object.sparks:SetArea(Vec3(0.4,0.0,0.4)) object.sparks:SetWaver(5) object.sparks:SetPositionf(0,0.25,0,0) SetWorld(world_main) end end --Emit fire sound if class.sound~=nil then object.model:EmitSound(class.sound,10,1,1) end --Declare initial values object.fluctuation=100.0 object.smoothedfluctuation=5.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 --Force the bounding box to be bigger function object:UpdateMatrix() object.model.aabb.x0=object.model.mat.tx-5 object.model.aabb.x1=object.model.mat.tx+5 object.model.aabb.y0=object.model.mat.ty-5 object.model.aabb.y1=object.model.mat.ty+5 object.model.aabb.z0=object.model.mat.tz-5 object.model.aabb.z1=object.model.mat.tz+5 object.model.aabb:Update() 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(2.2,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
-
I have copied the firepit code to my own firepit. The code is besides some default value exactly the same. However when you run the code you get the message : Table index is nill. Also the class.lua is opened with the line selected: classtable[modelreference]=class. The object appears to be working normally but I wonder what the error message means.
-
awesome steam deals here. Stalker shadows of tsjernobyl and stalker blue sky for 6 euro.. very cheap. Penumbra collection is also a recommendment.
-
I think it looks really good!! Especially if you compare it with Dragon Age origines.
-
When you work on large scale scenes, you sometimes want to move an object. When this object is far away, it's realy hard to select an axis of the gizmo. Perhaps it's possible to scale the Gizmo with the + and - keys.
-
I also tried to make my own messages: "LightOn" and "lightOf". This way I can call the entity.light instead of hiding the the lamp. It's the same as show and hide, but the difference is is that I can call light entities that are in a fixed position like the cagelight. But also here: I can only turn it off and not back on.
-
In the switch.lua is comment: --Just set the key and everything will get updated automatically So my guesses are that it updates instantly
-
it has nothing to do with what you typing. It happens a lot that that the engine crashes for no good reason. At least thats how it goes with me.
-
The script I'm using is an entire copy of the original switch. It is exactly the same now, appart from the messages "activate" and " deactivate", which I replaced with Hide and Show. The base.lua message function looks like this. if message=="hide" then entity.model:Hide() entity.hidden=1 elseif message=="show" then entity.model:Show() entity.hidden=0 I have added the entity.hidden=1 and entity.hidden=0 here.
-
I'm trying to make a switch work for turning on and of lights. First problem is, is that I can turn the light of (hide message), but then I can't get it back on (show message.) I use these messages in the switch.lua: if entity.hidden==1 then target:SendMessage("show",nil,delay) else target:SendMessage("hide",nil,delay) end .
-
This is looking very good Tyler. Have you considered overheating? (heavy machine guns)
-
I've made a projector spotlight for you. Place the map with the other lights and drag a projector-spotlight on screen. The only thing you need to do is replace the "projector-map.dds", with your own dds file if you want to. Be sure to give it the same name though. 27 december update: The new 2.3 sync changes the lua a bit. 3 replies lower is the new file.
-
can you show what you have? I'm interested in how much it differs from what I have. perhaps this way I can find something that solves the problem.
-
The problem is (I think) that the key doesn't refresh as it is in the loop. I build a menu to check if you want an icon to appear. however when you set a key, you don't check wether the value in the menu is true or false. I used this approach (with a lot of help from Rick). switch.lua : fpscontroller.lua: --check hand icon pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,2.0),0,0) if pick~=nil then -- show hand icon if (GetEntityKey(pick.entity,"showhand","yes")==true) then handIcon = true end else handIcon = false end But it's not working correctly. Sometimes it works but not always.