Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] So you should put SetActive(true) when NPC reaches any waypoint?

[DiscordArchive] So you should put SetActive(true) when NPC reaches any waypoint?

[DiscordArchive] So you should put SetActive(true) when NPC reaches any waypoint?

Pages (3): 1 2 3 Next
rektbyfaith
Administrator
0
11-25-2024, 07:57 PM
#1
Archived author: Vel • Posted: 2024-11-25T19:57:29.569000+00:00
Original source

So you should put SetActive(true) when NPC reaches any waypoint?
rektbyfaith
11-25-2024, 07:57 PM #1

Archived author: Vel • Posted: 2024-11-25T19:57:29.569000+00:00
Original source

So you should put SetActive(true) when NPC reaches any waypoint?

rektbyfaith
Administrator
0
11-25-2024, 07:57 PM
#2
Archived author: Northstrider • Posted: 2024-11-25T19:57:41.256000+00:00
Original source

no. setactive as soon as it spawns
rektbyfaith
11-25-2024, 07:57 PM #2

Archived author: Northstrider • Posted: 2024-11-25T19:57:41.256000+00:00
Original source

no. setactive as soon as it spawns

rektbyfaith
Administrator
0
11-25-2024, 07:57 PM
#3
Archived author: Vel • Posted: 2024-11-25T19:57:51.900000+00:00
Original source

And will it spawn without player logging in?
rektbyfaith
11-25-2024, 07:57 PM #3

Archived author: Vel • Posted: 2024-11-25T19:57:51.900000+00:00
Original source

And will it spawn without player logging in?

rektbyfaith
Administrator
0
11-25-2024, 07:57 PM
#4
Archived author: Northstrider • Posted: 2024-11-25T19:57:58.373000+00:00
Original source

no.
rektbyfaith
11-25-2024, 07:57 PM #4

Archived author: Northstrider • Posted: 2024-11-25T19:57:58.373000+00:00
Original source

no.

rektbyfaith
Administrator
0
11-25-2024, 07:58 PM
#5
Archived author: Northstrider • Posted: 2024-11-25T19:58:15.965000+00:00
Original source

you need to trigger the loading either by loading all grids or writing a script that loads the cell once on player login
rektbyfaith
11-25-2024, 07:58 PM #5

Archived author: Northstrider • Posted: 2024-11-25T19:58:15.965000+00:00
Original source

you need to trigger the loading either by loading all grids or writing a script that loads the cell once on player login

rektbyfaith
Administrator
0
11-25-2024, 07:58 PM
#6
Archived author: Northstrider • Posted: 2024-11-25T19:58:20.006000+00:00
Original source

there is no other way
rektbyfaith
11-25-2024, 07:58 PM #6

Archived author: Northstrider • Posted: 2024-11-25T19:58:20.006000+00:00
Original source

there is no other way

rektbyfaith
Administrator
0
11-25-2024, 07:59 PM
#7
Archived author: Northstrider • Posted: 2024-11-25T19:59:17.585000+00:00
Original source

there is no nice or clean solution for it as of right now. that's one of the oldest issues
rektbyfaith
11-25-2024, 07:59 PM #7

Archived author: Northstrider • Posted: 2024-11-25T19:59:17.585000+00:00
Original source

there is no nice or clean solution for it as of right now. that's one of the oldest issues

rektbyfaith
Administrator
0
11-25-2024, 07:59 PM
#8
Archived author: Alistar • Posted: 2024-11-25T19:59:35.391000+00:00
Original source

I had to do the same a week ago because setactive in smart_scripts wasn't working unless the player moves to the npc first, so on smart_script load I store all npcs that have the SMART_ACTION_SET_ACTIVE and on AddToWorld I setactive. It's a workaround.
rektbyfaith
11-25-2024, 07:59 PM #8

Archived author: Alistar • Posted: 2024-11-25T19:59:35.391000+00:00
Original source

I had to do the same a week ago because setactive in smart_scripts wasn't working unless the player moves to the npc first, so on smart_script load I store all npcs that have the SMART_ACTION_SET_ACTIVE and on AddToWorld I setactive. It's a workaround.

rektbyfaith
Administrator
0
11-25-2024, 08:01 PM
#9
Archived author: Vel • Posted: 2024-11-25T20:01:29.543000+00:00
Original source

Can I write you a PM to get some knowledge from you for this?
rektbyfaith
11-25-2024, 08:01 PM #9

Archived author: Vel • Posted: 2024-11-25T20:01:29.543000+00:00
Original source

Can I write you a PM to get some knowledge from you for this?

rektbyfaith
Administrator
0
11-25-2024, 08:02 PM
#10
Archived author: Vel • Posted: 2024-11-25T20:02:37.277000+00:00
Original source

So something like this won't work? (ignore the invalid syntax, just demonstration purposes)
```c++
void Unit::AddToWorld()
{
if (IsInWorld())
return;

WorldObject::AddToWorld();
i_motionMaster->AddToWorld();

if ( in_array(GetEntry(), [123,321,456,768]) ) {
setActive(true);
}
}
```
rektbyfaith
11-25-2024, 08:02 PM #10

Archived author: Vel • Posted: 2024-11-25T20:02:37.277000+00:00
Original source

So something like this won't work? (ignore the invalid syntax, just demonstration purposes)
```c++
void Unit::AddToWorld()
{
if (IsInWorld())
return;

WorldObject::AddToWorld();
i_motionMaster->AddToWorld();

if ( in_array(GetEntry(), [123,321,456,768]) ) {
setActive(true);
}
}
```

Pages (3): 1 2 3 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)