• 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.3] Upgrade System

OP
OP
oen432

oen432

Legendary OT User
Joined
Oct 3, 2014
Messages
1,452
Solutions
49
Reaction score
1,545
Location
Poland
GitHub
Oen44
@oen432 there is a folder called data/scripts/lib all files of type lib should be defined here
these files are loaded after the classical lib's
Wasn't related to his error anyway. But for the future, RevScript is loading files in alphanumerical order, not prioritizing files over folders and that's the shitty part.
1637804955933.png
For example this structure will be loaded in this order:
1. companions.lua
2. enchantress.lua
3. scoundriel.lua
4. spells folder
5. templar.lua

So to make spells folder load last I had to rename scripts and make it this way
1637805032658.png
 

Pawcio6

Member
Joined
Sep 26, 2009
Messages
137
Solutions
3
Reaction score
12
Nice system!
I've worked on dynamic items myself few years ago and remember it was painfull to repair everything that was based on itemId. I'm not familiar with TFS 1.x+ but without any source modification i think it is kinda pointless since functions like luaPlayerRemoveItem will not recognize attributes every npc sell will pick randomly not to mention market or loading from sql.
 

beenii

Active Member
Joined
Jul 26, 2010
Messages
485
Solutions
1
Reaction score
27
Wasn't related to his error anyway. But for the future, RevScript is loading files in alphanumerical order, not prioritizing files over folders and that's the shitty part.
View attachment 63578
For example this structure will be loaded in this order:
1. companions.lua
2. enchantress.lua
3. scoundriel.lua
4. spells folder
5. templar.lua

So to make spells folder load last I had to rename scripts and make it this way
View attachment 63579

Hello, I have a little problem, the items add the attributes, but when deequip the item, it does not remove the attributes.

I have no error in console, any possible solution?
 

Pawcio6

Member
Joined
Sep 26, 2009
Messages
137
Solutions
3
Reaction score
12
Do you have this problem on every items? If you added custom item maybe it will need extra lines in movements.xml, but firstly test if you have same problem with item that is already present in movement.xml with equip and deequip functions
 

beenii

Active Member
Joined
Jul 26, 2010
Messages
485
Solutions
1
Reaction score
27
Do you have this problem on every items? If you added custom item maybe it will need extra lines in movements.xml, but firstly test if you have same problem with item that is already present in movement.xml with equip and deequip functions

I am using otservbr, I have the callback functions installed, all system works perfectly.

the only change I made:
Original Line:
MoveItemEvent.onMoveItem = function(player, item, fromPosition, toPosition)

Change to:
MoveItemEvent.onMoveItem = function(player, item, count, fromPosition, toPosition, fromCylinder, toCylinder)


because with the original line: I can't unequip any part of the set on players xD

and have this error in console:
attempt to index local 'fromPosition' (a number value)

I have been analyzing in detail, the problem is in fromPosition.

In line:
if fromPosition.y >= 64 or fromPosition.x ~= CONTAINER_POSITION then
When I remove that line, now it doesn't put the attributes, it just removes them.
 
Last edited:

Pawcio6

Member
Joined
Sep 26, 2009
Messages
137
Solutions
3
Reaction score
12
yeah, probably count(number) is returned as fromPosition(position table) if you have source to your engine find there onMoveItem and check correct order or troubleshoot yourself by printing every value
 
OP
OP
oen432

oen432

Legendary OT User
Joined
Oct 3, 2014
Messages
1,452
Solutions
49
Reaction score
1,545
Location
Poland
GitHub
Oen44
Do you have this problem on every items? If you added custom item maybe it will need extra lines in movements.xml, but firstly test if you have same problem with item that is already present in movement.xml with equip and deequip functions
This script is not using Movements and is not depending on it.

I am using otservbr, I have the callback functions installed, all system works perfectly.

the only change I made:
Original Line:
MoveItemEvent.onMoveItem = function(player, item, fromPosition, toPosition)

Change to:
MoveItemEvent.onMoveItem = function(player, item, count, fromPosition, toPosition, fromCylinder, toCylinder)


because with the original line: I can't unequip any part of the set on players xD

and have this error in console:
attempt to index local 'fromPosition' (a number value)
That's my bad. Fixed, download new version.

As for why is it not removing attributes, maybe you don't have events enabled in data/events/events.xml?
Updated Wiki for that Installation RevScript & EventCallback · Oen44/TFS-Upgrade-System Wiki (https://github.com/Oen44/TFS-Upgrade-System/wiki/Installation-RevScript-&-EventCallback)
In OTServBR onItemMoved is disabled by default otservbr-global/events.xml at main · opentibiabr/otservbr-global (https://github.com/opentibiabr/otservbr-global/blob/main/data/events/events.xml#L22)
 

beenii

Active Member
Joined
Jul 26, 2010
Messages
485
Solutions
1
Reaction score
27
This script is not using Movements and is not depending on it.


That's my bad. Fixed, download new version.

As for why is it not removing attributes, maybe you don't have events enabled in data/events/events.xml?
Updated Wiki for that Installation RevScript & EventCallback · Oen44/TFS-Upgrade-System Wiki (https://github.com/Oen44/TFS-Upgrade-System/wiki/Installation-RevScript-&-EventCallback)
In OTServBR onItemMoved is disabled by default otservbr-global/events.xml at main · opentibiabr/otservbr-global (https://github.com/opentibiabr/otservbr-global/blob/main/data/events/events.xml#L22)

Wow, I missed that detail: onItemMoved

now if it is working well. Thank you so much

Suggestions for future system updates:
  • Message when stats change, with stats equipped.
  • Add mana regeneration/health regeneration (Ticks)
  • Add speed attribute

excellent system, very clean code, I hope I can add myself the suggestions that I made
 
Top