Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. Leadwerks ghost strikes again..
  2. Did you give it a try before you call : fw:Render()
  3. Did you try the thing Rick said? with creating a new controller since the old one gets removed?
  4. You can't be far from it. Neither am I, I think. Could you past the code you have where you can switch the scene, but where the control fail?
  5. You can also change this via tools-link index.
  6. welcome to the community! Your art and models look very good. How many polys is the alien soldier?
  7. try using this: if KeyHit(KEY_1)==1 then FreeWorld(fw.main.world) scene=LoadScene("Maps/1.sbx") end if KeyHit(KEY_2)==1 then FreeWorld(fw.main.world) scene=LoadScene("Maps/2.sbx") end
  8. I'll give this a try myself. I need to find out how to do this as well in lua.
  9. 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.
  10. This looks amazing. The video is addepting itself perfectly against the models meshes and the color editing works great. well done Niosop
  11. that would probably be better. When I'm more pro with coding I'll try that. for now I'll just stick with this. +1 for U.
  12. 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....
  13. 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
  14. 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
  15. 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)
  16. 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.
  17. 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.
  18. briljant! Thanks for your help! +1
  19. Thanks Niosop, that worked. function object:Init() self.pos=self.model:FindChild("slingerpoint"):GetPosition(1) self.slinger=LoadModel("abstract::matt_woonkamer_slingerklok_slinger.gmf") self.slinger:SetPosition( self.pos ) end Do you also perhaps know which command to use, so that the position of the slinger gets updated when I move the main object?
  20. I'm trying to load a model that should be positioned at a bone called 'slingerpoint' Can someone tell me what I need to change to get this to work? function object:Init() self.slinger=LoadModel("abstract::slinger.gmf") self.pos=self.model:FindChild("slingerpoint") self.slinger:SetPosition(self.pos) end
  21. picking up objects: Stuff like this is certainly possible. You need a littlle programming experience to do this or you can ask at the programmers section of the forum. I shouldn't be to hard to create this. using a switch: kinda the same like above. The engine comes with a few examples scenes. one of the scene is a tunnel scene where there is switch. this switch can be used to turn on and of a rotating fan. For a light to go on and off you can use the same functionality.
  22. Perhaps it won't open because the joint from the locker is created at the Y axis. Try using self.joint = CreateJointHinge( self.model, self.door,self.door:GetPosition(1), Vec3(0,0,1) ) or self.joint = CreateJointHinge( self.model, self.door,self.door:GetPosition(1), Vec3(1,0,0) ) instead of self.joint = CreateJointHinge( self.model, self.door,self.door:GetPosition(1), Vec3(0,1,0) )
  23. euhm yes thats the one. I don't get it. If Josh made these animation for Charactershop, why would he ask for new animations that are almost the same like the ones that come with the program. rifle_run rifle_run_backward rifle_run_left rifle_run_right rifle_turn_left rifle_turn_right
  24. The only experience I have with character animation is footstep animation in 3d max. This differs a bit from game animation as the character actually moves forward. I though I had enough skill for this to put off a simple result for now. But thats unforunately not true. Have a look at the max file but I doubt if thats good enough. I know a program that contains the animations you need though. It's called CharacterShop. It contains 80 animations, with your requests among them. I don't know if you are allowed to use those animations for distribution to the enitre leadwerks conmmunity. ---edit-- Looks like my upload qouta is reached or something. Download
  25. awesome! It looks realy good. Perhaps you can add some fluctuation to the light? This adds more realism to it. Take for example the code from the firepit.lua.
×
×
  • Create New...