Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-16-2015, 05:17 AM
Alpho Alpho is offline
Registered User
Alpho's Avatar
Join Date: Dec 2011
Location: California, USA
Posts: 80
Alpho will become famous soon enough
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!
Reply With Quote
  #2  
Old 01-16-2015, 05:35 AM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is just really niceMysticalDragon is just really nice
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
Quote:
Originally Posted by Alpho View Post
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.
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote
  #3  
Old 01-16-2015, 05:38 AM
Alpho Alpho is offline
Registered User
Alpho's Avatar
Join Date: Dec 2011
Location: California, USA
Posts: 80
Alpho will become famous soon enough
Quote:
Originally Posted by MysticalDragon View Post
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.
Reply With Quote
  #4  
Old 01-17-2015, 05:41 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Ideally, I think you'll need to edit every ani to include the attribute. (You could script this)
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:06 AM.


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