-
Posts
517 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Genebris
-
I guess there is nothing wrong with your model. You simply need to apply material with animated shader to it to see the animation. Simply drag for example a crawler material to your model in model editor in leadwerks and you will see the animation. This third bone that looks like it's turned in the wrong direction probably just connects armature with the center of the model. I have this extra bone in my arm model even though I don't see it in blender. And I don't know where is actual third bone that should be in ghosts body, it's missing for me too, but I think the animation works properly anyway.
-
I also have the same problem with your model. I'm using Leadwerks exporter, setting scale, rotation and position via Ctrl+a didn't help. Bit I don't see what can be wrong with your model. I didn't have this problem when exporting my own model. I was using default blender skeleton, try using it.
-
Script:Start is not called in lua script in the prefab
Genebris replied to Mikalaj's topic in Programming
I thought start is called for all entities, but if it's not, you can just call it yourself from player start function for example. Find where weapon prefab is loaded in player script and then call weapon's start. I have just came across the same problem so I added start call myself: w=Prefab:Load("prefabs/weapons/"..self.equipment["weapon"]..".pfb") w:GetChild(0).script:Start() -
Yes, pistol is a child of the camera. And I guess you can get ammo like this: "self.weapon.ammo" if you call it from player script or "self.player.script.weapon.ammo" if from something else.
-
I don't really understand it well myself, but here is my RPG script that I imported into player script and monsterAI script: RPG={} function RPG:Create(entity) if entity==nil then Debug:Error("Entity cannot be nil.") end local rpg = {} rpg.entity = entity local k,v for k,v in pairs(RPG) do rpg[k] = v end return rpg end function RPG:IncreaseSkill(skill, progress, calculateProgress) local script=self.entity.script --self.entity is an entity I pass to the create function script.skills[skill]=script.skills[skill]+progress --cleared this function from unnecessary stuff end When this script is imported, I call self.RPG=RPG:Create(self.entity) in the Script:Start in the player script. Now I can use IncreaseSkill like this: self.RPG:IncreaseSkill("Swords", 0.03) And I can do the same in monsterAI script and IncreaseSkill function will increase monster's skill variable.
-
That worked, thank you.
-
I have a script with a function that prints text to the console: function Script:TestFunction() System:Print("TEST PRINT") end When I import this script into player script and call this function in Script:Start everything works fine. import "Scripts/Player/TestScript.lua" ... function Script:Start() self:TestFunction() ... But when I also import this script into MonsterAI script calling this function from player script gives me error like this function doesn't exist there (attemt to call method 'TestFunction' (a nil value)). I wanted my RPG related functions to be imported into player script and NPC script and be able to access their variables through these RPG functions. For example: function Script:IncreaseSkill(skill, progress) self.skills[skill]=self.skills[skill]+progress if self.skills[skill]>100 then self.skills[skill]=100 end end I noticed that default scripts like ReleaseTableObjects.lua use global functions and only variables passed to these functions. Do I have to do the same? function IncreaseSkill(character, skill, progress) character.skills[skill]=character.skills[skill]+progress if character.skills[skill]>100 then character.skills[skill]=100 end end
-
Maybe anyone could post a whole list of these functions?
-
Strange that it is not documented, maybe there is a place where I can watch for other undocumented Lua functions?
-
Everything works well, thank you!
-
There doesn't seem to be a download button in tutorial.
-
I found that default rotation of bones (when rope is vertical) isn't (0,0,0). Probably needs to be fixed in blender to match default rotation of blue cylinders. I'll play with this tomorrow.
-
Ah, you mean using this blue cylinders as bones? That's even cooler, I'll try this tomorrow.
-
So I need to take bottom polygon of the first cylinder and move it to the position of the pivot between first and second cylinder? Then I need to set rotation of this polygon to pivot rotation and then I need to do the same with top polygon of the second cylinder? Haha, smart! I'll try this, thank you guys for helping.
-
Barrel is just an example of normally working prop without any collision shape. I can't understand why bone doesn't work like the barrel. I can't set any shape to the bone. When I press Fit shape on the rope mesh it works and orange parallelepiped appears, when I load a .phy file for this mesh it works as well and orange box appears too. But when I fit shape or load the same shape file for the bone, nothing happens. I can't apply shape to bones from another model I previously created as well. It seems like bones can't have shapes. Maybe I can use simple meshes instead of bones? Can I attach rope's skin to other meshes instead of bones?
-
If make a few cylinders and connect them with joints there will always be a small gaps between those cylinders while rope is moving. Here is physics tab of the barrel: http://i.imgur.com/awoIvkh.png And here is bone: http://i.imgur.com/SRpfdax.png When I launch the game barrel falls down through the terrain and bone with the part of the rope mesh simply disappears.
-
But when I delete shape of the barrel (set it to none), it still falls down like a normal prop. but it doesn't collide with anything. Ok, how can I set a shape to bone? I didn't manage to do this with "Fit shape" button or with .phy file.
-
I have made a rope model and attached bones to it, I can properly move bones in the editor, but when I add mass for one of the bones, this part of the rope simply disappears. How can I make bones act like props so I could connect them with ball joints?
-
Yes, I would also like to know how to update parts of the navmesh in Lua.
-
I have got this problem today after updating my project it project manager. Disable "Sandbox lua" in the editor options and it will work.
-
Can I load a prefab without creating an entity? (Lua)
Genebris replied to Genebris's topic in Programming
Ok, thank you. -
Can I load a prefab without creating an entity? (Lua)
Genebris replied to Genebris's topic in Programming
I think using text files means that player will be able to easily change any item himself, so I wanted to use prefabs to prevent this, but thanks for help, anyway. -
Can I load a prefab without creating an entity? (Lua)
Genebris replied to Genebris's topic in Programming
Is describing all items in the game in a script the only way to do that? -
I want to create an inventory. I imagine this as a table that contains names of items that player has in the inventory. When the player opens inventory menu, script loads prefab of the first item in the inventory, display it's icon and values such as damage or price, and the it does it for all other items in the table. But Prefab:Load also creates an entity. Of course for icon I can just take a name of the item and open a picture with this name, but how should I get item's stats?