Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Changing z not offsetting shadow (showani()) (https://forums.graalonline.com/forums/showthread.php?t=134261919)

Crow 02-01-2011 07:03 PM

Changing z not offsetting shadow (showani())
 
Shouldn't Graal automatically offset the shadow of a gani when changing around the z? It doesn't seem to do that when using showani(), which poses to be a nasty problem for me, trying to develop a custom projectiles system :( Help's appreciated.

callimuc 02-01-2011 07:57 PM

I see whatīs your problem is. I donīt know how to do it but i think this could help you:
Shoot where you click

there the shadow is also going off the arrow :P

Crow 02-01-2011 08:29 PM

Quote:

Originally Posted by callimuc (Post 1627167)
there the shadow is also going off the arrow :P

That's because shoot() is being used. I want to avoid using the default projectile system, though.

fowlplay4 02-01-2011 08:46 PM

Well an obvious hack would be just to remove the shadow from the gani and draw another shadow but I figure you want to avoid that.

Shot in the dark.. pass the z value as a parameter and set it in the gani script:

PHP Code:

SCRIPT
function onPlayerEnters() {
  
this.params[0];
}
SCRIPTEND 


Crow 02-01-2011 08:50 PM

Quote:

Originally Posted by fowlplay4 (Post 1627182)
Well an obvious hack would be just to remove the shadow from the gani and draw another shadow but I figure you want to avoid that.

Shot in the dark.. pass the z value as a parameter and set it in the gani script:

PHP Code:

SCRIPT
function onPlayerEnters() {
  
this.params[0];
}
SCRIPTEND 


Dammit, I seriously wanted to avoid **** like that :/ I'll give it a try, but this is one of the most annoying workarounds I've seen so far. I hope some genius will come up with something more elegant. Thanks, though.

fowlplay4 02-02-2011 12:00 AM

Quote:

Originally Posted by Crow (Post 1627185)
Dammit, I seriously wanted to avoid **** like that :/ I'll give it a try, but this is one of the most annoying workarounds I've seen so far. I hope some genius will come up with something more elegant. Thanks, though.

Tested my work-around and nothing happened (at least not with my idle_test gani) so the best plan of action until this bug was fixed (or image property that needs to be added) would be to just draw a shadow at 0 z.

Crow 02-02-2011 06:15 PM

Quote:

Originally Posted by fowlplay4 (Post 1627252)
Tested my work-around and nothing happened (at least not with my idle_test gani) so the best plan of action until this bug was fixed (or image property that needs to be added) would be to just draw a shadow at 0 z.

I thought about drawing an extra shadow at work today. After thoroughly thinking about it, it really doesn't seem that bad. Suppose I'll just do that. Thanks for your help.

fowlplay4 02-02-2011 06:33 PM

Quote:

Originally Posted by Crow (Post 1627386)
I thought about drawing an extra shadow at work today. After thoroughly thinking about it, it really doesn't seem that bad. Suppose I'll just do that. Thanks for your help.

Well considering how many potential projectiles will be flying around an additional shadow being drawn probably won't add any noticeable FPS loss to PCs.

Can always do something like this with no headache.

PHP Code:

function drawProjectiles() {
  
temp.ind 200;
  for (
temp.projectilethis.projectiles) {
    
temp.ind drawProjectile(temp.indyaddayadda);
  }
}

function 
drawProjectile(indpanitxtytz) {
  
showani2(indtxtytz2pani);
  
showimg(ind 1"shadow.png"txty);
  return 
ind+2;


People can and have done far worse.

Crow 02-02-2011 06:38 PM

Quote:

Originally Posted by fowlplay4 (Post 1627390)
Well considering how many potential projectiles will be flying around an additional shadow being drawn probably won't add any noticeable FPS loss to PCs.

My thought exactly ^^

DustyPorViva 02-02-2011 07:10 PM

Just delete the shadow from the gani and showimg one in the ganiscript of it, if you're going to go that route? The position of the shadow is static in relation to the gani, so you shouldn't need to run a loop or anything.

Crow 02-02-2011 07:43 PM

Quote:

Originally Posted by DustyPorViva (Post 1627396)
Just delete the shadow from the gani and showimg one in the ganiscript of it, if you're going to go that route? The position of the shadow is static in relation to the gani, so you shouldn't need to run a loop or anything.

Using a showimg in my code instead of in the gani seems like an overall better idea, though.

ffcmike 02-03-2011 02:05 AM

Unlikely but is the shadow within your gani definitely index 0?
I believe it has to be in order for it to be offset when changing z.

fowlplay4 02-03-2011 02:16 AM

Quote:

Originally Posted by ffcmike (Post 1627473)
Unlikely but is the shadow within your gani definitely index 0?
I believe it has to be in order for it to be offset when changing z.

It doesn't. :(

I figure it has something to do with Players + NPCs rendering the gani differently than a normal showani/showimg/findimg.

ffcmike 02-03-2011 02:19 AM

Quote:

Originally Posted by fowlplay4 (Post 1627475)
It doesn't. :(

I figure it has something to do with Players + NPCs rendering the gani differently than a normal showani/showimg/findimg.

That may well be the problem in this case, but atleast with players and npcs I'm pretty sure whatever part of the gani is index 0 will be offset.

Crow 02-03-2011 05:38 PM

I made sure everything was correct; tried using the "idle" gani to be completely sure about it, too. So that's definitely an issue with showani/showimg.


All times are GMT +2. The time now is 08:26 PM.

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