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

TFS 1.X+ Any creative solution to block market for Roogaard?

Berciq

Veteran OT User
Joined
Aug 7, 2018
Messages
296
Reaction score
358
Location
Poland
Hey, I have both rook and mainland, but i wish to block mailbox and market for rookgaard players but WITHOUT making changes in core engine .cpp
I tried few things but all have dark sides:


1) I tried to make script to run market that would block players with id=0 (no vocations) from opening market, and it worked, but i couldn't run market with normal vocations as i couldn't put this function="market" to run from a script.
<action itemid="14405" function="market" />


2) I tried to give unique id to item 14405 with script when vocation player uses it and then from this unique id run function market but it didn'r work either

3) I thought that hey, i can always throw out banker from rookgaard as without money on player account You will not buy anything from market and won't sell anything... and then i remembered that i have houses on rook and you need to be charged from account monthly.

4) I tried to give instead of locker, that have inside depot, mail, market, just depot locker, but it doesnt work, I simply can't overwrite depot in rme with town id same way as locker. I heard that i can do it manually but each time i edit map i would have to do it over and over again.

4,5) I tried to give uid to each locker, to run with script as a depot for rookgaard, but none of the functions i used my TFS 1.3 could read.

I read this topic: Help with Locker/Sending Parcel/Market (https://otland.net/threads/help-with-locker-sending-parcel-market.235026/)
I tried to work with chat, but fell into loop of not working solutions :S

Do You cleaver creatives got any idea how I can make it?
or how can I overcome any of the problem that block one of my 5 solutions?
Thanks in advance <3
 
Maybe its possible to replace locker in Rookgaard with a scripted container.

Instead of using a regular depot/locker, use a container item (chest) or a lookalike with a unique (own sprite)

Use script to check vocation and open ONLY depot.

This avoids calling the market/mailbox UI, but still lets rook players use their depot.
You can also block the mailbox or market via distance checks or by simply not placing those objects in Rookgaard.
 
Maybe its possible to replace locker in Rookgaard with a scripted container.

Instead of using a regular depot/locker, use a container item (chest) or a lookalike with a unique (own sprite)

Use script to check vocation and open ONLY depot.

This avoids calling the market/mailbox UI, but still lets rook players use their depot.
You can also block the mailbox or market via distance checks or by simply not placing those objects in Rookgaard.
i'm trying for 2 hours, to make script that would work like deposit but nothing works, i tried like 40 different codes with different functions and each time I got console error that I dont have this or that function etc.

So I can't make depot chest (id 2594) to work like depot chest from locker, not even saying that it would be lovely to have assigned id=1 as my rooktown :(

Doesn't you have by any chance working .lua scrypt for depo locker that is not build in engine?
so I could have 2 separate:
  • normal locker on mainland with depo,mail,market that uses function from .cpp (now this works for me but i can't block market)
  • depot chest on rookgaard with id 2594 that would work through .lua script and imitate depot system?
 
Just check the item ID (from market item) and player vocation here:

For the mailbox, do a player vocation check here, before Game.internalMoveItem:

Edit: didn't realize the 'without changing the source code' until now, good luck!
 
Why can't you just edit sources? Are you using some datapack that doesn't have sources and only precompiled server?
I'm afraid so because I cannot find anywhere .cpp and I didn't wanted to change anything but .lua and .xml scripts
i have no idea that there are more versions, i donloaded tfs1.3 like 7 years ago and it is working.014789.webp014788.webp014787.webp

But can I run just like market id:14405 from actions.xml function:market
<action itemid="14405" function="market" />

depot id: 2594
<action itemid="2594" function="depot" />
this almost works but it runs locker (with 3 things inside: depot,mailbox,market) instead of just depot

so it is depot with depot inside ;D but also market and mailbox which is this pain in my eyess because it connects rook with mainland items

I tried to name function depot, depotchest, depotlocker, as i see them in TFS/src/ files but server console says:
[Warning - Action::loadFunction] Function "depot" does not exist.
 
Last edited:
Change it in sources and check for vocation = 0 there. I would look into container.cpp first. If nothing works I would remove depot in Rookgaard.
 
i donloaded tfs1.3 like 7 years
I'm afraid I have to resign :/ Thanks for all responses
Want a tip? Simple: don't use old datapacks. They're very outdated, and even worse, without the source code you can't properly work on an OT project. You need the source in your hands to make necessary changes and fix issues. Also, that datapack you're using is 7 years old. I recommend migrating to a more recent TFS version, like 1.4.2 (1098) or Black Tek (also 1098). If your TFS 1.3 is 1098-based, it's even better to switch to one of those. Just move your map and scripts to the newer TFS version and your problems will be solved!
 
It was recet when I started ;D

but switching from 1.3 to tfs 1.42 means translating to new functions and methods each scrypt, that has already been tested and is currently working, sounds like additional 40 hours of scrypting and testing..
 
It was recet when I started ;D

but switching from 1.3 to tfs 1.42 means translating to new functions and methods each scrypt, that has already been tested and is currently working, sounds like additional 40 hours of scrypting and testing..

TFS 1.3 to TFS 1.4.2 switch should be pretty easy
 
TFS 1.4 isn't this revscripts?
Compatibility between them is flawless, moving my old server from 1.2 to 1.4.2 required no code changes only placing them in the right locations

Edit: should be the same the old locations simply drag and drop only part you need to do with focus might be events folder to make sure you add your custom changes there inside the new events to support the eventcallback
 
Compatibility between them is flawless, moving my old server from 1.2 to 1.4.2 required no code changes only placing them in the right locations

Edit: should be the same the old locations simply drag and drop only part you need to do with focus might be events folder to make sure you add your custom changes there inside the new events to support the eventcallback
That same compatibility is 98 percent flawless for making the change to BlackTek 1.0 as well... the only 2 percent difference, is that the absorbs are no longer in the items.xml and so that functionality would need to be written by hand in lua. I'm j/s
 

Similar threads

Back
Top