Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AGK Version 2.0.15d

Author
Message
CodeMonkey
11
Years of Service
User Offline
Joined: 6th Mar 2013
Location: Ireland
Posted: 7th Dec 2015 17:11
@Stab in the Dark software: Yeah man, I can't seem to get it working. I used the commands there today for the first time, but they don't seem to be creating the controller.

This code shows that that the controller is not being created..

Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 7th Dec 2015 19:54
Take a look at this code example.

The coffee is lovely dark and deep,and I have code to write before I sleep.
CodeMonkey
11
Years of Service
User Offline
Joined: 6th Mar 2013
Location: Ireland
Posted: 7th Dec 2015 20:13 Edited at: 7th Dec 2015 20:14
Ah, I made a stupid mistake, I used integer instead of Vector3 for the arguments! First time I've been forced to use Vectors with AppGameKit so I didn't notice when looking at the command help.

Cheers mate!
CodeMonkey
11
Years of Service
User Offline
Joined: 6th Mar 2013
Location: Ireland
Posted: 7th Dec 2015 20:37
New problem with the character controller..
I can't move on two axes simultaneously. The code below doesn't work. Instead it forgets about the first command and just moves on the X-Axis.

CodeMonkey
11
Years of Service
User Offline
Joined: 6th Mar 2013
Location: Ireland
Posted: 7th Dec 2015 21:56
These physics commands are implemented in a very odd way :/ They're completely unusable in an actual game. I can't get an object to move on two axes without completely messing up the other axis
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 7th Dec 2015 22:27
Have you tried using the rotation commands? Press Q or E to rotate while moving forward.
The coffee is lovely dark and deep,and I have code to write before I sleep.
CodeMonkey
11
Years of Service
User Offline
Joined: 6th Mar 2013
Location: Ireland
Posted: 7th Dec 2015 22:42
I need to be able to straff while moving forward. I'd use the rotation but I need the physics object to keep it's rotation static. I'm trying to use the physics controller for a hovercraft kinda vehicle.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 7th Dec 2015 23:05
So what you really need is a vehicle controller as opposed to a character controller.
You could try using a kinematic physics body. It can them be moved by the object commands.
Dynamic bodies will bounce off kinematic bodies . Kinematic bodies do not have any interaction with static objects
so you would have to limit that manually.
The coffee is lovely dark and deep,and I have code to write before I sleep.
CodeMonkey
11
Years of Service
User Offline
Joined: 6th Mar 2013
Location: Ireland
Posted: 7th Dec 2015 23:24
Yeah that's the problem, I need static collision with the player. This should all be easy to implement with standard physics commands really, but the lack of ApplyImpulse, or more refined SetVelocityX/Y/Z commands makes it quite difficult. I might have to resort to ray-casting if there's no update soon.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 8th Dec 2015 00:09
Quote: "or more refined SetVelocityX/Y/Z"

Does SetObject3DPhysicsLinearVelocity do the job?

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
CodeMonkey
11
Years of Service
User Offline
Joined: 6th Mar 2013
Location: Ireland
Posted: 8th Dec 2015 01:12
It doesn't unfortunately. At least I haven't been able to implement it with smooth gravity + movement on the X/Z axis simultaneously. It has a strange set of arguments. I don't really understand it fully.
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 8th Dec 2015 10:08 Edited at: 8th Dec 2015 10:16
@Stab into the dark software :
thank you very much for your example, it's very interesting, we can use it for a platform game .

I have created another thread for a 3D platform example based on your code :
https://forum.thegamecreators.com/thread/215989
http://www.dracaena-studio.com
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 10th Dec 2015 14:47
@Paul : How Can we use SetObjectMeshImage() ?
When I try to load a file with several mesh (a .dae), AppGameKit consolidate all my mesh in one object :
Quote: "This command will not load any animation or bone data and will consolidate the vertices into a single object with as few meshes as possible. "


So how can I load several meshes from one file ?
AGK2 tier1 - http://www.dracaena-studio.com
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Dec 2015 08:55
@Blendman : LoadObjectWithChildren()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 11th Dec 2015 10:17
@BAtVink : thanks, it works with .x, but it doesn't work with .dae.

For info, to use several materials in agk with a unique object with severals meshes, in blender, you have to :
In blender :
- create your objects and apply a material to each objects. The number of meshes imported in AGk is the same as the number of materials different. If you create 3 objects, with 3 materials on each object, you will have 3 meshes in AGK.
- export in .x, with option : lefthanded, Y axis, export meshes, normal, uvcoordinates, export materials (if needed)

In AppGameKit :
- LoadObjectWithChildren()
- You have to use : SetObjectScale(objid, 1,-1,1), in some case, I don't know why ^^.
AGK2 tier1 - http://www.dracaena-studio.com
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 13th Dec 2015 00:42
@Paul
can u provide a BreakPoint or DebugStop Command?
did not find something in docu.
AGK (Steam) V2.0.15d : Windows 10 Pro 64 Bit : AMD (15.201.1151.0) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-04-23 14:49:12
Your offset time is: 2024-04-23 14:49:12