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-15-2010, 07: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
with(findimg(1)) {

HTML Code:
      with (findimg(5)) {
        x = player.x + 5; 
        y = player.y + 5;
        
        this.ani = "idle"
        this.dir = 1;
        this.layer = 1;
        
        this.playerlook = false;
        actor.headimg = playero.headimg;
        actor.bodyimg = playero.bodyimg;
        actor.shield = playero.shieldimg;    
      }
Doesn't seem to show for other players- any idea why o-o
__________________
Reply With Quote
  #2  
Old 07-15-2010, 07:14 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
I don't think you need to prefix the variables with "this."
Reply With Quote
  #3  
Old 07-15-2010, 07:17 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
no fix :[
__________________
Reply With Quote
  #4  
Old 07-15-2010, 07:18 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by DustyPorViva View Post
I don't think you need to prefix the variables with "this."
You don't need to, but I often do it for clarity.
__________________
Reply With Quote
  #5  
Old 07-15-2010, 07:22 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 Inverness View Post
You don't need to, but I often do it for clarity.
Aye, but in this case there is a fair amount of inconsistency.
Reply With Quote
  #6  
Old 07-15-2010, 07:53 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by DustyPorViva View Post
I don't think you need to prefix the variables with "this."
Surely using "this." makes it faster because it does not have to make lookups through the entire scope and then the scope of the with'ed object, and instead only the latter!
Reply With Quote
  #7  
Old 07-15-2010, 08:15 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by Loriel View Post
Surely
This is where you went wrong.
Reply With Quote
  #8  
Old 07-15-2010, 08:40 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
Missing semicolon at this.ani = "idle"...?
__________________
Reply With Quote
  #9  
Old 07-15-2010, 08:45 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
Missing semicolon at this.ani = "idle"...?
lols!
Reply With Quote
  #10  
Old 07-15-2010, 08:51 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
lol no xD

but thanks :[

It has to be the findimg
__________________
Reply With Quote
  #11  
Old 07-15-2010, 09:22 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 never had success with showani (or the GS2 equivalent) showing for other players .
__________________
Reply With Quote
  #12  
Old 07-15-2010, 09:34 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
that makes sense... :[

Must be a graal error?
__________________
Reply With Quote
  #13  
Old 07-15-2010, 09:38 PM
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
How are you showing the image?

I copied your code into a weapon script, and it works fine for me (I have two accounts logged on, and both accounts see the image).

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
setTimer(.05);
}

function 
onTimeout() {
  if (
keydown(0)) {
    
with (findimg(5)) {
      
player.5
      
player.5;
        
      
this.ani "idle";
      
this.dir 1;
      
this.layer 1;
        
      
this.playerlook false;
      
actor.headimg playero.headimg;
      
actor.bodyimg playero.bodyimg;
      
actor.shield playero.shieldimg;    
    }
  } else {
    
hideImg(5);
  }
  
  
setTimer(.05);

Edit: I know that image indexes < 200 will not show for all players in a level or DBNPC...it has to be a weapon.
__________________
Reply With Quote
  #14  
Old 07-15-2010, 09:40 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
In a class =o
__________________
Reply With Quote
  #15  
Old 07-15-2010, 09:44 PM
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
Yeah, that wont work...it needs to be in a weapon for it to show for all players (possibly in a class joined to the player, but I haven't tested that).

I remember when I was making a drawing tool, I tried to get past the 200 index limit by placing npcs every time my image index reached 200 and starting the index back at 1 for that npc. It worked fine on my client, but nobody else could see the images.
__________________
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 05:33 AM.


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