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
  #16  
Old 09-28-2005, 07:27 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by napo_p2p
'toweapons' is bad with an NPC server...
Correct.

Quote:
Having 'isweapon' and 'strequals(#w,Lightning2)' is redundant.
Incorrect. isweapon has nothing to do with the currently selected weapon. It is a deprecated flag which returns true if the script is a weapon script and false if it is not.
Reply With Quote
  #17  
Old 09-28-2005, 05:38 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Lance
Incorrect. isweapon has nothing to do with the currently selected weapon. It is a deprecated flag which returns true if the script is a weapon script and false if it is not.
I meant in the sense that if the weapon is the currently selected weapon, then it obviously is a weapon :P.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.

Last edited by napo_p2p; 09-28-2005 at 05:55 PM..
Reply With Quote
  #18  
Old 09-28-2005, 07:24 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by napo_p2p
I meant in the sense that if the weapon is the currently selected weapon, then it obviously is a weapon :P.
Using the deprecated isweapon flag in a weapon is in and of itself redundant. Whether or not you are checking the currently selected weapon is irrelevant and adds nothing to this statement but misrepresentation.

Last edited by Lance; 09-28-2005 at 08:36 PM.. Reason: clarity
Reply With Quote
  #19  
Old 09-28-2005, 07:48 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Lance
Using the deprecated isweapon flag in a weapon is in and of itself redundant. Whether or not you are checking what the currently selected weapon is irrelevant and adds nothing to this statement but misrepresentation.
You're too good .
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #20  
Old 10-02-2005, 09:11 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 dun work
NPC Code:
//NPC made By Excaliber
//#CLIENTSIDE
if (isweapon && strequals(#w,Lightning) && weaponfired && playermp>4 || isweapon && strequals(#w,Lightning) && mousedown && playermp>4){
disabledefmovement;
showimg 300,dr-crosshairs.png,mousex-.5,mousey-.35;
this.shooting = 1;
timeout=.05;
}
if(isweapon && this.shooting==1 && timeout){
replaceani idle,grab;
setani grab,;
showimg 300,dr-crosshairs.png,mousex-.5,mousey-.35;
timeout=.05;
}
if(this.shooting==1&&keypressed&&strequals(#p(1),A )){
this.shooting = 0;
hideimg 300;
enabledefmovement;
replaceani idle,idle;
setani idle,;
}

if(strequals(#w,Lightning) && this.shooting==1 && mousedown && leftmousebutton){
this.shooting = 0;
playermp=playermp-5;
showimg 400,dr-lightning.png,mousex-.5,mousey-8;
newx2 = mousex;
newy2 = mousey;
for(i=1;i<100;i=i+25){
changeimgpart 400,0,0,35,i;
sleep .05;
}
putexplosion2 3,2,newx2-.75,newy2-.75;
hideimg 400;
hitobjects 2,mousex,mousey;
hitobjects 2,mousex-.25,mousey-.25;
hitobjects 2,mousex+.25,mousey-.25;
hitobjects 2,mousex-.25,mousey+.25;
hideimg 300;
timeout=.05;
replaceani idle,idle;
setani idle,;
this.shooting = 0;
enabledefmovement;
hideimg 302;
sleep 3;
hideimg 301;
}
if(timeout&&!litshooting){
hideimg 300;
}

Reply With Quote
  #21  
Old 10-02-2005, 09:20 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
i=i+25 should be i += 25.

Also, you should also stop mixing things in if statements that are not related.
i.e. isweapon and playermp are in no way related, so stop putting them in the same check.

Finally, what the hell are you doing with replaceani idle,idle;?
__________________
Skyld
Reply With Quote
  #22  
Old 10-02-2005, 09:24 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
i=i+25 should be i += 25.
Same thing
Quote:
Originally Posted by Skyld
Also, you should also stop mixing things in if statements that are not related.
i.e. isweapon and playermp are in no way related, so stop putting them in the same check.
it works for everything else, and is a quick way to make sure that th player has enough MP and is doing the attack
Quote:
Finally, what the hell are you doing with replaceani idle,idle;?
XD make sure idle is the gani XD not fully necessary
Reply With Quote
  #23  
Old 10-02-2005, 09:27 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
Same thing
Why not make it easier to read?
Quote:
Originally Posted by excaliber7388
it works for everything else, and is a quick way to make sure that th player has enough MP and is doing the attack
Whether it works is not the point. You should not be mixing things like that; it's bad practice.
__________________
Skyld
Reply With Quote
  #24  
Old 10-02-2005, 09:51 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, not the problem here
Reply With Quote
  #25  
Old 10-02-2005, 09:53 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by excaliber7388
still, not the problem here
Skyld is just saying that it would be easier for people to help you if they could easily read the script without having to figure out things because of bad formatting.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #26  
Old 10-02-2005, 09:55 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 napo_p2p
Skyld is just saying that it would be easier for people to help you if they could easily read the script without having to figure out things because of bad formatting.
Yes.

People don't like looking at badly formatted code, and therefore you stand less chance of being helped since people just can't work with it.
__________________
Skyld
Reply With Quote
  #27  
Old 10-03-2005, 01:26 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
yeah, it's almost impossible to help pinpoint errors if your code is as bull****-formatted as yours is.

read the guide.
__________________
torankusu's
Reply With Quote
  #28  
Old 10-03-2005, 01:48 AM
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
See there's the problem I guess, I have no trouble reading badly formatted scripts. Guess I'll have to get reading
Reply With Quote
  #29  
Old 10-05-2005, 10:03 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
This script does not work aroung NPC baddies either It works everywhere else, but not around a baddie when used around a baddie, the water stays beneither the player
NPC Code:

//#CLIENTSIDE
if(weaponfired&&playermp>4){
playermp=playermp-5;
if(playerdir=0){
for(i=1;i<31;i=i+2){
sleep .05;
putleaps 5,playerx+.5,playery-i;
hitobjects 2,playerx+.5,playery-i;

}
}
if(playerdir=2){
for(i=3;i<31;i=i+2){
sleep .05;
putleaps 5,playerx+.5,playery+i;
hitobjects 2,playerx+.5,playery+i;

}
}
if(playerdir=1){
for(i=3;i<31;i=i+2){
sleep .05;
putleaps 5,playerx-i,playery+1.5;
hitobjects 2,playerx-i,playery+1.5;

}
}
if(playerdir=3){
for(i=3;i<31;i=i+2){
sleep .05;
putleaps 5,playerx+i,playery+1.5;
hitobjects 2,playerx+i,playery+1.5;

}
}
enabledefmovement
}
}

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 04:47 AM.


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