• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Questions about lua functions

SnakeFist

New Member
Joined
Apr 18, 2024
Messages
9
Reaction score
1
GitHub
jnibali
Hi no more setup questions I swear lol

I am looking over the lua code for TFS in the "data" folder and I have a question about the functions used in them. Specifically I want to be able to find where the definiions of these functions are delcared/stated. For example in the "Poison_wall_run.lua" file it uses two functions
The "onCastSpell" function and then "conjureItem" function.



Lua:
function onCastSpell(creature, variant)
    return creature:conjureItem(2260, 2289, 4)
end

I want to be able to find the definitions of these functions so I can better understand their parameters and functionality. That way I can write my own scripts with a better understanding.
 
conjure item is in the spells lib folder.

I'm not entirely sure for onCastSpell..
But here
and 3 or 4 times in spells.h


For most everything you can find it in a couple of spots.

source files..
luascript.cpp -- all the lua functions
const.h -- sometimes things are thrown in here
enums.h -- if I can't find it anywhere else, it's usually here

data folder
data/lib/core -- for most of the custom functions
data/events/scripts -- for 'triggers', like onLook, onMove, onGainExperience, onSpawn

Anything else, just look to the source files, and do a search of the term you're looking for.

I've never understood c++ very well, and don't understand the logic for how it's sorted into different files..
So can't really help further on that front.
 
Back
Top