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 08-21-2002, 10:47 AM
Thript Thript is offline
Registered User
Join Date: Aug 2002
Location: Rimbey, Alberta
Posts: 457
Thript is on a distinguished road
Send a message via ICQ to Thript Send a message via AIM to Thript Send a message via Yahoo to Thript
Clicking the player?

I looked throught the newfeatures.txt and searched this board and saw nothing of the sort explaining or even hinting at how you would detect if the player was clicked. Now am I just using

NPC Code:
if (actionleftmouse) {



without the proper comands or is there actuly a comand for it?
__________________

Evolved Studios:
E-mail | Website
Reply With Quote
  #2  
Old 08-21-2002, 11:11 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
i'm not too sure.

I've only seen/used the mouseover commands for players.
Reply With Quote
  #3  
Old 08-21-2002, 11:46 AM
Thript Thript is offline
Registered User
Join Date: Aug 2002
Location: Rimbey, Alberta
Posts: 457
Thript is on a distinguished road
Send a message via ICQ to Thript Send a message via AIM to Thript Send a message via Yahoo to Thript
Darn, I really need it for my buffing/de-buffing system >.<
__________________

Evolved Studios:
E-mail | Website
Reply With Quote
  #4  
Old 08-21-2002, 12:25 PM
Thript Thript is offline
Registered User
Join Date: Aug 2002
Location: Rimbey, Alberta
Posts: 457
Thript is on a distinguished road
Send a message via ICQ to Thript Send a message via AIM to Thript Send a message via Yahoo to Thript
So it would be like

NPC Code:
if (actionleftmouse) {
testplayer stuff;
mousex;
mousey;
}



right?
__________________

Evolved Studios:
E-mail | Website
Reply With Quote
  #5  
Old 08-21-2002, 12:31 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Quote:
actionleftmouse - the player has clicked on the npc
I got that from newfeatures2002.txt.
__________________
[signature]insert here[/signature]
Reply With Quote
  #6  
Old 08-21-2002, 12:32 PM
Thript Thript is offline
Registered User
Join Date: Aug 2002
Location: Rimbey, Alberta
Posts: 457
Thript is on a distinguished road
Send a message via ICQ to Thript Send a message via AIM to Thript Send a message via Yahoo to Thript
I already new that =P.
__________________

Evolved Studios:
E-mail | Website
Reply With Quote
  #7  
Old 08-22-2002, 12:12 AM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
You not really need to use testplayer.. just if you wanna something in special.. but to work with hearts, swordpower..etc.... you can use the map info, so there is no lag.. i.e.

NPC Code:

//#CLIENTSIDE
if(mousedown){
for(this.a=0;this.a<playerscount;this.a++){
if(mousex in |players[this.a].x-2,players[this.a].x+2| && mousey in |players[this.a].y-2,players[this.a].y+2|){
if(players[this.a].hearts>0){say2 A player;}else {say2 A npc;}
}
}
}


Reply With Quote
  #8  
Old 08-22-2002, 01:14 AM
Thript Thript is offline
Registered User
Join Date: Aug 2002
Location: Rimbey, Alberta
Posts: 457
Thript is on a distinguished road
Send a message via ICQ to Thript Send a message via AIM to Thript Send a message via Yahoo to Thript
I have it done and got it figured out thanks to Screen_Name :].
__________________

Evolved Studios:
E-mail | Website
Reply With Quote
  #9  
Old 08-22-2002, 10:30 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Quote:
Originally posted by Thript
I have it done and got it figured out thanks to Screen_Name :].
*evil laugh inserted here*
__________________
[signature]insert here[/signature]
Reply With Quote
  #10  
Old 08-23-2002, 02:09 AM
Thript Thript is offline
Registered User
Join Date: Aug 2002
Location: Rimbey, Alberta
Posts: 457
Thript is on a distinguished road
Send a message via ICQ to Thript Send a message via AIM to Thript Send a message via Yahoo to Thript
Lol omg...
__________________

Evolved Studios:
E-mail | Website
Reply With Quote
  #11  
Old 08-24-2002, 12:02 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
He he. I always do something like this:
NPC Code:

for (i=0;i<playerscount;i++)
{ if (abs(mousex-players[i].x-1.25)=<1 && abs(mousey-players[i].y-.5)=<1)
{ actions;}
}


that way it checks to see where the mouse is at, and you can customize the distance you want it for. Of course you would have to do an if (created) timeout=0.5; (I would use 0.5 in this case b/c it is still faster than the player notices, but isn't as laggy as 0.1!) and then put that 'for' in the timeout and have it loop.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice

Last edited by emortylone; 08-24-2002 at 10:30 PM..
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 01:41 AM.


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