Help: FCNPC_GoTo dude -
bookknp - 15.11.2018
Hello friends, I have a question, how can I use FCNPC_GoTo in two different directions?, that is, when I finish arriving at point "A" go to point "B" (im using timers but dont like it)
PHP код:
public move()
{
FCNPC_GoTo(bot1,-2463.5054,140.4829,35.1719, 0, FCNPC_MOVE_TYPE_AUTO, true, 0.0, true, 0.0, 250);
SetTimer("move1", 25000, false);
}
public move1()
{
FCNPC_GoTo(bot1,-2463.6243,175.9550,35.1094, 0, FCNPC_MOVE_TYPE_AUTO, true, 0.0, true, 0.0, 250);
SetTimer("move", 25000, false);
}
Re: Help: FCNPC_GoTo dude -
bookknp - 15.11.2018
Quote:
Originally Posted by bookknp
Hello friends, I have a question, how can I use FCNPC_GoTo in two different directions?, that is, when I finish arriving at point "A" go to point "B" (im using timers but dont like it)
PHP код:
public move()
{
FCNPC_GoTo(bot1,-2463.5054,140.4829,35.1719, 0, FCNPC_MOVE_TYPE_AUTO, true, 0.0, true, 0.0, 250);
SetTimer("move1", 25000, false);
}
public move1()
{
FCNPC_GoTo(bot1,-2463.6243,175.9550,35.1094, 0, FCNPC_MOVE_TYPE_AUTO, true, 0.0, true, 0.0, 250);
SetTimer("move", 25000, false);
}
|
guys, Someone can help me?
Re: Help: FCNPC_GoTo dude -
DIRTYBYT3 - 15.11.2018
The 2 timers are activated at the same time fix your code. I do something similar but with actors to make them walk. Maybe you should put a timer when spawnea the bot
Re: Help: FCNPC_GoTo dude -
DIRTYBYT3 - 15.11.2018
Understand what I say? you must give the bot some time to get to point B then you should redirect it by activating the other timer "move1"
Re: Help: FCNPC_GoTo dude -
bookknp - 15.11.2018
Quote:
Originally Posted by DIRTYBYT3
Understand what I say? you must give the bot some time to get to point B then you should redirect it by activating the other timer "move1"
|
Hello friend, for me it works perfectly the code that I posted but I do not like. Can you give me an example without timers or is it necessary to use timers?
Re: Help: FCNPC_GoTo dude -
DIRTYBYT3 - 15.11.2018
Quote:
Originally Posted by bookknp
Hello friend, for me it works perfectly the code that I posted but I do not like. Can you give me an example without timers or is it necessary to use timers?
|
I do not use npc for me they are unnecessary and I consume slots instead I use actors. As I said in my case when spawn the actor in OnActorSpawn I use a timer to start walking and then another to redirect it by changing its angle
Re: Help: FCNPC_GoTo dude -
Freaksken - 16.11.2018
Quote:
Originally Posted by bookknp
when I finish arriving at point "A" go to point "B"
|
That's exactly what
move paths are for.
EDIT:
We fixed some crashes with move paths in the in development v2.0 version, so if you get crashes with the 1.8.2 version, that's why.
Re: Help: FCNPC_GoTo dude -
bookknp - 16.11.2018
Quote:
Originally Posted by Freaksken
That's exactly what move paths are for.
EDIT:
We fixed some crashes with move paths in the in development v2.0 version, so if you get crashes with the 1.8.2 version, that's why.
|
Very thx Freaksken!!!! Can you give an example for add paths?
Re: Help: FCNPC_GoTo dude -
Freaksken - 16.11.2018
Код:
//Create a path:
new movePath = FCNPC_CreateMovePath();
FCNPC_AddPointToPath(movePath, x1, y1, z1); //Renamed to FCNPC_AddPointToMovePath in FCNPC 2.0
FCNPC_AddPointToPath(movePath, x2, y2, z2); //Renamed to FCNPC_AddPointToMovePath in FCNPC 2.0
//Destroy a path:
FCNPC_DestroyMovePath(movePath);
movePath = FCNPC_INVALID_MOVEPATH_ID;
//Use a path:
FCNPC_GoByMovePath(npcid, movePath);
Re: Help: FCNPC_GoTo dude -
bookknp - 16.11.2018
Quote:
Originally Posted by Freaksken
Код:
//Create a path:
new movePath = FCNPC_CreateMovePath();
FCNPC_AddPointToPath(movePath, x1, y1, z1); //Renamed to FCNPC_AddPointToMovePath in FCNPC 2.0
FCNPC_AddPointToPath(movePath, x2, y2, z2); //Renamed to FCNPC_AddPointToMovePath in FCNPC 2.0
//Destroy a path:
FCNPC_DestroyMovePath(movePath);
movePath = FCNPC_INVALID_MOVEPATH_ID;
//Use a path:
FCNPC_GoByMovePath(npcid, movePath);
|
Thank you very much Freaksken!!!, I have another question, how can I repeat the path infinitely? +rep
Re: Help: FCNPC_GoTo dude -
NaS - 16.11.2018
Quote:
Originally Posted by bookknp
Thank you very much Freaksken!!!, I have another question, how can I repeat the path infinitely? +rep
|
There are two callbacks for move paths you can use for this:
Code:
FCNPC_OnFinishMovePath(npcid, pathid); // Called when the whole path ends
FCNPC_OnFinishMovePathPoint(npcid, pathid, pointid); // Called for each node that was reached
You can just restart the Node Playback in FCNPC_OnFinishMovePath
There's also a callback for simple FCNPC_GoTo if you should ever need it:
Code:
FCNPC_OnReachDestination(npcid);
Check the
GitHub page for all natives and callbacks.
Re: Help: FCNPC_GoTo dude -
bookknp - 16.11.2018
Quote:
Originally Posted by NaS
There are two callbacks for move paths you can use for this:
Code:
FCNPC_OnFinishMovePath(npcid, pathid); // Called when the whole path ends
FCNPC_OnFinishMovePathPoint(npcid, pathid, pointid); // Called for each node that was reached
You can just restart the Node Playback in FCNPC_OnFinishMovePath
There's also a callback for simple FCNPC_GoTo if you should ever need it:
Code:
FCNPC_OnReachDestination(npcid);
Check the GitHub page for all natives and callbacks.
|
Very thx friend

, I am learning with you a lot. +rep