• 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!

CreatureEvent [TFS 1.1] Advanced Alchemy System - ModalWindows

Just got home from work, but I will test it tonight/tomorrow. Thanks for your contribution!
 
I plan to expand the system by allowing multiple effects per potion based on potency. Not 100% sure how I want it to work yet, but sometime this week/weekend I should have it figured out.
Good to see people showing interest :D
 
There are errors if you ask to add an ingredient without selecting one. Minor bug, but you get a console error, and the modals closes without any info :D
 
There are errors if you ask to add an ingredient without selecting one. Minor bug, but you get a console error, and the modals closes without any info :D
hm. when I open it up, it automatically selects the first ingredient in the list. are you using otclient?

Edit: answered my own question. Added a fix, updated lib/alchemy.lua. Let me know how it goes @samco

Edit2: won't work that way, choiceId defaults to 255, the issue is, on the ingredient list, it doesn't display all the ingredients, only the ones you're carrying, so I can't default it to choiceId 1, because the ingredient in spot one may not exist in your inventory. I have to make a workaround.


Aaaand edit3: fixed. will select the first available item in the list as the default if nothing is selected. Just make sure if you have more than 255 ingredients or pre-made recipes, that you skip 255 as an id ;) @samco
 
Last edited:
hm. when I open it up, it automatically selects the first ingredient in the list. are you using otclient?

Edit: answered my own question. Added a fix, updated lib/alchemy.lua. Let me know how it goes @samco

Edit2: won't work that way, choiceId defaults to 255, the issue is, on the ingredient list, it doesn't display all the ingredients, only the ones you're carrying, so I can't default it to choiceId 1, because the ingredient in spot one may not exist in your inventory. I have to make a workaround.


Aaaand edit3: fixed. will select the first available item in the list as the default if nothing is selected. Just make sure if you have more than 255 ingredients or pre-made recipes, that you skip 255 as an id ;) @samco
I was using OTClient :p

i think thats best choice to fix, check the first avaiable ingredient :). No time to test now, but i will.
 
I allready have it working. Here a sample:
8191a5c08b07f27fbe58518a06feffbf.png


Ill test more things in a minutes, im doing my lunch now :p. By the way, i have to look at the onLook thing, cause i cant look any object now.


Gonna tell you later, and maybe post a video.


EDIT:: Small video.
I had no idea how this system looked like before this haha, nice!
 
Excelent system :D soo huge.. well done .. btw im having a problem when i try to brew from potions already known

Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/alchemy.lua:onModalWindow
data/alchemy.lua:622: attempt to index a nil value
stack traceback:
        [C]: in function '__index'
        data/alchemy.lua:622: in function 'potionRecipeWindowChoice'
        data/creaturescripts/scripts/alchemy.lua:5: in function <data/creaturescripts/scripts/alchemy.lua:1>

I dont know if its important or not but well, i made a change.. just added the ml bonus feature and everything works fine.. i'm able to create under ingredients option but potions no.. any clue? i tried to imagine but theres no nothing in my mind that could help me :p

Using tfs 1.2
 
Last edited:
Excelent system :D soo huge.. well done .. btw im having a problem when i try to brew from potions already known

Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/alchemy.lua:onModalWindow
data/alchemy.lua:622: attempt to index a nil value
stack traceback:
        [C]: in function '__index'
        data/alchemy.lua:622: in function 'potionRecipeWindowChoice'
        data/creaturescripts/scripts/alchemy.lua:5: in function <data/creaturescripts/scripts/alchemy.lua:1>

I dont know if its important or not but well, i made a change.. just added the ml bonus feature and everything works fine.. i'm able to create under ingredients option but potions no.. any clue? i tried to imagine but theres no nothing in my mind that could help me :p

Using tfs 1.2
post line 622
 
Code:
nil

Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/alchemy.lua:onModalWindow
data/alchemy.lua:623: attempt to index a nil value
stack traceback:
        [C]: in function '__index'
        data/alchemy.lua:623: in function 'potionRecipeWindowChoice'
        data/creaturescripts/scripts/alchemy.lua:5: in function <data/creaturescripts/scripts/alchemy.lua:1>
 
Code:
nil

Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/alchemy.lua:onModalWindow
data/alchemy.lua:623: attempt to index a nil value
stack traceback:
        [C]: in function '__index'
        data/alchemy.lua:623: in function 'potionRecipeWindowChoice'
        data/creaturescripts/scripts/alchemy.lua:5: in function <data/creaturescripts/scripts/alchemy.lua:1>
Ah, just a missing variable. Not sure how that happened :p
just after
Code:
function Player:potionRecipeWindowChoice(windowId, buttonId, choiceId)
put
Code:
    local p = self:getGuid()
 
:3 its me again.. im facing another problem.. now the problem is about look in trade, when i start a trade and i try to look, nothing happens and console return an error

Code:
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:Player@onLookInTrade
data/events/scripts/player.lua:111: attempt to call global 'stat_onLook' (a nil value)
stack traceback:
        [C]: in function 'stat_onLook'
        data/events/scripts/player.lua:111: in function <data/events/scripts/player.lua:108>

Line 111
Code:
        description = stat_onLook(thing, description)
 
Back
Top