Jump to content
  • 0
Sign in to follow this  
erijhon

unitwalk is not working

Question

Hi everybody!

 

I have a doubt. I'm testing a summoner NPC that is meant to summon and send some monsters or clones to an specific cell.

Let me say, first, that I have been searching for a long while about this, and tried all the answers I found, but none of them worked.

Let's see if you can help me, guys.

 

Well, I use this scripting manual to check how commands and functions work.

As far as I know, this is the Hercules official manual, isn't it?

 

Let me show you the examples this manual gives about:

 

A.) Summoning a Poring and saving its GID in an NPC temporary variable (.@mobGID).

 

 

// We'll make a poring which will automatically attack invoking player:.@mobGID = monster "Prontera",150,150,"Poring",PORING,1; // PORING is defined in the mob db and its value is 1002unitattack .@mobGID, getcharid(3); // Attacker GID, attacked GID 

 

 

 

B.) Making the saved GID monster (in .GID NPC variable) walk to an specific cell.

 

 

//Will move/walk the poring we made to the coordinates 150,150unitwalk .GID,150,150;

 

 

 

So, I asumed that using .@mobGID and .GID variables in my script would result the same, as you will figure out now that I'm posting my script:

 

 

prontera,147,173,6    script    Medium    4_F_MOCBOY,{.@GID = monster ("prontera",139,165,"Walking Poring",PORING,1);unitwalk .@GID,165,165;end;}

 

 

 

As I am creating the poring and then telling it the cell it has to go, in the same row, I don't need to use a permanent NPC variable. So I used .@GID NPC temporary variable to store the poring GID and did the same as the manual examples say that is meant to work.

 

Then, I loaded my script, I talked to the "Medium" NPC in Prontera, the "Walking Poring" was summoned, but it was not going to the "x:165 y:165" specified in the script.

 

Why? Is there something missing?

I thought that maybe the time between the "Walking Poring" is summoned and the "unitwalk" command is called was very short so I also tried the following code:

 

 

prontera,147,173,6    script    Medium    4_F_MOCBOY,{.@GID = monster ("prontera",139,165,"Walking Poring",PORING,1);sleep 5000;unitwalk .@GID,165,165;end;}

 

 

 

Nothing changed.

Does anybody know how to fix this?

 

Thank you very much for your help in advance!!

Edited by erijhon

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Ok... I found it out by myself...

 

There's a MAX range of cells that if you go over it, the script will fail.

Also, you can't go over obstacles or walls, even if they are in sight.

 

I tried this and the poring walks a perfect square:

 

 

 

prontera,147,173,6    script    Medium    4_F_MOCBOY,{.@GID = monster ("prontera",148,172,"Walking Poring",PORING,1);unitwalk .@GID,158,172;sleep 4000;unitstop .@GID;sleep 1000;unitwalk .@GID,158,182;sleep 4000;unitstop .@GID;sleep 1000;unitwalk .@GID,148,182;sleep 4000;unitstop .@GID;sleep 1000;unitwalk .@GID,148,172;end;

 

 

 

Thanks anyways for your attention, the ones who read this.

Edited by erijhon

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
Answer this question...

×   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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.