Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] Ye what I was thinking was that I have moduleA.lua with a function functionA(), and moduleB.lua with

[DiscordArchive] Ye what I was thinking was that I have moduleA.lua with a function functionA(), and moduleB.lua with

[DiscordArchive] Ye what I was thinking was that I have moduleA.lua with a function functionA(), and moduleB.lua with

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
04-21-2022, 01:19 PM
#1
Archived author: Grandold • Posted: 2022-04-21T13:19:09.640000+00:00
Original source

Ye what I was thinking was that I have moduleA.lua with a function functionA(), and moduleB.lua with functionB().

Can I purely inside the code of moduleB.lua somehow force additional function to be ran, when functionA() of the moduleA.lue is executed?
rektbyfaith
04-21-2022, 01:19 PM #1

Archived author: Grandold • Posted: 2022-04-21T13:19:09.640000+00:00
Original source

Ye what I was thinking was that I have moduleA.lua with a function functionA(), and moduleB.lua with functionB().

Can I purely inside the code of moduleB.lua somehow force additional function to be ran, when functionA() of the moduleA.lue is executed?

rektbyfaith
Administrator
0
04-21-2022, 01:21 PM
#2
Archived author: Grandold • Posted: 2022-04-21T13:21:29.042000+00:00
Original source

I would guess some kind of event listener would be required in the moduleB.lua, that would watch whenever functionA() in moduleA.lua is executed and that would then be able to run some other function that I define
rektbyfaith
04-21-2022, 01:21 PM #2

Archived author: Grandold • Posted: 2022-04-21T13:21:29.042000+00:00
Original source

I would guess some kind of event listener would be required in the moduleB.lua, that would watch whenever functionA() in moduleA.lua is executed and that would then be able to run some other function that I define

rektbyfaith
Administrator
0
04-21-2022, 01:22 PM
#3
Archived author: Grandold • Posted: 2022-04-21T13:22:25.858000+00:00
Original source

But yee just something that came into my mind as I was browsing some lua code and thinking if instead of modifying existing code I could just extend it
rektbyfaith
04-21-2022, 01:22 PM #3

Archived author: Grandold • Posted: 2022-04-21T13:22:25.858000+00:00
Original source

But yee just something that came into my mind as I was browsing some lua code and thinking if instead of modifying existing code I could just extend it

rektbyfaith
Administrator
0
04-21-2022, 01:23 PM
#4
Archived author: Honey • Posted: 2022-04-21T13:23:34.616000+00:00
Original source

Oh we're talking about Lua Scripts, Not cpp modules.
Ofc you can execute Code in one lua File, which interacts with another one. Unless you use `local` ofc.
rektbyfaith
04-21-2022, 01:23 PM #4

Archived author: Honey • Posted: 2022-04-21T13:23:34.616000+00:00
Original source

Oh we're talking about Lua Scripts, Not cpp modules.
Ofc you can execute Code in one lua File, which interacts with another one. Unless you use `local` ofc.

rektbyfaith
Administrator
0
04-21-2022, 01:25 PM
#5
Archived author: Foe • Posted: 2022-04-21T13:25:25.998000+00:00
Original source

Yes, there's no problem writing something like that
rektbyfaith
04-21-2022, 01:25 PM #5

Archived author: Foe • Posted: 2022-04-21T13:25:25.998000+00:00
Original source

Yes, there's no problem writing something like that

rektbyfaith
Administrator
0
04-21-2022, 01:25 PM
#6
Archived author: Grandold • Posted: 2022-04-21T13:25:47.429000+00:00
Original source

would that be done with some event listener or what would be the approach?
rektbyfaith
04-21-2022, 01:25 PM #6

Archived author: Grandold • Posted: 2022-04-21T13:25:47.429000+00:00
Original source

would that be done with some event listener or what would be the approach?

rektbyfaith
Administrator
0
04-21-2022, 01:25 PM
#7
Archived author: Foe • Posted: 2022-04-21T13:25:53.532000+00:00
Original source

You can do a lot with the raw functions like packet events, methods, etc
rektbyfaith
04-21-2022, 01:25 PM #7

Archived author: Foe • Posted: 2022-04-21T13:25:53.532000+00:00
Original source

You can do a lot with the raw functions like packet events, methods, etc

rektbyfaith
Administrator
0
04-21-2022, 01:26 PM
#8
Archived author: Foe • Posted: 2022-04-21T13:26:12.696000+00:00
Original source

Quite a lot of core functionality can be emulated in Lua without exposing any new methods
rektbyfaith
04-21-2022, 01:26 PM #8

Archived author: Foe • Posted: 2022-04-21T13:26:12.696000+00:00
Original source

Quite a lot of core functionality can be emulated in Lua without exposing any new methods

rektbyfaith
Administrator
0
04-21-2022, 01:28 PM
#9
Archived author: Foe • Posted: 2022-04-21T13:28:22.349000+00:00
Original source

There's no post-event hook, so you'll have to keep it in mind whenever you write your modules. You can set up an event handler that registers events separately to the script itself, or you can override global functions with other functions. One way is to make a local copy of a global function, overwrite the global function with a new function, and within that new global you run the local copy first before your code
rektbyfaith
04-21-2022, 01:28 PM #9

Archived author: Foe • Posted: 2022-04-21T13:28:22.349000+00:00
Original source

There's no post-event hook, so you'll have to keep it in mind whenever you write your modules. You can set up an event handler that registers events separately to the script itself, or you can override global functions with other functions. One way is to make a local copy of a global function, overwrite the global function with a new function, and within that new global you run the local copy first before your code

rektbyfaith
Administrator
0
04-21-2022, 01:28 PM
#10
Archived author: Foe • Posted: 2022-04-21T13:28:35.100000+00:00
Original source

There's a lot of approaches you can take really ‍♂️
rektbyfaith
04-21-2022, 01:28 PM #10

Archived author: Foe • Posted: 2022-04-21T13:28:35.100000+00:00
Original source

There's a lot of approaches you can take really ‍♂️

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