Jump to content

george68

Members
  • Posts

    50
  • Joined

  • Last visited

Posts posted by george68

  1. 7 hours ago, Josh said:

    I’m curious what you will use this for?

    For maps with large number of entities, it would be nice if I can display a progress of loading. So, I need this information.

    So far I don't now how to get the number of entities in the map, without load it first.

  2. 33 minutes ago, reepblue said:

    There should be a World->CountEntities() now that I think of it. You can also check the Menu.lua script as that iterates through all the entities without a Map hook to find a camera. It should use the CountEntities() function.

    Sorry about that.

    I'll take a look.

    Thank you very much!

  3. Thank you,

    It works. Here is a code snippet for anyone may interested for a quick pick:

    	iVec2 gm;
    	for (int i = 0; i < System::CountGraphicsModes(); ++i)
    		gm = System::GetGraphicsMode(i);
    	pWindow = Window::Create("Hello world", 0, 0, gm.x, gm.y, Window::FullScreen);

     

    • Like 1
  4. I really don't know much about the new engine, except the GUI.

    I don't think that the new engine will face issues like this one above., since this is the nature of a physics engine.  And this is exactly the reason I prefer to avoid physics most of the time

     

  5. 59 minutes ago, Lethal Raptor Games said:

    If you want you could just add some invisible walls to the platform to stop you falling off.  Make some code that enables or disables them depending on what you want to do.

    Thank you. I prefer to write some code to cancel the controller on the platform and move the player as a regular rigid body. I don't know though, if this is possible.

  6. 1 minute ago, JMKUltra said:

    Honestly, for now I would live with it if possible. I've seen much worse behavior in high-end games.

    We want to get everything 100% perfect, but in terms of what we can do in the short-term I would not worry about it for now.

    It is true

    A month ago I was playing with the GODOT engine and I found that there is an alternative function 'update()' for the player, with a snap parameter which perfectly fits for a nice movement on moving platforms (2D)

  7. Quote

    I can imagine that this for you annoying effect could exactly be desired in another case/game

    I agree.

    I tried both the friction and the gravity without success. It seems that a character controller has its own rules.

    If I have time, I'll try to implement a player without using the character controller physics.

  8. Hi,

    In the video below

    you can see that every time I move the character forward, it moves a bit to the direction of the moving platform

    Does anyone know if I can avoid this?

    Here is how I create the player:

    	pControler = Pivot::Create();
    	pControler->SetPhysicsMode(Entity::CharacterPhysics);
    	pControler->SetMass(1.0);
    	pControler->SetPosition(pEntity->GetPosition(true));
    	pEntity->SetParent(pControler, true);
    	pEntity->SetPosition(0.0, getHeight(), 0.0);
    	pEntity->SetShape(NULL);
    	pEntity->SetMass(0.0);

    and here is how I create the platform:

    	std::string szVal;
    	Vec3 origin;
    	Vec3 distance;
    
    	origin = pEntity->GetPosition(true);
    	distance.x = std::atof(pEntity->GetKeyValue("Dx", "").c_str());
    	distance.y = std::atof(pEntity->GetKeyValue("Dy", "").c_str());
    	distance.z = std::atof(pEntity->GetKeyValue("Dz", "").c_str());
    	bEnabled = (bool)std::atoi(pEntity->GetKeyValue("Enabled", "").c_str());
    
    	pEntity->SetShadowMode(2);
    	pEntity->SetGravityMode(false);
    	pEntity->SetCollisionType(Collision::Prop);
    	pEntity->SetMass(1.0);
    
    	pJoint = NULL;
    	SetTarget(origin, origin + distance);

    The SetTarget function:

    	Vec3 pin;
    
    	mOrigin = origin;
    	mTarget = target;
    	mDistance = mTarget - mOrigin;
    
    	if (pJoint)
    	{
    		pJoint->DisableMotor();
    		pJoint->Release();
    	}
    	pin = mDistance.Normalize();
    	pJoint = Joint::Slider(mOrigin.x, mOrigin.y, mOrigin.z, pin.x, pin.y, pin.z, pEntity, NULL);
    	pJoint->EnableMotor();
    	pJoint->SetMotorSpeed(2.0);
    	pJoint->SetTargetAngle(mDistance.Length());

     

  9. Hi,

    I've set up a character controller as follows:

    pControler = Pivot::Create();
    pControler->SetPhysicsMode(Entity::CharacterPhysics);
    pControler->SetMass(1.0);
    pControler->SetPosition(pEntity->GetPosition(true));
    pEntity->SetParent(pControler, true);
    pEntity->SetPosition(0.0, getHeight(), 0.0);
    pEntity->SetMass(0.0);

    and the update world function is:

    walk = (window->KeyDown(Key::Up) - window->KeyDown(Key::Down)) * 7.0;
    if (window->KeyDown(Key::Shift))
    {
    	strafe = (window->KeyDown(Key::Right) - window->KeyDown(Key::Left)) * 2.5;
    }
    else
    {
    	if (window->KeyDown(Key::Right))
    		angle += 2.0;
    	if (window->KeyDown(Key::Left))
    		angle -= 2.0;
    }
    jump = window->KeyHit(Key::Control) * 10.0;
    pControler->SetInput(angle, walk, strafe, jump);

    Everything works fine, unless I change I change the value from 10.0 to 20.0 in the following line:

    jump = window->KeyHit(Key::Control) * 20.0;

    Please watch the following video:

    https://youtu.be/-ufOAnsDqSs

  10. Hi,

    I need a function that rotates an entity in order to turn and look at another one.

    So far I have calculated the vector from the source to the destination entity but I don't know how to calculate the pitch, yaw and the roll of the vector.

    Any assistance will be appreciated.

×
×
  • Create New...