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

Lua Spell that teleport player to target but check interferences in the way

Icaraii

Well-Known Member
Joined
Jan 5, 2020
Messages
469
Solutions
1
Reaction score
58
Hello guys,

I would like a spell that teleports the caster to the target. When casted, the poff effect (effect number 3) will appear where the player was and another effect (effect number 1) will appear at the target when the player get to it. Also I would like the spell to check interferences in the way to the target, if has interferences, player will stop at the interference. Max distance of teleport is 5 sqm.
 
Also I would like the spell to check interferences in the way to the target, if has interferences, player will stop at the interference.
This is extremely difficult and time consuming to create.

A straight line is pretty easy, but as soon as you go into a diagonal, everything becomes difficult.
You'd have to create some complex function to find the optimal tile path to the target..
Or you'd have to create a look-up table manually, that goes over every possible position?

Honestly, I'd forget this part of the spell and just use position:isSightClear(positionEx[, sameFloor = true]) to check if the teleport is possible or not.
It's a thousand times easier.
 
This is extremely difficult and time consuming to create.

A straight line is pretty easy, but as soon as you go into a diagonal, everything becomes difficult.
You'd have to create some complex function to find the optimal tile path to the target..
Or you'd have to create a look-up table manually, that goes over every possible position?

Honestly, I'd forget this part of the spell and just use position:isSightClear(positionEx[, sameFloor = true]) to check if the teleport is possible or not.
It's a thousand times easier.
That seems easier. And also my request is not that different from what Leo32 has already done, I will just use his spell instead. But thanks for the explanation.
 
Back
Top