Jump to content

aMoistKite

Members
  • Posts

    22
  • Joined

  • Last visited

Posts posted by aMoistKite

  1. I had added MySQL support myself not too long ago since a lot of the old resources did not really work anymore. I will see if I can clean up the code a bit and post it.

  2. // Initial data
    %npcPosition = %talkingNPC.getPosition();
    %playerPosition = %clickingPlayer.getPosition();
    %interactionDistance = 4;
     
    // Get the vector between the NPC and the player
    %separationVector = VectorSub(%playerPosition, %npcPosition);
     
    // Eliminate the z component of the vector (only because OP says '2D vectors')
    %separationVector.z = 0;
     
    // Normalize to a length of 1
    %unitVector = VectorNormalize(%separationVector);
     
    // Scale the unit vector by %interactionDistance
    %interactVector = VectorScale(%unitVector, %interactionDistance);
     
    // Add %interactVector to the NPC position to get the target player position
    %targetPosition = VectorAdd(%npcPosition, %interactVector);

    Works like a charm. Thank you good sir.
  3. So I am making a game with a diablo style of movement and when the player clicks on an npc to say talk to them i need to get the point that is between the player and the npc that is a set distance from the npc to move the player to. I am honestly bad at math so if anyone could help me with this? I had been searching around on google and got something like this:

    %interactionDistance = 4;
    %interactX = %objectX + (%playerX - %objectX) / %interactionDistance;
    %interactY = %objectY + (%playerY - %objectY) / %interactionDistance;
    

    but it only moves the player closer with the father away the player is.

  4. So there is your problem. I would use something else, either the full template or the new base game template if you want to hop on the latest trends, other templates are not that well supported.

    Surely it is down to be something the tutorial I followed is missing and not because I am not using one of the default templates.
  5. Why does what work?

    All I know is that previously you could host and join multiple instances from the same machine and now with the latest version it does not work anymore. Don't ask me why.

    If I test with the full game template (using the same compiled exe) I can run a dedicated server and join from the same machine. But when I do yhe same with my game (using a blank template) I can't connect.

  6. I have been trying to get a basic network test going following this tutorial and i have been unable to get it to work (they are on the same machine). The client just gets stuck saying "Sending Connect challenge Request".

    I know it can't be a network issue since if i launch a dedicated server and a client using something like the full template I can connect to it just fine. Is there something the tutorial is missing?

  7. Okay, can we get the actual use-case?

    You can't find any examples of this because there is no need to do this. TorqueScript has multi-dimensional arrays. Why are you not just using them? What is the perceived bottleneck?

    %username = %mydata["row", "collum"];

    something along those lines.

    I can't find any examples how to create said array in C++ and pass it to tourqescript.

×
×
  • Create New...