-
Posts
2,157 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Marleys Ghost
-
Simply post monsterfuncs.h as code the same as you did for the main prog.
-
If you want others to run your code you would also need to post the monsterfuncs.h
-
Well first of all try changing: UpdateController(player,camrotation.Y,move,strafe,jump,10000); To something like: UpdateController(player,camrotation.Y,move*3,strafe*3,jump,500); See if there is an improvement.
-
What problem?
-
Did you get sidetracked?
-
Glad you found the solution
-
back of? ques have back of's? wow who knew ...
-
Thank you Gimpy looks good .. nice regular geometry makes my job so much easier...
-
Cool, looks very nice I can see where you are going with this ... I know what you are thinking ... "Cave condominiums"
-
Not until you do the fully animated Keira Knightley asset!!! .... now thats a model I'd like to ... stack Thanks gimpy
-
Thanks RP very nice indeed, very generous, very stackable
-
Now that's impressive and two days well spent, nice job Niosop
-
How to get vegetation to appear in the menu?
Marleys Ghost replied to TylerH's topic in General Discussion
Not sure, I have tried a few more vegetation models and still can't reproduce the problem you are having but I am using UU3D. -
Did it work?
-
At least for a test to see if what Niosop said is the reason why.
-
Basic Gamepad Control If you have used the Simple Scene Loader with Player Controller in Blitzmax, this is a small addition to it that will allow the use of a gamepad by implementing FreeJoy. This example is based on the code I used to enable the use of my Xbox 360 controllers using the Xbox 360 Wireless Receiver for Windows, but should be simple to alter for use with other gamepads. The additions to the Simple Scene Loader code are enclosed in dashed lines. The additions are annotated with help for settings. I hope this will be of some use to someone. SuperStrict Framework leadwerks.engine Import "PATH TO YOUR 2.3 SDK FOLDER\BMX\Framework\framework.bmx" '------------------------------------------------------------------------ Import Pub.FreeJoy '------------------------------------------------------------------------ Include "lua-gluefunctions.bmx" AppTitle:String = "Basic Example : BMAX + Leadwerks Engine 2.3" GCSetMode(2) 'Register the directory under which the abstract file system will search. RegisterAbstractPath("PATH TO YOUR 2.3 SDK FOLDER") 'Create a Graphics window Graphics(800, 600) AFilter(1) 'Set the anisotropic filter. Range 1-16 'Using AFilter(MaxAFilter()) will use the maximum supported anisotropic filter on your PC 'Adding the line "DrawText ("MaxAFilter = " + MaxAFilter(), 0, 80)" 'after "fw.Render()" will display on screen the maximum supported anisotropic filter. TFilter(1) 'Set trilinear filtering : 0 = off : 1 = on. 'Create a new Framework object. Global fw:TFramework = TFramework.Create() If Not fw RuntimeError "Failed to initialize engine." SetScriptObject("fw", fw)'Setup the global script objects. SetPostFX()'Setup the post processing FX SetVegetationShadowMode(0)'Setup vegetation layer shadows : 0 = off : 1 = on. 'Load the scene. Global scene:TEntity = LoadScene("abstract::basic.sbx") 'Setup the player controller. Global player:TController = CreateController(2.0) PositionEntity(player, StringToVec3(scene.getkey("cameraposition"))) EntityType(player, 3) SetBodyMass(player, 50.0) SetBodyBuoyancyMode(player,0) Collisions(1, 3, 3) 'Setup the player movement variables. Global move:Float = 0.0 Global strafe:Float = 0.0 Global camrotation:TVec3 = Vec3(0) Global mx:Float = 0.0 Global my:Float = 0.0 Global jump:Float = 0.0 Global playerpos:TVec3 = Vec3(0) HideMouse() 'Set stats level : 0 = No statistics : 1 = Show frame rate : 2 = Full statistics. fw.SetStats(2) 'Main program loop. Repeat If KeyHit(KEY_ESCAPE) Exit If AppTerminate() Exit UpdateAppTime() UpdateWorld(AppSpeed()) PlayerController() fw.Update() fw.Render() '------------------------------------------------------------------------ Gamepadstats() '------------------------------------------------------------------------ Flip(0) Forever fw.renderer.gbuffer = Null GCCollect() End 'Functions. Function SetPostFX()'0 = off : 1 = on. fw.renderer.SetAntialias(1) fw.renderer.SetBloom(1) fw.renderer.SetGodRays(1) fw.renderer.SetHDR(1) fw.renderer.SetSSAO(0) fw.renderer.SetWireFrame(0) End Function Function PlayerController() mx = Curve(MouseX() - GraphicsWidth() / 2, mx, 6) my = Curve(MouseY() - GraphicsHeight() / 2, my, 6) MoveMouse(GraphicsWidth() / 2, GraphicsHeight() / 2) '------------------------------------------------------------------------ If JoyCount()>0 Gamepadinput_rightthumbstick() EndIf '------------------------------------------------------------------------ camrotation.X = camrotation.X + my / 10.0 camrotation.Y = camrotation.Y - mx / 10.0 RotateEntity(fw.Main.camera, camrotation) move = KeyDown(KEY_W) - KeyDown(KEY_S) strafe = KeyDown(KEY_D) - KeyDown(KEY_A) jump:Float = 0.0 If KeyHit(KEY_SPACE) & Not ControllerAirborne(player) jump = 4.0 End If If KeyDown(KEY_LSHIFT) | KeyDown(KEY_RSHIFT) move = move * 3.0 strafe = strafe * 3.0 End If playerpos = EntityPosition(player) playerpos.Y = playerpos.Y + 0.80 PositionEntity(fw.Main.camera, playerpos) '------------------------------------------------------------------------ If JoyCount()>0 Gamepadinput_leftthumbstick() Gamepadinput_buttons() EndIf '------------------------------------------------------------------------ UpdateController(player, camrotation.Y, move * 3, strafe * 3, jump, 500, 10) End Function Function StringToVec2:TVec2(text:String, scale:Float = 1.0) Local t:TVec2 = Vec2(1) Local sarr:String[] sarr = text.split(",") If sarr If sarr.length > 0 t.x = Float(sarr[0]) * scale If sarr.length > 1 t.y = Float(sarr[1]) * scale EndIf Return t EndFunction Function StringToVec3:TVec3(text:String, scale:Float = 1.0) Local t:TVec3 = Vec3(1) Local sarr:String[] sarr = text.split(",") If sarr If sarr.length > 0 t.x = Float(sarr[0]) * scale If sarr.length > 1 t.y = Float(sarr[1]) * scale If sarr.length > 2 t.z = Float(sarr[2]) * scale EndIf Return t EndFunction Function StringToVec4:TVec4(text:String, scale:Float = 1.0) Local t:TVec4 = Vec4(1) Local sarr:String[] sarr = text.split(",") If sarr If sarr.length > 0 t.x = Float(sarr[0]) * scale If sarr.length > 1 t.y = Float(sarr[1]) * scale If sarr.length > 2 t.z = Float(sarr[2]) * scale If sarr.length > 3 t.w = Float(sarr[3]) * scale EndIf Return t EndFunction Function SetScriptObject(name:String, o:Object) Local size:Int=GetStackSize() lua_pushbmaxobject(luastate.L,o) lua_setglobal(luastate.L,name) SetStackSize(size) EndFunction Function GetStackSize:Int() Return lua_gettop(luastate.L) EndFunction Function SetStackSize(size:Int) Local currentsize:Int=GetStackSize() If size<currentsize lua_pop(luastate.L,currentsize-size) EndIf EndFunction '------------------------------------------------------------------------ Function Gamepadstats() If JoyCount()>0 SetBlend(BLEND_ALPHA) Local n:Int = JoyCount() DrawText ("Number of Gamepads = "+n,0,80) DrawText ("Gamepad Driver = "+JoyName(0),0,100) DrawText ("Button A = "+JoyDown(0,0),0,120) 'Button 0 DrawText ("Button B = "+JoyDown(1,0),0,140) 'Button 1 DrawText ("Button X = "+JoyDown(2,0),0,160) 'Button 2 DrawText ("Button Y = "+JoyDown(3,0),0,180) 'Button 3 DrawText ("Button Left Shoulder = "+JoyDown(4,0),0,200) 'Button 4 DrawText ("Button Right Shoulder = "+JoyDown(5,0),0,220) 'Button 5 DrawText ("Back = "+JoyDown(6,0),0,240) 'Button 6 DrawText ("Start = "+JoyDown(7,0),0,260) 'Button 7 DrawText ("Left thumb click = "+JoyDown(8,0),0,280) 'Button 8 DrawText ("Right thumb click = "+JoyDown(9,0),0,300) 'Button 9 'D Pad Values : 0 = up : 0.25 = Right : 0.5 = Down : 0.75 = Left : -1 = Centred DrawText ("D Pad = "+JoyHat#(0),0,320) If JoyZ#(0)>0.01 DrawText ("Left Trigger "+JoyZ#(0),0,340) EndIf If JoyZ#(0)<-0.01 DrawText ("Right Trigger "+JoyZ#(0),0,340) EndIf SetBlend(0) EndIf EndFunction 'Joypad/Gamepad Functions. Function Gamepadinput_leftthumbstick() 'Movement strafe=JoyX#(0)*(1) 'Change to (-1) to invert If strafe<(0.2) And strafe>(-0.2) Then strafe=0.0 'Sets the dead zone range, from -1 to 1 move=JoyY#(0)*(-1) 'Change to (1) to invert If move<(0.2) And move>(-0.2) Then move=0.0 'Sets the dead zone range, from -1 to 1 EndFunction Function Gamepadinput_rightthumbstick() 'Mouselook my = Curve(JoyR#(0)*25*(1), my, 6) 'Change to (-1) to invert : Change 25 to alter sensitivity If JoyR#(0)<(0.2) And JoyR#(0)>(-0.2) Then my=0.0 'Sets the dead zone range, from -1 to 1 mx = Curve(JoyU#(0)*25*(1), mx, 6) 'Change to (-1) to invert : Change 25 to alter sensitivity If JoyU#(0)<(0.2) And JoyU#(0)>(-0.2) Then mx=0.0 'Sets the dead zone range, from -1 to 1 EndFunction 'Example button use. Function Gamepadinput_buttons() If JoyHit(0,0) & Not ControllerAirborne(player) 'Jump using the Xbox360 contollers A button jump = 6.0 End If If JoyDown(2,0) 'Run using the Xbox360 contollers X button move = move * 3.0 strafe = strafe * 3.0 EndIf EndFunction '------------------------------------------------------------------------
-
Well either it is missing or you have moved the ProjectWizard.exe from its place in the root of the SDK directory. If none of those try deleting it and then syncing again to replace it.
-
Just out of interest: PositionEntity(spectator, Vec3(1032.38953,180.134216,-243.930679)); Is what I was using to put me right over a road ..
-
Yep I set it back to the old skin.
-
OK, forced an update. and now the roads are showing. So problems solved
-
Just edited my previous post to say that lol .. but yes it does sort it out.
-
Hang on ... put the above comment on hold ... EDIT: ok yes they do appear in your code, somewhat "fragmented" but altering line 13 in the road_node.lua to a higher value (Thanks to Macklebee for that) sorts it out.
-
Well, I just tried your code, set the Abstract path to the SDK, all FX off .. no skybox (I assume because Set Lua variable not being set), but still no roads. No errors either in the log.
-
Are you still using the code you posted above?