-
Posts
2,834 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by cassius
-
-
You could get a sound editing app like Audacity (free) and make a faster version of your sound.
- 1
-
That's how I guesed it was. Thanks.
-
Hi
I am trying to convert some code from c++ to lua script and am not sure how to convert the "+=" bit in the following line.
camRotation.y += mouseDifference.x / mouseSensitivity;
Anyone? Thanks
-
I have a third person controller wtitten in c++ by aggrorjorn for le 3.1 which still works. I was thinking of trying to translate it into lua script but for a small amount of money it might be worth getting this new one.
-
I like aggrorjorns idea . its simple and easy to do and could use physics. I also do have a model of a bed and mattress which I made in Blender.
-
Some interesting ideas but quite challenging of my ability. I don't do my own animations and I have no sitting down characters.
I think it could go like this... the user would push the player straight toward the door and find that it will not open. At this point there is no key on the floor outside the cell, but then after a short delay a drunken guard goes past and drops a key. So the player would have to look a second time to find the key. If he attempts a quick escape he is recaptured but if he waits for dark then he gets away.
What the rest of the game is about I don't have a clue.
-
I have a new project set in medieval times. It starts with the player having to escape from a dungeon which has iron bars as a door. How can the player break out? Maybe one of the guards could drop a key on the floor, but that sounds too easy. its not a commercial game. Any ideas? just for fun.
-
If you are using fpsplayer you can set mass in its properties ( in scene panel) I set mine to 40.
- 1
-
Theres no bug in the blank template, my problem is my incomplete knowledge of how c++ is organised. In short I do not know where to start inserting my own code in the new template as it stands.
-
I had this problem and solved it the same way but I was disappointed not to be able to use the menu. I cannot see where we should add our own code with this new version of the template.
-
Thanks aggror
-
I need to know when the player is close to another character for example using GetDistance. Its easy in my c++ project as all characters are loaded by code.
-
I am learning lua script and have placed the fpsplayer in my map. Whats the best way to refer to it in code, and other entities that are not loaded in code but just placed in editor?i
-
Got it working. I copied some sound code from a c+= project of mine inoi main.lua and translated it to lua code and it worked. I left out sorce release line as that was not in my c++ code. Thanks for answers.
-
Game runs fine with sound code removed. I have not touched menu. lua. I got the sound code directly from api reference, its not my code.
-
import("Scripts/Menu.lua") --Initialize Steamworks (optional) --Steamworks:Initialize() --Initialize analytics (optional). Create an account at www.gameamalytics.com to get your game keys --[[if DEBUG==false then Analytics:SetKeys("GAME_KEY_xxxxxxxxx", "SECRET_KEY_xxxxxxxxx") Analytics:Enable() end]] --Set the application title title="shoot" --Create a window local windowstyle = 0 local winwidth local winheight local gfxmode = System:GetGraphicsMode(System:CountGraphicsModes()-1) if System:GetProperty("devmode")=="1" then gfxmode.x = math.min(1280,gfxmode.x) gfxmode.y = Math:Round(gfxmode.x * 9 / 16) windowstyle = Window.Titlebar else gfxmode.x = System:GetProperty("screenwidth",gfxmode.x) gfxmode.y = System:GetProperty("screenheight",gfxmode.y) windowstyle = Window.Fullscreen end window=Window:Create(title,0,0,gfxmode.x,gfxmode.y,windowstyle) --Create the graphics context context=Context:Create(window,0) if context==nil then return end --Load a sound local sound = Sound:Load("Sound/Music/gametune.wav") source = Source:Create() source:SetSound(sound) sound:Release() source:SetLoopMode(true) source:Play() --Create a world world=World:Create() local gamemenu = BuildMenu(context) --Load a map local mapfile = System:GetProperty("map") if mapfile~="" then if Map:Load(mapfile)==false then return end prevmapname = FileSystem:StripAll(changemapname) --Send analytics event Analytics:SendProgressEvent("Start",prevmapname) gamemenu.newbutton:SetText("RESUME GAME") window:HideMouse() else gamemenu:Show() end while window:Closed()==false do if gamemenu:Update()==false then return end --Handle map change if changemapname~=nil then --Pause the clock Time:Pause() --Pause garbage collection System:GCSuspend() --Clear all entities world:Clear() --Send analytics event Analytics:SendProgressEvent("Complete",prevmapname) --Load the next map if Map:Load("Maps/"..changemapname..".map")==false then return end prevmapname = changemapname --Send analytics event Analytics:SendProgressEvent("Start",prevmapname) --Resume garbage collection System:GCResume() --Resume the clock Time:Resume() changemapname = nil end if gamemenu:Hidden() then --Update the app timing Time:Update() --Update the world world:Update() end --Render the world world:Render() --Render statistics context:SetBlendMode(Blend.Alpha) if DEBUG then context:SetColor(1,0,0,1) context:DrawText("Debug Mode",2,2) context:SetColor(1,1,1,1) context:DrawStats(2,22) context:SetBlendMode(Blend.Solid) else --Toggle statistics on and off if (window:KeyHit(Key.F11)) then showstats = not showstats end if showstats then context:SetColor(1,1,1,1) context:DrawText("FPS: "..Math:Round(Time:UPS()),2,2) end end --Refresh the screen if VSyncMode==nil then VSyncMode=true end context:Sync(VSyncMode) end
-
import("Scripts/Menu.lua")--Initialize Steamworks (optional)
--Steamworks:Initialize()--Initialize analytics (optional). Create an account at www.gameamalytics.com to get your game keys
--[[if DEBUG==false then
Analytics:SetKeys("GAME_KEY_xxxxxxxxx", "SECRET_KEY_xxxxxxxxx")
Analytics:Enable()
end]]--Set the application title
title="shoot"--Create a window
local windowstyle = 0
local winwidth
local winheight
local gfxmode = System:GetGraphicsMode(System:CountGraphicsModes()-1)
if System:GetProperty("devmode")=="1" then
gfxmode.x = math.min(1280,gfxmode.x)
gfxmode.y = Math:Round(gfxmode.x * 9 / 16)
windowstyle = Window.Titlebar
else
gfxmode.x = System:GetProperty("screenwidth",gfxmode.x)
gfxmode.y = System:GetProperty("screenheight",gfxmode.y)
windowstyle = Window.Fullscreen
end
window=Window:Create(title,0,0,gfxmode.x,gfxmode.y,windowstyle)--Create the graphics context
context=Context:Create(window,0)
if context==nil then return end--Load a sound
local sound = Sound:Load("Sound/Music/gametune.wav")
source = Source:Create()
source:SetSound(sound)
sound:Release()
source:SetLoopMode(true)
source:Play()--Create a world
world=World:Create()local gamemenu = BuildMenu(context)--Load a map
local mapfile = System:GetProperty("map")
if mapfile~="" then
if Map:Load(mapfile)==false then return end
prevmapname = FileSystem:StripAll(changemapname)
--Send analytics event
Analytics:SendProgressEvent("Start",prevmapname)
gamemenu.newbutton:SetText("RESUME GAME")
window:HideMouse()
else
gamemenu:Show()
end
while window:Closed()==false do
if gamemenu:Update()==false then return end
--Handle map change
if changemapname~=nil then
--Pause the clock
Time:Pause()
--Pause garbage collection
System:GCSuspend()
--Clear all entities
world:Clear()
--Send analytics event
Analytics:SendProgressEvent("Complete",prevmapname)
--Load the next map
if Map:Load("Maps/"..changemapname..".map")==false then return end
prevmapname = changemapname
--Send analytics event
Analytics:SendProgressEvent("Start",prevmapname)
--Resume garbage collection
System:GCResume()
--Resume the clock
Time:Resume()
changemapname = nil
end
if gamemenu:Hidden() then
--Update the app timing
Time:Update()
--Update the world
world:Update()
end--Render the world
world:Render()
--Render statistics
context:SetBlendMode(Blend.Alpha)
if DEBUG then
context:SetColor(1,0,0,1)
context:DrawText("Debug Mode",2,2)
context:SetColor(1,1,1,1)
context:DrawStats(2,22)
context:SetBlendMode(Blend.Solid)
else
--Toggle statistics on and off
if (window:KeyHit(Key.F11)) then showstats = not showstats end
if showstats then
context:SetColor(1,1,1,1)
context:DrawText("FPS: "..Math:Round(Time:UPS()),2,2)
end
end
--Refresh the screen
if VSyncMode==nil then VSyncMode=true end
context:Sync(VSyncMode)
end -
I added this code to main lua and got error message on first line which read
'=' expected near ' '
anyone help?
local sound = Sound:Load("Sound/Music/gametune.wav")
source = Source:Create()
source:SetSound(sound)
sound:Release()
source:SetLoopMode(true)
source:Play()
-
I get exactly the same problem, a crash when crawler kills player.
-
Never mind, problem was caused by using the Microsoft magnifier.
- 1
-
I got the fps shooter game running, so far with no lua scripting of my own. It runs ok in the editor but when I run the exe I cannot see the mouse pointer and am unable to click on play or quit. Am I missing something?
-
Thanks, I will get cracking on this tonight.
- 1
-
Hi
Been using c++ for a long time but would now like to learn lua script. Which tutorial is best to start with..?
My next project will be fps type.
-
I created a new project but then got rid of all the files in source folder and replaced them with older files from 4.3.
That way I can use 4.4 editor but without the gui template.
I like your blog, good luck with your game.
- 1
C++ Or Lua??
in General Discussion
Posted
You can learn lua in a few sessions. Took me months to learn c++ and I am still not advanced at it. Also you get more help on the forum with lua.