Forums WoW Modding Support Archives Azerothcore Discord Archives [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

[DiscordArchive] if i'm spawning creatures outside of the player's current grid, what is required to get that spawn t

rektbyfaith
Administrator
0
11-18-2023, 11:51 PM
#1
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?
rektbyfaith
11-18-2023, 11:51 PM #1

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?

rektbyfaith
Administrator
0
11-19-2023, 12:19 AM
#2
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
rektbyfaith
11-19-2023, 12:19 AM #2

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

rektbyfaith
Administrator
0
11-19-2023, 05:01 AM
#3
Archived author: KJack • Posted: 2023-11-19T05:01:51.623000+00:00
Original source

ooo, set active. let me look at that.
rektbyfaith
11-19-2023, 05:01 AM #3

Archived author: KJack • Posted: 2023-11-19T05:01:51.623000+00:00
Original source

ooo, set active. let me look at that.

rektbyfaith
Administrator
0
11-19-2023, 05:02 AM
#4
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.
rektbyfaith
11-19-2023, 05:02 AM #4

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.

rektbyfaith
Administrator
0
11-19-2023, 05:09 AM
#5
Archived author: KJack • Posted: 2023-11-19T05:09:12.913000+00:00
Original source

yay, adding `->setActive(true)` on him works!
rektbyfaith
11-19-2023, 05:09 AM #5

Archived author: KJack • Posted: 2023-11-19T05:09:12.913000+00:00
Original source

yay, adding `->setActive(true)` on him works!

rektbyfaith
Administrator
0
11-19-2023, 05:09 AM
#6
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?
rektbyfaith
11-19-2023, 05:09 AM #6

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?

rektbyfaith
Administrator
0
11-19-2023, 05:37 AM
#7
Archived author: Nyeriah • Posted: 2023-11-19T05:37:17.546000+00:00
Original source

It keeps the grids loaded
rektbyfaith
11-19-2023, 05:37 AM #7

Archived author: Nyeriah • Posted: 2023-11-19T05:37:17.546000+00:00
Original source

It keeps the grids loaded

rektbyfaith
Administrator
0
11-19-2023, 05:37 AM
#8
Archived author: KJack • Posted: 2023-11-19T05:37:43.567000+00:00
Original source

got it. thanks, that works great.
rektbyfaith
11-19-2023, 05:37 AM #8

Archived author: KJack • Posted: 2023-11-19T05:37:43.567000+00:00
Original source

got it. thanks, that works great.

rektbyfaith
Administrator
0
11-19-2023, 05:50 AM
#9
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?
rektbyfaith
11-19-2023, 05:50 AM #9

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?

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)