[DiscordArchive] if i'm spawning creatures outside of the player's current grid, what is required to get that spawn t
[DiscordArchive] if i'm spawning creatures outside of the player's current grid, what is required to get that spawn t
Archived author: KJack • Posted: 2023-11-18T23:51:03.257000+00:00
Original source
if i'm spawning creatures outside of the player's current grid, what is required to get that spawn to happen and for them to path to the player? running into an issue where i'm spawning npcs too far away from the player and they never show up. I tried `GetMap()->LoadGrid(x, y)` for the spawn spot, but no dice. do i need to do something else to ensure that the tempsummons appear and path to the player?
Archived author: Nyeriah • Posted: 2023-11-19T00:19:07.267000+00:00
Original source
load grid and set the creature as ative, thats the only thing you can do
Archived author: KJack • Posted: 2023-11-19T05:01:51.623000+00:00
Original source
ooo, set active. let me look at that.
Archived author: KJack • Posted: 2023-11-19T05:02:31.481000+00:00
Original source
this is all i'm doing now:
```c++
killer->GetMap()->LoadGrid(-8538.17f, 1486.09f); // Andorov run path grid
if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself())
{
player->SummonCreature(NPC_ANDOROV, -8538.177f, 1486.0956f, 32.39054f, 3.7638654f, TEMPSUMMON_CORPSE_DESPAWN, 600000000);
}
```
and if you get close to him he pops and starts doing his pathing. but if you wait outside his grid he never comes.
Archived author: KJack • Posted: 2023-11-19T05:09:12.913000+00:00
Original source
yay, adding `->setActive(true)` on him works!
Archived author: KJack • Posted: 2023-11-19T05:09:35.206000+00:00
Original source
is that forcing him to be processed even though he's not near a player, I guess?
Archived author: Nyeriah • Posted: 2023-11-19T05:37:17.546000+00:00
Original source
It keeps the grids loaded
Archived author: KJack • Posted: 2023-11-19T05:37:43.567000+00:00
Original source
got it. thanks, that works great.
Archived author: KJack • Posted: 2023-11-19T05:50:15.294000+00:00
Original source
is there an equivalent to `RegisterCreatureAI` for instance scripts? or are we still doing the nested class/struct format?