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 10-30-2005, 05:02 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Trouble with script

can't get this to work, should warp player, set attributes, and gender
NPC Code:
// Graal2002 NPC by Excaliber
if(actionserverside){
if(strequals(#p(0),warp)){
setlevel2 begin_darkrival2.nw,31,31;
}
}
if (mousedown && leftmousebutton && mousex>x-.1 && mousex<x+2 && mousey>y-.1&&mousey<y+3){
setgender male;
sethead head.png;
setbody body.png;
enabledefmovement;
setlevel2 begin_darkrival2.nw,31,31;
hideplayer .05;
}
//#CLIENTSIDE
if (mousedown && leftmousebutton && mousex>x-.1 && mousex<x+2 && mousey>y-.1&&mousey<y+3){
setgender male;
sethead head.png;
setbody body.png;
enabledefmovement;
hideplayer .05;
triggeraction playerx,playery,serverside,warp;
}
if (created) {
showcharacter;
setcharprop #3,head0.png;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #n,Male;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
}

Reply With Quote
  #2  
Old 10-30-2005, 05:12 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Use 'actionleftmouse' in the serverside. This is called when the player left clicks the NPC.
The only part you need in the clientside is the showcharacter stuff.
Reply With Quote
  #3  
Old 10-30-2005, 05:22 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Also, please stop mixing conditional checks and events in single if () statements.
__________________
Skyld
Reply With Quote
  #4  
Old 10-30-2005, 05:36 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
so this is all i need?
NPC Code:
if (actionleftmouse && mousex>x-.1 && mousex<x+2 && mousey>y-.1&&mousey<y+3){
setgender male;
sethead head.png;
setbody body.png;
enabledefmovement;
hideplayer .05;
setlevel2 begin_darkrival2.nw,31,31;

}


because that didn't work X_X
Reply With Quote
  #5  
Old 10-30-2005, 05:37 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
actionleftmouse is called when you click on the NPC.
Reply With Quote
  #6  
Old 10-30-2005, 05:41 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
still doesn't work
Reply With Quote
  #7  
Old 10-30-2005, 05:45 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
I'm a good little Yenny-poo, yes I am..
Nothing to see here, just move along..
Reply With Quote
  #8  
Old 10-30-2005, 05:54 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
thats exactly what i had....not that you showed anything
Reply With Quote
  #9  
Old 10-30-2005, 06:13 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
stop using leftmousebutton with mousedown...mousedown carries a #p(0) along with it to show which mouse is being pressed.
__________________
Reply With Quote
  #10  
Old 10-30-2005, 06:16 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
oh thanks.
however, this did not help
Reply With Quote
  #11  
Old 10-30-2005, 06:39 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Then stop depending so much on people to do the work for you, and do some thinking of your own too.
__________________
Skyld
Reply With Quote
  #12  
Old 10-30-2005, 06:56 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Quote:
Originally Posted by Skyld
Then stop depending so much on people to do the work for you, and do some thinking of your own too.
i made the script in the first place, and it works perfectly offline, however online it does not work
Reply With Quote
  #13  
Old 10-30-2005, 07:00 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by excaliber7388
i made the script in the first place, and it works perfectly offline, however online it does not work
That is no reason not do some thinking of your own...?
__________________
Skyld
Reply With Quote
  #14  
Old 10-30-2005, 07:04 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
i don't know whats wrong, from everything i know, this script should work...i'm guessing you know why it doesn't?
Reply With Quote
  #15  
Old 10-30-2005, 08:48 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by excaliber7388
i don't know whats wrong, from everything i know, this script should work...i'm guessing you know why it doesn't?
yes...you're using it wrong
__________________
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:18 PM.


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