Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Player Position (https://forums.graalonline.com/forums/showthread.php?t=83334)

[email protected] 12-25-2008 07:38 AM

Player Position
 
I am use showani to display an ani. It works fine on an single level but, when i go on to the gmap it does not stay with the player. I am check position with player.x, and player.y . Any Ideas?

Tigairius 12-25-2008 09:17 AM

In the future it's best if you show the script you're using that's giving you a problem, but here is my advice:

PHP Code:

showani(indexplayer.getmapx(player.level.name) * 64player.getmapy(player.level.name) * 64player.dir"aniname"); 


[email protected] 12-26-2008 07:33 AM

Ok i tried what you gave to me but theres a problem, it works on the first level of the gmap but after, you leave that level to another on the gmap the ani doesnt appears no more.

PHP Code:

//#CLIENTSIDE
function onTimeOut()
{
  if ( 
client.infected.speed )
  {
    if ( 
client.mud.punching ) return;
     if ( 
client.casting ) return;
      for(
temp.04++)
      {
        if (
keydown(i))
        {
          if (!
canmove(i) && !player.ani.starts("sword"))
          {
            
player.+= vecx(i)* 0.5;
            
player.+= vecy(i)* 0.5;
          }
        }
      }
   
showTrail();
  }else
   
hideimgs200 206 );  

  if ( 
client.infected.heal )
  {
   
showani(1player.getmapx(player.level.name) * 64player.getmapy(player.level.name) * 64player.dir"zeek_effect_heal"); 
   
changeimgvis(1,3);
  }else
   
hideimg(1);
}   


setTimer(0.005); 


Tigairius 12-26-2008 07:37 AM

May need to do some better order of operations, I'm not entirely sure.
PHP Code:

showani(1player.+ (getmapx(player.level.name) * 64), player.+ (getmapy(player.level.name) * 64), player.dir"zeek_effect_heal"); 

See if that works for you.

[email protected] 12-26-2008 07:56 AM

hmm its still the same, wonder whats the problem.

Chompy 12-26-2008 11:34 AM

tried something like

PHP Code:

showani(1player.x%64player.y%64player.dir"zeek_effect_heal"); 

?


Or you could take a look at player.attr[1-30] and use those to show effects (Just assign a gani to one of the attr's like.. player.attr[20] = "zeek_effect_heal.gani";)

xXziroXx 12-26-2008 01:32 PM

Chompy's position%64 should work.

Codein 12-26-2008 01:38 PM

You also have the timeout outside of the timeout event block. More over, a timeout can't be smaller than 0.05, I believe. Yours is 0.005. I doubt this is actually the problem but it's worth fixing and remembering for the future.

xXziroXx 12-26-2008 01:54 PM

Quote:

Originally Posted by Codein (Post 1452482)
You also have the timeout outside of the timeout event block. More over, a timeout can't be smaller than 0.05, I believe. Yours is 0.005. I doubt this is actually the problem but it's worth fixing and remembering for the future.

The smallest might be 0.05 on clientside, but on serverside it's 0.1.

Tigairius 12-26-2008 07:20 PM

Ah yeah, I think mine would have worked better for a serverside situation :P

xXziroXx 12-26-2008 07:29 PM

Quote:

Originally Posted by Tigairius (Post 1452571)
Ah yeah, I think mine would have worked better for a serverside situation :P

You could have just used player.x, player.y for that though :p

[email protected] 12-27-2008 01:07 AM

hmm, Its still not working

Codein 12-27-2008 11:28 AM

Post the script you're currently using at the moment, please.


All times are GMT +2. The time now is 11:37 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.