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 02-01-2011, 07:03 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
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.
__________________
Reply With Quote
  #2  
Old 02-01-2011, 07:57 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
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
Reply With Quote
  #3  
Old 02-01-2011, 08:29 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by callimuc View Post
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.
__________________
Reply With Quote
  #4  
Old 02-01-2011, 08:46 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
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 
__________________
Quote:
Reply With Quote
  #5  
Old 02-01-2011, 08:50 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by fowlplay4 View Post
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.
__________________
Reply With Quote
  #6  
Old 02-02-2011, 12:00 AM
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
Quote:
Originally Posted by Crow View Post
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.
__________________
Quote:

Last edited by fowlplay4; 02-02-2011 at 12:31 AM..
Reply With Quote
  #7  
Old 02-02-2011, 06:15 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by fowlplay4 View Post
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.
__________________
Reply With Quote
  #8  
Old 02-02-2011, 06:33 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
Quote:
Originally Posted by Crow View Post
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.
__________________
Quote:
Reply With Quote
  #9  
Old 02-02-2011, 06:38 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by fowlplay4 View Post
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
__________________
Reply With Quote
  #10  
Old 02-02-2011, 07:10 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
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.
Reply With Quote
  #11  
Old 02-02-2011, 07:43 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by DustyPorViva View Post
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.
__________________
Reply With Quote
  #12  
Old 02-03-2011, 02:05 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
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.
Reply With Quote
  #13  
Old 02-03-2011, 02:16 AM
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
Quote:
Originally Posted by ffcmike View Post
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.
__________________
Quote:
Reply With Quote
  #14  
Old 02-03-2011, 02:19 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by fowlplay4 View Post
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.
Reply With Quote
  #15  
Old 02-03-2011, 05:38 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
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.
__________________
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 12:19 AM.


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