cassius Posted March 9, 2012 Share Posted March 9, 2012 Hi How do I find the angle of a pivot so I can express it in UpdateController? In the code below I get the error "can't convert from tvec3 to float" in updatecontroller angle parameter ( Blitzmax) I need the controller to move in direction of player pointEntity(bg_pivot,player) PointEntity(badguy,player) If stopanim2 = False If EntityDistance(jane,badguy) > 2.0 And EntityDistance(jane,badguy) < 16 turn = EntityRotation(bg_pivot,1) bg_framebegin = 77 bg_frameend = 115 animate_badguy() ' badguy walk UpdateController(bg_control,turn,3.0,0, 0, 1,400,0) Endif EndIf Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Marleys Ghost Posted March 9, 2012 Share Posted March 9, 2012 As the error says Cass, "can't convert from tvec3 to float" ... turn is a Vec3 but the UpdateController wants a float, so try turn.y which is the y value of the Vec3 Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
cassius Posted March 9, 2012 Author Share Posted March 9, 2012 Thanks mg. I changed it to turn.y and got no error message, but the enemy character has now disapeard so must be something else wrong. EDIT: Is it ok to parent the controller to the pivot? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Marleys Ghost Posted March 10, 2012 Share Posted March 10, 2012 which pivot? you seem to be pointing two things at the player? why not badguy.rotation.y? PointEntity( TEntity entity1, TEntity entity2, int axis=3, flt rate=1, flt roll=0 ) PointEntity(badguy, player,3,1.0) If stopanim2 = False If EntityDistance(jane,badguy) > 2.0 And EntityDistance(jane,badguy) < 16.0 bg_framebegin = 77 bg_frameend = 115 animate_badguy() ' badguy walk UpdateController(bg_control,badguy.rotation.y,3.0,0, 0, 1,400,0) Endif EndIf I try and avoid parenting. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
cassius Posted March 10, 2012 Author Share Posted March 10, 2012 Ok thanks. I think I am slowly getting there. Been messing around for two weeks. When it comes to pointentity I get confused between the character(badguy) its controller ( bg_control) and the pivot bg_pivot Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Marleys Ghost Posted March 10, 2012 Share Posted March 10, 2012 No need for the pivot bg_pivot, just steer your bg_control with the badguy mesh. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
cassius Posted March 10, 2012 Author Share Posted March 10, 2012 Thanks mg. Your code worked fine, exept the enemy character flickers wildly when close to main character. It did that a bit when I used moveentity but not as bad. Anyone know why? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Marleys Ghost Posted March 11, 2012 Share Posted March 11, 2012 I have never had this problem myself, so its hard to speculate without demo/code/video. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
cassius Posted March 11, 2012 Author Share Posted March 11, 2012 it is probably how I coded it. I am going thru code now to improve it. Your help much apreciated. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.