• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Smart Exit + Retarget on TFS 1.2

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Hey all,

I was reading the forum but couldn't find something regarding this matter in topic.

There are some software to reduce lag which offers you "smart exit" with hotkeys CTRL+ SHIFT + Q which disconnects the game and shows you automatically the characters screen, offering you to do a quick relog. This is used very often on hardcore places when players gets trapped by 8 monsters and they use this system in order to "abuse" of the retarget concept when they disconnect.

I was asking to myself (after some years out of the OTs) if this - stop attacking on disconnect for a while depending on each vocation - was applied too on TFS or any other distro?

Also wondering another topic about "retarget" it self, cause CipSoft about a year ago implemented a system where monsters are retargeting a lot more rather than before, this can be seem a lot on Medusa, Grim Reapers, Hydras, and a few others so people now a days to keep hunting in party they might use some field-bombs. The question here is if this - higher retarget chance - has been updated on TFS or any other distro?

I went to check TFS github codes and saw this on Medusa:
Code:
<targetchange interval="4000" chance="20" />

As far as I can tell this is not well, since it has a chance higher, base on my experience on CipSoft the last months playing.

Thanks.
 
Solution
Thanks bro.

But I got a question. How do this work, on each attack that the monster do on every time they target some one till next retarget?
I really don't know as I have not tested but this will prevent players from taking damage at all from monsters while disconected (I don't think it's like global tho as I remember that monster's wave do damage on disconected people even when they exit).

By reading the code, what I can get is:

If player is disconected:
----If storage <= 0: add an event for removeCombatProtection to 30 seconds and set storage to 1
----If storage == 1: search for target and return may not attack
If player is connected but have the storage protection:
----return may not attack

Tbh I don't think this should be...
Hey all,

I was reading the forum but couldn't find something regarding this matter in topic.

There are some software to reduce lag which offers you "smart exit" with hotkeys CTRL+ SHIFT + Q which disconnects the game and shows you automatically the characters screen, offering you to do a quick relog. This is used very often on hardcore places when players gets trapped by 8 monsters and they use this system in order to "abuse" of the retarget concept when they disconnect.

I was asking to myself (after some years out of the OTs) if this - stop attacking on disconnect for a while depending on each vocation - was applied too on TFS or any other distro?

Also wondering another topic about "retarget" it self, cause CipSoft about a year ago implemented a system where monsters are retargeting a lot more rather than before, this can be seem a lot on Medusa, Grim Reapers, Hydras, and a few others so people now a days to keep hunting in party they might use some field-bombs. The question here is if this - higher retarget chance - has been updated on TFS or any other distro?

I went to check TFS github codes and saw this on Medusa:
Code:
<targetchange interval="4000" chance="20" />

As far as I can tell this is not well, since it has a chance higher, base on my experience on CipSoft the last months playing.

Thanks.
Smart Exit: Not on main branch but you can get the code here:
https://github.com/orts/server/blob/master/data/events/scripts/creature.lua#L9-L64
Plus some code in login.lua:
https://github.com/orts/server/blob/master/data/creaturescripts/scripts/others/login.lua#L33-L46
https://github.com/orts/server/blob/master/data/creaturescripts/scripts/others/login.lua#L86-L89

Retarget: Idk.
 

Thanks bro.

But I got a question. How do this work, on each attack that the monster do on every time they target some one till next retarget?
 
Thanks bro.

But I got a question. How do this work, on each attack that the monster do on every time they target some one till next retarget?
I really don't know as I have not tested but this will prevent players from taking damage at all from monsters while disconected (I don't think it's like global tho as I remember that monster's wave do damage on disconected people even when they exit).

By reading the code, what I can get is:

If player is disconected:
----If storage <= 0: add an event for removeCombatProtection to 30 seconds and set storage to 1
----If storage == 1: search for target and return may not attack
If player is connected but have the storage protection:
----return may not attack

Tbh I don't think this should be done in Lua as Creature: onTargetCombat(target) is not the correct function to do it as it is called every time a combat between the creature and the target is executed. (Spells, meele hits, etc..)

Should probably be done on C++ monster's think function, removing disconnected players from target list and an event to add it back or whatever but the monsters should be able to damage the disconnected players.
 
Last edited:
Solution
The script is not working well...

When you are disconnected the monsters stays around you and doesn't attack.

Monsters should keep moving in order to let you connect and have some space to move.

Any ideas on how to fix this?
 
Back
Top