-
Posts
4,816 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by AggrorJorn
-
-
If your coins don't need to interact with physics once they are moving towards you and you don't want them to rotate towards the player you can move them like this:
--UpdateWorld local velocity = (playerPos - coinPos):Normalize() * self.coinMoveSpeed * Time:GetSpeed() local newCoinPos = coinPos + velocity; coin:SetPosition(newCoinPos)
- 1
-
I have a similar situation with camera min/max angles where this works fine. For camera rotation the max angle is actually negative (although the name would suggest otherwise). Based on your if statements and the inversed use of max/min zoom, I figured that for the zooming something similar would be happening.
-
Nice script GorzenDev. That would be a nice addition to the documentation samples.
Little side note:
if self.curZoom < self.maxZoom then self.curZoom = self.maxZoom elseif self.curZoom > self.minZoom then self.curZoom = self.minZoom end
could be shortened toself.curZoom = Math:Clamp(self.curZoom, self.maxZoom, self.minZoom)
- 1
-
The Z index from MousePosition stores the mouse wheel.
https://www.leadwerks.com/learn?page=API-Reference_Object_Window_GetMousePosition
-
You would have to write your settings/save data to a file. This could be any kind of file. For instance like savegame.json or .xml.
--Load the save game file local path = "mysavegame.data" local stream = FileSystem:WriteFile(path) if (stream==nil) then Debug:Error("Failed to write save game.") end --Write save game data stream:WriteLine("LevelFinished:1") stream:Release() --Load the save game stream = FileSystem:ReadFile(path) if (stream==nil)then Debug:Error("Failed to read file.") end --Loop over save game lines while (not stream:EOF()) do System:Print(stream:ReadLine()) end stream:Release()
-
On page: https://www.leadwerks.com/learn?page=API-Reference_Object_Math_Vec3
The Length function has a lower case 'l' instead of capital 'L'. This causes the link to go to the wrong url.
Change https://www.leadwerks.com/learn?page=API-Reference_Object_Math_Vec3_length to
https://www.leadwerks.com/learn?page=API-Reference_Object_Math_Vec3_Length -
The Steam update problem seems to have been resolved. Topic can be closed.
- 1
-
There is a default menu in pretty much every project. Press escape when you run your game and you should see it appear.
have a look at the main.lua.
-
Maybe the mass is too low? For the ropes I use a mass of 10.
-
It is really great to see that people are still making use of these tutorials, even though they are a bit outdated.
The problem lies in the Collision function. Th 4th parameter is speed. When you print out the value to the screen you will see that it is 0 and therefor not afflicting damage to the player.
function Script:Collision(entity,position,normal,speed) System:Print("speed:" ..speed) if speed>20 and entity:GetKeyValue("name") ~= "DeathTrigger" then self:Hurt(100) end end
Obiously the speed value should not be 0. This does seem like a bug imo. Maybe something that slipped in with 4.5. I tried the same map with the beta version and the problem persists. This can be a good bug report.
-
You could make an EnterExit trigger. Not sure if you are using Lua, but you could be doing something similar in C++.
Script.enabled = true Script.entered = false Script.exited = false Script.collided = false function Script:UpdatePhysics() if self.enabled then if self.entered then if self.collided == false then System:Print("Exiting the trigger") self.exited = true self.entered = false end end self.collided = false end end function Script:Collision(entity, position, normal, speed) if self.enabled then self.collided = true if self.entered == false then System:Print("Entered the trigger") self.entered = true self.exited = false end end end
- 1
-
Wow there are some really old and deprecated engines up there. Some of them aren't even actual engines but mods on games.
Additionally you might want to add Leadwerks to that wikipedia entry that is in the first result. At the bottom there is a list of proprietary game engines and leadwerks is not on there, although it is mentioned in the article itself.
- 1
-
Flush the keys to get the desired effect: https://www.leadwerks.com/learn?page=API-Reference_Object_Window_FlushKeys. Also be aware of Keyhit for the same key being stored in a single frame. That means of 2 frames us KeyHit for the Spacebar, only one script will have the spacebar set to true(pressed).
*edit: just read the topic you were refering to. So this solution might not work for you. https://www.leadwerks.com/community/topic/15185-windowkeyhit-strange-problem/?tab=comments#comment-102329
- 1
-
I really doubt that, but feel free to shoot in a suggestion. I know Josh uses subversion himself. Would be even better to have map support that you can merge.
-
Just now, therickmandkok said:
If other users don't report the problem , it's problably to do with my pc / graphics drivers etc... I have a radeon hd 6900 card and I can no longer update the drivers , so that could be it.
To be honest I have had this problem too, but that was years ago when I did a lot of CSG brush creation. These days I just create a brush without looking to the actual measurements. Still, if you are able to record it (OBS) we can see if there is something wrong.
-
Can you record a video maybe? Fyi, you can also change the grid size of the active viewport with [ and ].
-
Ah I see what you mean. The option to check out files works regardless of software you are using btw. Subversion and TeamFoundationService do the same thing.
Leadwerks .map files are binary files which makes them impossible files to merge with text editors/mergers. If you use Git you can not exclusively checkout files, but work with local copies and having to to merge with an existing branch.
-
8 hours ago, MadCat said:
Can you connect the engine to source like Unreal4 engine to show who has check it what in a project?
Sorry I don't understand what you mean by that.
-
Your item script is fine, although I would set the enabled/pickedup boolean to false. Because now, everytime you spawn the entity, it is emmidiatly 'picked up'. I would also rename this boolean to 'pickedUp' or something similar. Calling it 'enabled' could mean anything.
I might have forgot the starting possibility. You want to spawn an item when:
A: there is no entity spawned yet.
B: an entity is spawned but not yet picked up.
Try this line instead of the previous one:
if self.spawn == nil or self.spawn.script.pickedUp then
-
It looks somewhat similar to SVN so you are good to go. Just remember that map files can't be merged, but code files are no problem.
Other version systems that works well are SVN, git and mercurial.
-
The weapon shooting feels really nice.
1 tiny feedback point: the options menu shows the 'on' color as red and the 'off' color as green. Personally I would swap the colors.
-
Sounds promising. Will try it out this weekend.
- 1
-
1 hour ago, Thirsty Panther said:
This one?
Nice one Thirsty Panther. That is the one I meant.
-
I remember a blog post when this option was introduced. I asked the question what would happen with entities loaded by code. The answer was something like "These are not included". But that blog was more than 1 or 2 years ago so things might have changed.
Camera FOV
in Suggestion Box
Posted
That actually makes sense. Never realized this. A small preview window of what that camera is looking at would be nice too. Lets hope Le5 will have this.