-
Posts
517 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Genebris
-
-
Josh mentions a delay in this video, it doesn't look like nav mesh could be changed every frame for every character.
-
-
Why don't you create a table for buttons you need, check them once per update and use this table in every script?
Your class can't help you because you are still calling MouseHit multiple times per frame. You shouldn't do that.
- 1
-
I don't think you can change script in Lua, but you can swap functions because functions are variables in Lua. So you can replace AI UpdateWorld function with another one. But it probably would be easier to replace entity.
-
I have quickly tried to edit terrain shader and realized you can actually cutout fragments depending on texture color to make a visual "hole". If you also add a trigger that toggles player collision with terrain, you will actually be able to do this, but in a messy way.
I have added this to the end of terrain shader:
if (outcolor.x==1) discard;
I barely have any idea of what I did because I know nothing about shaders, but I meant to remove red fragments from terrain and it worked.
Add trigger that does this and you can walk through.
Collision:SetResponse(Collision.Character, Collision.Scene, Collision.None)
- 10
-
No, you will need to use regular model for that.
-
It happens in Skyrim all the time, so it's fine
-
-
You are right, it flickers sometimes. I don't remember having this problem in the past, not sure if this is correct behavior.
-
Why not use particle then?
-
This is a great feature, but the fact that every click makes hierarchy window explode into thousands of child objects makes you stop looking at hierarchy window at all.
-
Character controller option doesn't do anything by itself, you need FPSPlayer prefab.
There is a tutorial: http://www.leadwerks.com/werkspace/page/tutorials/_/fps-character-controller-r23
-
Try GetClass to understand what picking returns, it will probably be terrain class.
http://www.leadwerks.com/werkspace/page/documentation/_/object/objectgetclass-r19
-
Export diffuse, normal and specular maps and set up material in Leadwerks. Keep in mind that if you are texturing with PBR shader in Substance Painter, then you don't have diffuse or specular maps, you can use albedo and roughness, but it won't look the same.
-
The problem I had, was that I needed to also access an element within the table and I struggled figuring out a way to search for a keyword within the file.
what's the problem?
local name = "health"
while (not stream:EOF()) do
local s = stream:ReadLine()
local i = string.find(s,"=")
local k = string.sub(s,1,i-1)
if k==name then break end
end
--here is your line
But I have a question. What does string.sub exactly do?
You give it string and two indexes, it returns part of the string between them.
-
You could count how much time passed since the start of animation and use GetAnimationLength to calculate current frame, I guess. But then you also need to take speed into account.
-
Does it work? For me it crashes, what values does it receive?
-
1)Get entity unique id ? If I have 10 crawlers how do we know which is which when saving and loading ?
Great question, we need a value that is the same each time you load a map, but is unique for every entity. MAYBE if Start execution order is always the same, then you can assign id yourself, but I doubt. This is probably not reliable.
function Script:Start() {
if not IDCounter then IDCounter = 0 end
self.ID = IDCounter + 1
IDCounter = IDCounter + 1
...
Or just by entities order with world:GetEntity() if it's always the same.
2)How to get the animation state of a crawler and make it continue playing that animation after loaded. Example the crawler is playing attack animation and at the frame no15 , when loaded it back it should continue playing attack animation at frame no15.
I don't think you can do this with new animation commands. Strange, there is SetAnimationFrame but no GetAnimationFrame.
But you can do it with old AnimationManager script.
-
Why can't you make a table of all needed data and loop through it to save each table key and value into file?
Remember that these two lines refer to the same variable:
myTable.abc
myTable["abc"]
Try something like this:
for k,v in pairs(myTable) do
stream:WriteLine(k.."="..v)
end
This way you will get a file like this:
health=35
armor=20
magic=110
To load this data into the game you need to read each string, separate it by "=" symbol and use left part as key and right as value.
data={}
while (not stream:EOF()) do
local s = stream:ReadLine()
local i = string.find(s,"=")
local k = string.sub(s,1,i-1)
local v = string.sub(s,i+1)
data[k]=v
end
I haven't actually tried this code, so there can be mistakes.
I believe you won't even need to convert value from string to number, it should be converted automatically if used in calculation. But you can also use tonumber function http://www.lua.org/manual/5.1/manual.html#pdf-tonumber
You can also use string value to access global table itself because every global variable is an element of _G table. These two lines also refer to the same variable:
myT.a
_G["myT"]["a"]
So you can make a header in your save file like this:
[player]
health=10
magic=20
And when you read a string that starts with "[" you can use it as a name of table which you are going to fill with data.
if string.sub(s,1,1) == "[" then
local tableName = string.sub(s,2,string.len(s)-1)
...
_G[tableName][k]=v
-
Moving objects with SetPosition or Move will break Physics simulation. What if you give it a mass, set collision to Trigger so it doesn't bounce itself and then control it's movement with PhysicsSetPosition?
- 1
-
You didn't include the script.
zack57, use default scripts, they have all examples you need.
-
You should do it in Script:PostRender function, look how default player interface is drawn.
-
In the last two tournaments I realized how painful it is to use editor when you have more than 10 objects on the map. I think it could be changed with a few improvements:
Characters' bones and other child objects take up most of the space in the hierarchy window and 99% of the time you don't need to look at them.
And this is just one goblin character. Sure, artist probably shouldn't have included so many child objects, but it shouldn't be a problem anyway.
Suggestions:
- All child objects in the hierarchy should be collapsed when map is opened.
- When you add new objects, their children should be collapsed by default.
- It should never uncollapse automatically. It definitely shouldn't uncollapse when object is selected. Again 99% of the time when you select an object you only want to move it, you don't want to check if all those hundreds of bones are still there.
- There could be a small "Collapse all" button.
- "Frame Selection" button should scroll the hierarchy to the selected object. Also, there should be a hotkey for it, "F" for example.
- "Move to folder" button would help avoid a lot of scrolling
- Search field
Prefabs suggestions:
When saving altered prefab save dialog should open with a path to prefab's last version.
For example, I have a prefab with this path: "prefabs/enemies/goblin1.pfb". I have loaded it, changed and pressed save as prefab. Save window should open with "prefabs/enemies/" path opened and file goblin1.pfb should already be selected.
Not only it saves time, but also eliminates the risk of overwriting wrong prefab and loosing your data, which happened to me several times.
Prefabs should remember a hierarchy folder that they were saved from and appear in this folder when added to the scene. If I have saved goblin in "Entities" folder then it should appear in this folder next time I add it to the scene (if this folder still exists).
- 10
- All child objects in the hierarchy should be collapsed when map is opened.
-
Steam support usually returns your account if you confirm your purchases with keys or credit card info, but they answer very slow, you may need to wait a few weeks.
[Easy] Projectile script usage ?
in Programming
Posted
Shouldn't projectile script be on your projectile object?