-
Posts
314 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Brutile
-
-
You could try to reduce the camera range. Just make sure any long/large areas don't get cut off.
-
This is the full script
Script.player = nil --Entity "Player" Script.enemyPath = "" --path "Enemy Prefab" "Prefab (*.pfb):pfb|Prefabs" Script.spawnRate = 5 --float "Initial Spawn Rate" Script.spawnVariation = 0.25 --float "Spawn Variation" Script.spawnAmount = 5 --int "Initial Spawn Amount" Script.spawnTimer = 0 function Script:Start() self.spawnTimer = self.spawnRate end function Script:UpdateWorld() local deltaTime = (1.0 / Time:UPS()) if self.spawnTimer <= 0 and self.spawnAmount > 0 then self.spawnTimer = self.spawnRate self.spawnAmount = self.spawnAmount - 1 if self.enemyPath ~= "" then local prefab = Prefab:Load(self.enemyPath) if prefab ~= nil then if prefab.script ~= nil then if self.player ~= nil and self.player.script ~= nil then prefab.script.target = self.player.script end prefab:SetPosition(self.entity:GetPosition(true), true) prefab:SetRotation(self.entity:GetRotation(true), true) else prefab:Release() end end end else self.spawnTimer = self.spawnTimer - deltaTime end end
It is an enemy spawner that spawns enemies and sets their target as the player. It tries to spawn an enemy and set the script after 5 seconds, so the player script is definitely being loaded first. I'm really not sure why this would happen
-
I have a script that grabs the player entity as a value:
Script.player = nil --Entity "Player"
The player gets assigned in the scene properties.
This succeeds:
if self.player ~= nil then end
But this doesn't:
if self.player.script ~= nil then end
The player definitely has a script, and I've accessed the script the same way by passing it directly. But using the properties panel to set the player, it doesn't work.
-
I've also noticed this, even with relatively simple scenes. The rendering performance does leave a lot to be desired, even though there are a number of optimizations in the engine. Something just doesn't seem right.
You can paint outside walls with the Caulk material. That way they are not rendered or have collision, but keep in mind, doing so may let light into rooms that shouldn't have light going into them.
-
If you open the monster model (not the prefab) and go into the animation tab, you will see these animations listed.
-
Just tried to do this myself but I keep messing up somewhere, could you show us an example of something simple?
I tried to code up an example, but in doing do, I decided to just write an entire RTS camera that should do what you want it to do.
You can get it here http://steamcommunity.com/sharedfiles/filedetails/?id=617085158
(It may not be available yet, as I only just submitted it)
Have a look at the script and see how to do it, or you may find that it does what you want it to do.
If it is missing something, just let me know (As long as it's not too complicated)
- 1
-
It should just be a matter of centering the root bone in every keyframe that you have set.
-
Does you character move in the animation? Make sure the character walks on the spot and doesn't move away from center.
-
You can also center the pivot in Blender (which is what you are using). It should just be a matter of moving the model to the center of the scene, then with the 3d cursor at 0,0,0, set the origin to 3d cursor.
-
All the objects in the world will be removed when you change the map (afaik), but if you store variables that aren't in objects in the world, eg. the Main.lua script, these should stay when you change map.
- 1
-
That may be something I could help out with. What would it involve on my part? Would you be specializing in a specific area?
I do work full time though, so would only be able to work on it a few hours a day.
-
thanks for your reply it is set to zero in default fps .lua am i looking at the right line ?
Not quite. You are sending the input to the character controller, but the character controller is automatically applying gravity and handling the velocity, so if you send 0 for the movement, you will still get gravity being applied. Calling
self.entity:SetVelocity(Vec3(0))
should do the trick, but as macklebee said, some physics commands don't work as expected with character physics. If this doesn't work, then you could try applying a very small jump amount to the character controller input. This may work to reset the velocity.
-
I've had that problem before. It's because your velocity isn't being reset and you're falling too fast and going through the floor. You'll want to set your Velocity to Vec3(0)
-
I don't think there is any kind of snap feature, but in your case, I would recommend editing the model so that it fits nicely in the grid.
-
I don't use either of those programs, so I'm not sure.
-
The first one is tricky, but the second can be done fairly easily. I don't have access to Leadwerks right now, so I can't code anything that works, but I can try to explain it.
1. Get your local forward movement direction, including the y axis
2. Set y to 0
3. Normalize your movement vector
4. Multiply the vector by your movement speed
5. Apply the movement
If you don't understand what I'm trying to explain, just let me know and I'll whip up the code in about 8 or so hours.
- 1
-
This may be something to do with the engine optimization. I've noticed that it will combine meshes that have the same material to save draw calls. It probably combines it into another object and hides the original (I'm not 100% on this though)
-
As far as I know, the size is hard coded, unfortunately.
I haven't tried this, but you can try to set your character's physics shape by changing SetShape() using http://www.leadwerks.com/werkspace/page/api-reference/_/shape/shapecylinder-r519
-
Looks like you haven't unwrapped its UVs
-
Not by default. You will need to code it manually.
You also don't need animations. If you know what you're doing you can code the fire and walking animations and give them some random variation.
-
The editor uses different settings than your game. You can find the settings by clicking the settings icon at the top, then going into the viewport tab. Try to match those settings in your game.
-
So did you end up fixing the issue?
-
My question is that the ppl judging the competition will be using (I am assuming) better computers. So, I want to know 1) if I burn all of the files that are created when I "publish" my game as a stand alone game along with the oalinst.exe file, will the judges be able to open my game? and, 2) if not, what other files should i include on the disk?
As far as I know, you just need the installer and the openAL. Just make sure that the judges know that they need to install openAL.
- 1
-
Although, I think if its a gen3 or above, OpenGL4 is supported.
Getting script from entity
in Programming
Posted
I tried everything to fix this, but nothing worked. I created a test player entity with the same properties as my player and it worked. I was so confused. I ended up re-saving my player prefab to tweak some settings. Still nothing, so I deleted it and put the prefab back exactly how it was. THEN IT WORKED! It turned out to be some bug with Leadwerks, but unfortunately I have no idea how to replicate the bug.