Jazz
-
Posts
265 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Jazz
-
-
Did you create a navmesh?
-
Here's the function for the staff I did in this old video. Offsets were trial and error and need changing for each model. It's called in UpdateWorld() That was my only attempt so there's probably a better way.
function Script:AttachWeapon() if self.fingerBone == nil then self.fingerBone = self.entity:FindChild("Bone R Finger11") if self.fingerBone == nil then Debug:Error("Finger bone to attach weapon to not found.") end end local fingerPos = self.fingerBone:GetPosition(true) local fingerRot = self.entity:GetRotation(true) local tscale = self.entity:GetScale() local fPos = Transform:Point(0.01 / tscale.x, .02 / tscale.y, .03 / tscale.z, self.fingerBone, nil) --offset playerInfo[ourID].weaponEntity:SetPosition(fPos.x, fPos.y, fPos.z, true) playerInfo[ourID].weaponEntity:SetRotation(fingerRot.x-23, fingerRot.y, fingerRot.z, true) end
- 1
-
-
Did you try Tools>collapse in the model editor?
-
5 hours ago, macklebee said:
Both of those work fine, even though there is no reason to use 'string.format()' in your example.
Drawtext is bugged when used with the built in GUI. Looks like a gui redraw issue.
The following shows the problem. Hit escape for menu, then click outside the buttons.
import("Scripts/Menu.lua") window = Window:Create("example",0,0,800,600) context = Context:Create(window) world = World:Create() light = DirectionalLight:Create() light:SetRotation(45,45,0) camera = Camera:Create() camera:SetPosition(0,0,-3) counter = 1400 toggle = 0 myfont = Font:Load("Fonts/arial.ttf", 16) context:SetFont(myfont) clip = 10 Ammo = 100 local gamemenu = BuildMenu(context) gamemenu.newbutton:SetText("RESUME GAME") window:HideMouse() while window:Closed()==false do if gamemenu:Update()==false then return end if toggle==1 then counter = counter + 10 end if toggle==0 then counter = counter - 10 end if counter>=1400 then toggle = 0 end if counter<=10 then toggle = 1 end if gamemenu:Hidden() then Time:Update() world:Update() end world:Render() context:SetBlendMode(Blend.Alpha) context:SetColor(1,0,0,.5) context:DrawRect(38,30,300,300,1,30) context:SetColor(0,1,1,1) context:DrawText(string.format("Ammo1: "..clip.. " | " ..Ammo), 100, 80) context:SetColor(1,0,0,.5) context:DrawText(string.format("%.0f",counter),38,30,300,300,Text.VCenter+Text.Center) context:SetColor(1,1,1,1) context:DrawText(string.format("Ammo2: "..clip.. " | " ..Ammo), 30, 100, 300, 250, Text.VCenter+Text.Center) context:SetColor(0,1,1,1) context:DrawText(string.format("Ammo3: "..clip.. " | " ..Ammo), 100, 300) context:SetBlendMode(Blend.Solid) context:Sync(true) end
- 2
- 1
-
Just now, tipforeveryone said:
Woww. show me how can I get this ?
Put that command in your .bat file. It will output it in output.txt
- 1
- 1
-
cscdvmp.exe > output.txt
Lua Error: [string "/Scripts/Custom Scripts/Menu/MenuFunctions.lua"]:69: attempt to index a nil value
-
I've had that happen as well as tree shadows appearing where there are no trees.
-
Still plans for a road tool? SetLayerAlpha/GetLayerAlpha appear to be broken so it can't be done that way.
-
53 minutes ago, vblack said:
OK, tried the code, but it doesn't work, when I go inside, it just flicker and the terrain is still visible
Here's a compiled version to try.
terraintest.rar · 23.58 MB
https://www.dropbox.com/s/0wbgdtz1huytp4d/terraintest.rar?dl=0
-
1 minute ago, vblack said:
Hi;
In TerrainRemove.lua, tSize and terrain are undefined ?
They are defined in Main.lua
-
-
Not yet. That will be done later.
-
1 minute ago, Josh said:
Looks cool. What are you using for the networking?
Enet
-
Testing new camera collision in multiplayer.
- 1
-
Was playing with terrain the other day for fun so I put it in the workshop. It's too bad not all the terrain commands are working/exposed to lua.
" terrainCutter.lua Lowers terrain the size of the model/CSG it's attached to. terrainRemove.lua lowers it when you enter the model's AABB then restores it when not in it's AABB. "
https://www.leadwerks.com/workshopitem?tags=&queryType=1&fileType=0&fileid=938356115
- 1
-
huh? am i missing something? why wouldn't it not rotate if i don't move the mouse?
Maybe I missed something. I'm talking about the character falling through the platform.
-
Yeah, not quite sure what i should be seeing here in the beta. I can turn completely around with just the mouse while not pressing the WSAD keys.
What happens if you run it and don't move the mouse either?
-
or just update your project to any of the available versions, beta (Ver4.4), stable (Ver4.3), or Ver4.1. This latest issue was caused by an "optimization" in the Ver4.2 that was resolved within a week or two and was never part of the Ver4.3 stable release.
This does occur in the latest (4.4) beta. The attached map should show this if you run it and don't move the player.
-
-
I could really use this when I'm running multiple instances of multiplayer games.
-
Been a while since I used it but I believe you just have to set the monitor's material to use the same texture you set for the camera, which would probably be monitor.mat.
edit: Just tested. I set a csg to greengrid.mat and the camera's render texture to greengrid.tex. This is looking at it with the FPS player.
-
Good thought. The height from a flat jump remains the same but the sloped jump improved from 5.77 to 8.71. I'd love to see it get even closer to the full height (ideally the whole thing). Here's what the video looks like now:
My solution didn't work for you?
- 1
-
Have you thought about using SetVelocity to set the character's vertical velocity to zero when they jump?
Vec3 v = player->GetVelocity()
v.y=0
player->SetVelocity(v)
This works but the jump is still not high enough. The y velocity is negative on a downward sloped jump. The following seems to work but note I didn't test it very much...
local tmp = self.entity:GetVelocity()
if tmp.y < 0 then
tmp.y = math.abs(tmp.y) --compensate for negative velocity
self.entity:SetVelocity(tmp)
end
- 1
pointentity
in Programming
Posted
This thread is from 2011. There is no PointEntity anymore, it is Point.
self.entity:Point(Entity2)
self.entity is the entity the script is attached to.