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 07-24-2011, 06:13 PM
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
Gani editing

PHP Code:
SPRITE    0          era_waterballoon1.png    0    0   32   32 shadow
SPRITE  200          era_waterballoon1
.png    0    0   32   32 arrow up
SPRITE  201          era_waterballoon1
.png    0    0   32   32 arrow right
SPRITE  202          era_waterballoon1
.png    0    0   32   32 arrow down
SPRITE  203          era_waterballoon1
.png    0    0   32   32 arrow left 
If I wanted to change the sprite index 200 to another image in say 3 seconds, how would I do that?

I've tried this: (doesn't work)

PHP Code:
SCRIPT
function onPlayerEnters() {
  
findimg(200).image = "block.png";
}
SCRIPTEND 
Thanks
__________________
Reply With Quote
  #2  
Old 07-24-2011, 06:19 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Is there a reason why you can't just animate it to change after 3 seconds?

You could try using a parameter like how gralats.gani is setup.
Attached Files
File Type: gani gralats.gani (450 Bytes, 179 views)
__________________
Quote:
Reply With Quote
  #3  
Old 07-24-2011, 07:14 PM
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
Yes - because its just an ani that spins- but I need it to change image. Gralats wouldn't help in this case :[
__________________
Reply With Quote
  #4  
Old 07-24-2011, 07:25 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Quote:
Originally Posted by xAndrewx View Post
Yes - because its just an ani that spins- but I need it to change image. Gralats wouldn't help in this case :[
Damn, that's a first
__________________
Reply With Quote
  #5  
Old 07-24-2011, 09:36 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Um, it should work fine using
PHP Code:
SCRIPT
function onPlayerEnters() {
  
sleep(3);
  
findimg(200).image = "newimage.png";
}
SCRIPTEND 
Very rarely I come across a situation where I cannot access sprite indexes using findimg(200), but you might need to "enable drawing" on the sprite index by adding something like:
ROTATIONEFFECT 200 1

I've attached a test gani that does what you need, and works fine.
Attached Files
File Type: gani testgani.gani (338 Bytes, 192 views)
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #6  
Old 07-24-2011, 09:49 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I've had issues in the past where I can only modify certain attributes of a sprite via findImage, like alpha and rotation.
__________________
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 01:23 PM.


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