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-14-2011, 06:17 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
Quote:
Originally Posted by Crow View Post
Yup, I'd say they can. Same thing happened to me, basically. Using different shapes will change the actual shape, but in a strange way that still seems inaccurate. I have no idea why.
Dunno what you're talking about... I've never had a problem using showcharacter + setshape. It sets the shape of the NPC using the blocking specifications of a player(x+.5,y+1). That's where the blocking starts, instead of the normal 0,0. This allows you to easily create blocking NPC's that also draw a portion of the player(like a tree) simply by aligning it correctly in the gani. This is the same method that 2k2 uses on most of their trees and houses.
Reply With Quote
  #2  
Old 02-14-2011, 06:22 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
Dunno what you're talking about... I've never had a problem using showcharacter + setshape. It sets the shape of the NPC using the blocking specifications of a player(x+.5,y+1). That's where the blocking starts, instead of the normal 0,0. This allows you to easily create blocking NPC's that also draw a portion of the player(like a tree) simply by aligning it correctly in the gani. This is the same method that 2k2 uses on most of their trees and houses.
It works well when you just need **** that blocks, yes. I'm more concerned about the "hitboxes" for the PlayerTouchsMe event when using showcharacter and ganis, because these seem to be friggin strange in every possible aspect.
Reply With Quote
  #3  
Old 02-14-2011, 06:41 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by Crow View Post
It works well when you just need **** that blocks, yes. I'm more concerned about the "hitboxes" for the PlayerTouchsMe event when using showcharacter and ganis, because these seem to be friggin strange in every possible aspect.
You're friggin strange in every possible aspect
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #4  
Old 02-14-2011, 07:41 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 Fulg0reSama View Post
You're friggin strange in every possible aspect
Duh.
Reply With Quote
  #5  
Old 02-15-2011, 12:29 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
showcharacter() and all of that other stuff didn't fix it. The only solution that appears to have worked is Crow's suggestion to show it as an image. For some reason, I guess the ganis refuse to have their shapes altered. Although there doesn't seem to be any good reason on why they should act that way.
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #6  
Old 02-15-2011, 12:43 AM
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
Quote:
Originally Posted by Jiroxys7 View Post
showcharacter() and all of that other stuff didn't fix it. The only solution that appears to have worked is Crow's suggestion to show it as an image. For some reason, I guess the ganis refuse to have their shapes altered. Although there doesn't seem to be any good reason on why they should act that way.
You'd get more help if you posted the script. It's hard to help people when you have to take a shot in the dark and guess what the problem could possibly be, if it could even possibly exist. Scripting can be complex, so there's a multitude of things that can be causing problems.
Reply With Quote
  #7  
Old 02-15-2011, 12:53 AM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Make sure you position the sprite correctly in the gani. If it's not on the 0,0 spot, then you'll have the problem you're describing.
__________________
Reply With Quote
  #8  
Old 02-15-2011, 01:13 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by DustyPorViva View Post
You'd get more help if you posted the script. It's hard to help people when you have to take a shot in the dark and guess what the problem could possibly be, if it could even possibly exist. Scripting can be complex, so there's a multitude of things that can be causing problems.
PHP Code:
function onCreated() {
  
//showcharacter();
  
setgani();
  
scheduleevent(20,"Destroy",NULL);
  
this.dontblock();
  
setshape(1,2,32);
}

function 
setgani(){
  if(
this.amount<=-1temp.type 10;      //(Black)
  
elseif(this.amount==1temp.type 1;    //(Green) 
  
elseif(this.amount<=5temp.type 2;    //(Blue)
  
elseif(this.amount<=10temp.type 3;   //(Yellow)
  
elseif(this.amount<=20temp.type 4;   //(Red)
  
elseif(this.amount<=50temp.type 5;   //(Purple)
  
elseif(this.amount<=100temp.type 6;  //(Orange)
  
elseif(this.amount<=200temp.type 7;  //(Silver)
  
elseif(this.amount<=300temp.type 8;  //(Gold)
  
elseif(this.amount<=500temp.type 9;  //(Crystal)
  
setcharani("j7_rupees"temp.type);
}

function 
onDestroy(){
  
this.destroy();
}


function 
onPlayertouchsme(){
    if(
player.>= this.0.5 && player.<= this.0.5){
      if(
player.rupees == clientr.walletsize){player.chat "I cannot hold any more!"; return;}
      if(
this.aniparams != 10){
        
player.rupees += this.amount;
        
player.chat "I got" SPC this.amount "g!";
        
this.amount 0;
        
this.destroy();
      }
      else{
      
player.chat "Oh, no! I dropped" SPC abs(this.amountSPC "g!";
      
this.destroy();
    }
  }
}

//#CLIENTSIDE
function onCreated(){
  
setshape(1,16,32);
  
this.canplay 1;
  
play("item.wav");
  
setTimer(15);
}
function 
onPlayertouchsme(){
  if(
player.>= this.0.5 && player.<= this.0.5){
    if(
player.rupees == clientr.walletsize){return;}
    if(
this.canplay 1){
      
this.canplay 0;
      
play("extra.wav");
      
this.alpha 0;
    }
  }
}

function 
onTimeout(){
  if(
this.canplay == 1){  
    if(
this.alphaswitch == 0){this.alpha 1;this.alphaswitch 1;}
    elseif(
this.alphaswitch == 1){this.alpha 0;this.alphaswitch 0;}
    
setTimer(0.05);
  }

when I use showcharacter() on it, the box will be far too large. but if I get rid of it, the smaller box seems to be shifted over to the left.


Quote:
Originally Posted by salesman View Post
Make sure you position the sprite correctly in the gani. If it's not on the 0,0 spot, then you'll have the problem you're describing.
That did the trick!

edit: nevermind!
__________________
MY POSTS ARE PRONE TO EDITS!

Last edited by Jiroxys7; 02-15-2011 at 01:36 AM..
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:33 PM.


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