Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Sprite Coordinate Question (https://forums.graalonline.com/forums/showthread.php?t=134269801)

Alpho 01-16-2015 05:17 AM

Sprite Coordinate Question
 
Hello!

I'm trying to make a cape system. What is the best way of going about this? I was thinking a script within a gani and setting that as an attr on your player, but then you have the problem where sprites move around (walking gani for example). Is there any way to find the position of a certain sprite? Maybe there's an easier way of going about this?

Thank you!

MysticalDragon 01-16-2015 05:35 AM

Quote:

Originally Posted by Alpho (Post 1734084)
Hello!

I'm trying to make a cape system. What is the best way of going about this? I was thinking a script within a gani and setting that as an attr on your player, but then you have the problem where sprites move around (walking gani for example). Is there any way to find the position of a certain sprite? Maybe there's an easier way of going about this?

Thank you!

Inside a gani you could do;
PHP Code:

SCRIPT
function onPlayerEnters() {
  
with findImg100 ) ) {
    
image player.attr[#];// Image of Cape
    
layer 2;
    
attachToOwner true;
    
attachOffset = { -1, -3};
  }
}
SCRIPTEND 

But from my knowledge there is no way to tell exactly where the sprite location is inside the gani, at least not that i know of. Although there is getspriteforspritepos(obj) - returns object, but i never used it.

Alpho 01-16-2015 05:38 AM

Quote:

Originally Posted by MysticalDragon (Post 1734085)
Inside a gani you could do;
PHP Code:

SCRIPT
function onPlayerEnters() {
  
with findImg100 ) ) {
    
image player.attr[#];// Image of Cape
    
layer 2;
    
attachToOwner true;
    
attachOffset = { -1, -3};
  }
}
SCRIPTEND 


I know, I already had something like that. What my question was is if we can find the position of a certain sprite. For instance, finding the coordinates of the body in all views so that you can position the cape correctly.

xAndrewx 01-17-2015 05:41 AM

Ideally, I think you'll need to edit every ani to include the attribute. (You could script this)


All times are GMT +2. The time now is 01:03 AM.

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