Jump to content
gainster81

Teleport skill

Recommended Posts

Hey,

 

I was trying to make a new skill in which you can teleport on the clicked area within a  short range. I used the Mytho teleportation skill (id 296) as a guide. I setted it up but the skill isn't working (the animation happens but my char isn't teleporting to the selected area. Am i missing something in the skilleffect function?

 

function Skill_tptp_End ( ATKER , DEFER , sklv ) 
	local map_name = GetChaMapName (ATKER)
	local x = math.floor (x/100)
	local y = math.floor (y/100)
	GoTo(ATKER, x,y, map_name)
 end

 

Share this post


Link to post
Share on other sites
3 hours ago, gainster81 said:

Hey,

 

I was trying to make a new skill in which you can teleport on the clicked area within a  short range. I used the Mytho teleportation skill (id 296) as a guide. I setted it up but the skill isn't working (the animation happens but my char isn't teleporting to the selected area. Am i missing something in the skilleffect function?

 


function Skill_tptp_End ( ATKER , DEFER , sklv ) 
	local map_name = GetChaMapName (ATKER)
	local x = math.floor (x/100)
	local y = math.floor (y/100)
	GoTo(ATKER, x,y, map_name)
 end

 

in your skill x, y not defined 
x/100 ? 
you have to use
 

local x, y = GetChaPos(ATKER)

 

Edited by mkhzaleh

Share this post


Link to post
Share on other sites
5 hours ago, mkhzaleh said:

in your skill x, y not defined 
x/100 ? 
you have to use
 


local x, y = GetChaPos(ATKER)

 

Added "local x, y = GetChaPos(ATKER)" but it still didn't work. Also tried removing the /100 lines but it also didn't work. Any other thing i may be missing?

Share this post


Link to post
Share on other sites
10 hours ago, mkhzaleh said:

	local x, y = GetChaPos(role)

	GoTo(role,x/100,y/100,GetChaMapName(role))

works fine

hmm it isn't working. Do you have the skillinfo line that you are using? Perhaps i need to edit that one.

Share this post


Link to post
Share on other sites
17 hours ago, gainster81 said:

hmm it isn't working. Do you have the skillinfo line that you are using? Perhaps i need to edit that one.

no, i just told you how to use the function,

Edited by mkhzaleh

Share this post


Link to post
Share on other sites

Hello @gainster81!

 

As @mkhzaleh mentioned, variables 'x' and 'y' are undefined. You can get these coordinates using GetChaPos() function, but I think it has no sense, your character will teleport to itself, i.e. on the same position. I suggest use skill like Voayger's 'Conch Ray' as a template. As I remember, there is a function that allow to get coordinates clicked on the terrain by the player.

 

 


Share this post


Link to post
Share on other sites
	local x, y = GetChaPos(DEFER)
	local map_name = GetChaMapName (DEFER)
	local x = math.floor (x/100)
	local y = math.floor (y/100)
	GoTo(ATKER, x,y, map_name)

just get it from defer 

Share this post


Link to post
Share on other sites
On 9/27/2021 at 9:28 AM, V3ct0r said:

Hello @gainster81!

 

As @mkhzaleh mentioned, variables 'x' and 'y' are undefined. You can get these coordinates using GetChaPos() function, but I think it has no sense, your character will teleport to itself, i.e. on the same position. I suggest use skill like Voayger's 'Conch Ray' as a template. As I remember, there is a function that allow to get coordinates clicked on the terrain by the player.

 

 

Hi @V3ct0r! Sorry for reviving this thread again. I gave up before but now i am trying to set this up again. Do you remember which is the function that allows to get the coordinates from the clicked terrain?

Also, i tried again what @mkhzaleh said but added it in the conch ray script and seems to work (only when it hits a target).

Now that it worked, i am wondering if its possible to remove the camera realocation and message that pops out when "GoTo" activates:
 

fdb87326a50d904588dfc860894c48db.gif

Edited by gainster81

Share this post


Link to post
Share on other sites

Hello @gainster81!

 

On 7/12/2022 at 3:01 AM, gainster81 said:

Hi @V3ct0r! Sorry for reviving this thread again. I gave up before but now i am trying to set this up again. Do you remember which is the function that allows to get the coordinates from the clicked terrain?

It is ok. Have you found the name of the function? Can you share the code with us?

 

On 7/12/2022 at 3:01 AM, gainster81 said:

Now that it worked, i am wondering if its possible to remove the camera realocation and message that pops out when "GoTo" activates:

Are you working with official client binaries or source codes? I think you shouldn't remove the camera relocation since the character is always located in the center of the screen (scene). 


Share this post


Link to post
Share on other sites
12 hours ago, V3ct0r said:

It is ok. Have you found the name of the function? Can you share the code with us?

Hey @V3ct0r! The code i am currently using is the following:

 

local x, y = GetSkillPos ( ATKER )
local map_name = GetChaMapName ( ATKER )
local x = math.floor (x/100)
local y = math.floor (y/100)
GoTo(ATKER, x,y, map_name)

It also works with GetChaPos but in that case you get teleported into the enemy player instead of the clicked area. A new issue that i am having is that the skill must pass through an enemy in order to work. This means that if i select an area and no enemies are inside the zone, the teleport wont work, as if there was a condition preventing from the ending function to happen if it doesn't hit something.

In the gif example below it works only because there is a shrub inside the area:

1a3565a7f2322626626cec0cbeb6c9dc.gif

12 hours ago, V3ct0r said:

Are you working with official client binaries or source codes? I think you shouldn't remove the camera relocation since the character is always located in the center of the screen (scene). 

Only edited client binaries for now, but i have the src as well. By realocating i mean preventing the camera to "zoom out" like in the gif i just showed that the camera goes up again and it rotates back to its standard position. Is there any way of doing that and also deleting the "level 79" text that appears?

Edited by gainster81

Share this post


Link to post
Share on other sites

For the “level 79” text, you’d have to edit the sources since that’s coded in there every time you relocate using GoTo (or any other move function?). 

Share this post


Link to post
Share on other sites
On 7/22/2022 at 9:07 AM, gainster81 said:

Hey @V3ct0r! The code i am currently using is the following:

 


local x, y = GetSkillPos ( ATKER )
local map_name = GetChaMapName ( ATKER )
local x = math.floor (x/100)
local y = math.floor (y/100)
GoTo(ATKER, x,y, map_name)

It also works with GetChaPos but in that case you get teleported into the enemy player instead of the clicked area. A new issue that i am having is that the skill must pass through an enemy in order to work. This means that if i select an area and no enemies are inside the zone, the teleport wont work, as if there was a condition preventing from the ending function to happen if it doesn't hit something.

In the gif example below it works only because there is a shrub inside the area:

1a3565a7f2322626626cec0cbeb6c9dc.gif

Only edited client binaries for now, but i have the src as well. By realocating i mean preventing the camera to "zoom out" like in the gif i just showed that the camera goes up again and it rotates back to its standard position. Is there any way of doing that and also deleting the "level 79" text that appears?

Maybe try to change the skill type in skillinfo to a neutral skill so it would call the skill function despite having no enemies in the selected area 

  • Thanks 1

Share this post


Link to post
Share on other sites
23 minutes ago, Saeed said:

Maybe try to change the skill type in skillinfo to a neutral skill so it would call the skill function despite having no enemies in the selected area 

It worked! i was changing the skill type column but it was the "process target" column that i had to set to 1. Thanks!

Share this post


Link to post
Share on other sites
Just now, gainster81 said:

It worked! i was changing the skill type column but it was the "process target" column that i had to set to 1. Thanks!

Your welcome :D

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...