Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-20-2002, 06:06 PM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
Mouse Script!

// NPC made by KuJi
if (playertouchsme) {toweapons Test;
}
if (actionleftmouse) {
putnpc block.gif,test.txt,mousex,mousey;
}

Y do i have to click the npc and where my x/y where i clicked the npc it lays.
Attached Files
File Type: txt test.txt (103 Bytes, 288 views)
  #2  
Old 09-20-2002, 06:24 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
actionleftmouse is sent whenever the player clicks on the NPC.

You'd have to use the event "mousedown". It is triggered when any button was pressed, no matter where you pressed it.

Your script would have to look like that:

NPC Code:

if (playertouchsme) {
toweapons Test;
}
if (mousedown && leftmousebutton) {
putnpc block.gif,test.txt,mousex,mousey;
}



That should work.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
  #3  
Old 09-21-2002, 02:05 AM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
Thanks
It worked now i just gotta finish working the deleting of them lol
Im gonna see if it will work with what u thought me
  #4  
Old 09-21-2002, 02:08 AM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
Post Thanks a bunch!

Finished yay!
  #5  
Old 09-21-2002, 02:12 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 was fooling around the other day with the mousedown and mousex/y commands.

I'll post what I had here shortly.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
  #6  
Old 09-21-2002, 04:06 AM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Yeh i want to make a script were when u put ur cursur under a npc or player i says somet=)
__________________
V$:CONFL16T
  #7  
Old 09-21-2002, 04:35 AM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
NPC Code:

if (playerenters || timeout) {
if (mousex in |playerx,playerx+3| && mousey in |playery,playery+3|) {message sommet;}
else {message ;}
timeout=0.05;
}

__________________
Knuckles
"They say 60% of the time, it works everytime!"
  #8  
Old 09-21-2002, 04:54 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
NPC Code:

if (mousex in |npcs[i].x,npcs[i].x+imgwidth(#f(i))| && mousey in |npcs[i].y,npcs[i].y+imgheight(#f(i))|) {
message Don't point, it's rude!;
}else{message ;}



Bah, I know this isn't the whole script, but now you get the fun of finishing it! Whoop-diedoo...

[EDIT] *bangs head on wall* forgot img for w/h...
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial

Last edited by Dach; 09-22-2002 at 12:41 AM..
  #9  
Old 09-21-2002, 05:14 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
LOLz. I usually do a timeout and check if abs(mousex-x)=<2 && abs(mousey-y)=<2 something like that so that it checks for the distance
---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
  #10  
Old 09-21-2002, 05:43 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
when you do that this is what happens:
Black - target area of what you want to be clickable
white - areas that are also clickable


Unless for whatever reason your images are centered on their x/y...
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
  #11  
Old 09-21-2002, 05:07 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Thanks knuckles youve helped me alot!
__________________
V$:CONFL16T
  #12  
Old 09-21-2002, 05:23 PM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
Quote:
Originally posted by Dach
NPC Code:

if (mousex in |npcs[i].x,npcs[i].x+width(#f(i))| && mousey in |npcs[i].y,npcs[i].y+height(#f(i))|) {
message Don't point, it's rude!;
}else{message ;}



Bah, I know this isn't the whole script, but now you get the fun of finishing it! Whoop-diedoo...
isnt it imgwidth not width && imgheight not height?
__________________
- R0bin
  #13  
Old 09-21-2002, 09:26 PM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
Quote:
Originally posted by R0b1n-NPC


isnt it imgwidth not width && imgheight not height?
??
  #14  
Old 09-21-2002, 09:35 PM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
was talking to chad
__________________
- R0bin
  #15  
Old 09-22-2002, 12:39 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Crap, yeah that's what I meant to put...
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
  #16  
Old 09-22-2002, 05:09 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
wouldnt it be imgwidth(#f)/16 because img width returns the width in pixels?
__________________
- R0bin
  #17  
Old 09-22-2002, 05:51 AM
BladeSpirit BladeSpirit is offline
Registered User
Join Date: Sep 2002
Location: Over there ->
Posts: 22
BladeSpirit is on a distinguished road
Send a message via AIM to BladeSpirit
Well then it'd be *16 for a tile.

16x16 = tile
1x1 = pixel

pixel * 16 = tile
__________________
If pro is the opposite of con:

Is Pro gress the opposite
of Con gress ?

Pro Stitution
Con Stitution
aim: cl0ud Drakken
  #18  
Old 09-22-2002, 08:44 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Good Grief!! I must've gotten stuck between the 3rd and 4th visibility levels, *bangs on elavator buttons* Gah! me = stuck!!!

Yeah it should be imgwidth(#f(i))/16, unless it's put in above level 4, then it would need mousescreenx and mousescreeny...
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
  #19  
Old 09-22-2002, 09:15 AM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
Did we get off subject lol
  #20  
Old 09-22-2002, 09:21 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
no. completely on topic.
__________________
- R0bin
  #21  
Old 09-22-2002, 07:49 PM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
Will someone help me make a timeout script for 30 seconds?
  #22  
Old 09-22-2002, 07:57 PM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
*slaps*

NPC Code:

NPC Code:


if (created) {
timeout=30;
}

if (timeout) {
message You're a n00b;
}




__________________
- R0bin
  #23  
Old 09-22-2002, 08:49 PM
BladeSpirit BladeSpirit is offline
Registered User
Join Date: Sep 2002
Location: Over there ->
Posts: 22
BladeSpirit is on a distinguished road
Send a message via AIM to BladeSpirit
if (created) {
message Hahaha you don't know how to fix this =P;
}
__________________
If pro is the opposite of con:

Is Pro gress the opposite
of Con gress ?

Pro Stitution
Con Stitution
aim: cl0ud Drakken
  #24  
Old 09-23-2002, 12:40 AM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
EEk i didnt mean that way idiots.
I ment a timeout script thingy so it has to wait 30 seconds b4 i can lay another evil candy i tried timeout it didnt
work.
NPC Code:

// NPC made by KuJi
if (playertouchsme) {
toweapons Ebil Candy;
}
if (weaponfired) {
if (playerdir=0) {
freezeplayer 0.5;
putnpc evilcandyicon.png,test.txt,playerx+0.5,playery-1;
setani human_lay,;
}
if (playerdir=1) {
freezeplayer 0.5;
putnpc evilcandyicon.png,test.txt,playerx-1.5,playery+1;
setani human_lay,;
}
if (playerdir=2) {
freezeplayer 0.5;
putnpc evilcandyicon.png,test.txt,playerx+0.5,playery+2.5 ;
setani human_lay,;
}
if (playerdir=3) {
freezeplayer 0.5;
putnpc evilcandyicon.png,test.txt,playerx+2.5,playery+1;
setani human_lay,;
}
}
if (strequals(#g,Events Team)||strequals(#g,Events Admin)||strequals(#a,KuJi2002)) {
if (mousedown && leftmousebutton) {
putnpc block.gif,test.txt,mousex,mousey;
}
}

  #25  
Old 09-23-2002, 01:43 AM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Heh i dun have the gif
__________________
V$:CONFL16T
  #26  
Old 09-23-2002, 01:49 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Um, first make it not so goofy by using for loops and vecx, vecy, then try sleep. Unless you don't like sleep, then do something else.
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
  #27  
Old 09-23-2002, 05:44 AM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
Change gfx into anything as in block.png
  #28  
Old 09-28-2002, 05:41 AM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
Ebil CANDY!

Heres the script so far
The text file is on attachment.
I still need to add the 30 secs but i dont know how to do it yet
So u can add it if u like.

NPC Code:

// NPC made by KuJi
if (playertouchsme) {
toweapons Ebil Candy;
}
if (weaponfired) {
if (playerdir=0) {
freezeplayer 0.5;
putnpc evilcandyicon.png,test.txt,playerx+0.5,playery-1;
setani human_lay,;
}
if (playerdir=1) {
freezeplayer 0.5;
putnpc evilcandyicon.png,test.txt,playerx-1.5,playery+1;
setani human_lay,;
}
if (playerdir=2) {
freezeplayer 0.5;
putnpc evilcandyicon.png,test.txt,playerx+0.5,playery+2.5 ;
setani human_lay,;
}
if (playerdir=3) {
freezeplayer 0.5;
putnpc evilcandyicon.png,test.txt,playerx+2.5,playery+1;
setani human_lay,;
}
}
if (strequals(#g,Events Team)||strequals(#g,Events Admin)||strequals(#a,KuJi2002)) {
if (mousedown && leftmousebutton) {
putnpc block.gif,test.txt,mousex,mousey;
}
}

  #29  
Old 09-28-2002, 07:46 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
....

WanDaMan how did you get apart from the asteria tile set in your sig?
__________________
maximus_asinus
Closed Thread


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 09:56 AM.


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