Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gani editing (https://forums.graalonline.com/forums/showthread.php?t=134263996)

xAndrewx 07-24-2011 06:13 PM

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

fowlplay4 07-24-2011 06:19 PM

1 Attachment(s)
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.

xAndrewx 07-24-2011 07:14 PM

Yes - because its just an ani that spins- but I need it to change image. Gralats wouldn't help in this case :[

Emera 07-24-2011 07:25 PM

Quote:

Originally Posted by xAndrewx (Post 1660158)
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 :cry:

Tigairius 07-24-2011 09:36 PM

1 Attachment(s)
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.

cbk1994 07-24-2011 09:49 PM

I've had issues in the past where I can only modify certain attributes of a sprite via findImage, like alpha and rotation.


All times are GMT +2. The time now is 10:57 AM.

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