Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] how can i grab a creature's SmartAI from code? is there a function that takes in the creature ID and

[DiscordArchive] how can i grab a creature's SmartAI from code? is there a function that takes in the creature ID and

[DiscordArchive] how can i grab a creature's SmartAI from code? is there a function that takes in the creature ID and

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
10-23-2023, 07:30 PM
#1
Archived author: KJack • Posted: 2023-10-23T19:30:03.836000+00:00
Original source

how can i grab a creature's SmartAI from code? is there a function that takes in the creature ID and returns the AI object?
rektbyfaith
10-23-2023, 07:30 PM #1

Archived author: KJack • Posted: 2023-10-23T19:30:03.836000+00:00
Original source

how can i grab a creature's SmartAI from code? is there a function that takes in the creature ID and returns the AI object?

rektbyfaith
Administrator
0
10-23-2023, 07:38 PM
#2
Archived author: Nyeriah • Posted: 2023-10-23T19:38:05.763000+00:00
Original source

GetAI()
rektbyfaith
10-23-2023, 07:38 PM #2

Archived author: Nyeriah • Posted: 2023-10-23T19:38:05.763000+00:00
Original source

GetAI()

rektbyfaith
Administrator
0
10-23-2023, 07:38 PM
#3
Archived author: Nyeriah • Posted: 2023-10-23T19:38:43.736000+00:00
Original source

You can cast it to smartai if that’s what you need, granted they use sai there won’t be issues
rektbyfaith
10-23-2023, 07:38 PM #3

Archived author: Nyeriah • Posted: 2023-10-23T19:38:43.736000+00:00
Original source

You can cast it to smartai if that’s what you need, granted they use sai there won’t be issues

rektbyfaith
Administrator
0
10-23-2023, 07:51 PM
#4
Archived author: KJack • Posted: 2023-10-23T19:51:16.617000+00:00
Original source

sorry, let me give some context. i'm trying to have this stupid bat have the `npc_batrider` script assigned in the database, but if i detect that it's not a boss summon i want it to use the SAI entries in the DB. the way i'm attemping to go about this is with `me->SetAI()` inside the script, but I have to construct the AI I'm assigning and then determine how to activate it correctly. so far... it is not done yet.
rektbyfaith
10-23-2023, 07:51 PM #4

Archived author: KJack • Posted: 2023-10-23T19:51:16.617000+00:00
Original source

sorry, let me give some context. i'm trying to have this stupid bat have the `npc_batrider` script assigned in the database, but if i detect that it's not a boss summon i want it to use the SAI entries in the DB. the way i'm attemping to go about this is with `me->SetAI()` inside the script, but I have to construct the AI I'm assigning and then determine how to activate it correctly. so far... it is not done yet.

rektbyfaith
Administrator
0
10-23-2023, 07:51 PM
#5
Archived author: KJack • Posted: 2023-10-23T19:51:31.464000+00:00
Original source

i have "redo the SAI in the script" as a backup plan
rektbyfaith
10-23-2023, 07:51 PM #5

Archived author: KJack • Posted: 2023-10-23T19:51:31.464000+00:00
Original source

i have "redo the SAI in the script" as a backup plan

rektbyfaith
Administrator
0
10-23-2023, 07:54 PM
#6
Archived author: KJack • Posted: 2023-10-23T19:54:15.086000+00:00
Original source

the AI is resisting being replaced. I tried doing SmartAI in the DB and then replacing it with `SetAI()` and my `npc_batrider` AI I created, but the scheduling doesn't work correctly when I do it that way.
rektbyfaith
10-23-2023, 07:54 PM #6

Archived author: KJack • Posted: 2023-10-23T19:54:15.086000+00:00
Original source

the AI is resisting being replaced. I tried doing SmartAI in the DB and then replacing it with `SetAI()` and my `npc_batrider` AI I created, but the scheduling doesn't work correctly when I do it that way.

rektbyfaith
Administrator
0
10-23-2023, 07:56 PM
#7
Archived author: KJack • Posted: 2023-10-23T19:56:24.490000+00:00
Original source

```c++
// enable SmartAI for the creature, replacing this script
me->SetAI(new SmartAI(me));
```

was my first attempt, but that ends up with a bat that doesn't run any of its SAI action.
rektbyfaith
10-23-2023, 07:56 PM #7

Archived author: KJack • Posted: 2023-10-23T19:56:24.490000+00:00
Original source

```c++
// enable SmartAI for the creature, replacing this script
me->SetAI(new SmartAI(me));
```

was my first attempt, but that ends up with a bat that doesn't run any of its SAI action.

rektbyfaith
Administrator
0
10-23-2023, 08:19 PM
#8
Archived author: Nyeriah • Posted: 2023-10-23T20:19:38.371000+00:00
Original source

Yeah no you can’t replace AI during run time
rektbyfaith
10-23-2023, 08:19 PM #8

Archived author: Nyeriah • Posted: 2023-10-23T20:19:38.371000+00:00
Original source

Yeah no you can’t replace AI during run time

rektbyfaith
Administrator
0
10-23-2023, 08:20 PM
#9
Archived author: Nyeriah • Posted: 2023-10-23T20:20:03.943000+00:00
Original source

Sai script f.e is loaded when the creature is added to world
rektbyfaith
10-23-2023, 08:20 PM #9

Archived author: Nyeriah • Posted: 2023-10-23T20:20:03.943000+00:00
Original source

Sai script f.e is loaded when the creature is added to world

rektbyfaith
Administrator
0
10-23-2023, 08:27 PM
#10
Archived author: KJack • Posted: 2023-10-23T20:27:32.238000+00:00
Original source

got it. that's unfortunate, but understood.
rektbyfaith
10-23-2023, 08:27 PM #10

Archived author: KJack • Posted: 2023-10-23T20:27:32.238000+00:00
Original source

got it. that's unfortunate, but understood.

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