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 11-28-2005, 10: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
warp

this script works fine in some areas, but not in others X_x what would cause this?
NPC Code:
//made by Excaliber
if (actionserverside) {
if (strequals(#p(0),warp)) {
setlevel2 main1_darkrival2.nw,6.5,14;
}
}
//#CLIENTSIDE
if(weaponfired){
freezeplayer 2;play thunder.wav;setplayerdir 2;
for (i=0;i<11;i++) {
hideplayer .02;
seteffect i/10,i/10,i/10,i/10;sleep .1;
}
{
sleep 1;
triggeraction 0,0,serverside,Warp Rings/MainTown,warp;
sleep 1;
seteffect 0,0,0,0;
}
}

Reply With Quote
  #2  
Old 11-28-2005, 10:11 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
Be more specific.

"It doesn't work" doesn't help any of us solve your problem.
__________________
Skyld
Reply With Quote
  #3  
Old 11-28-2005, 10:17 PM
Fox1545 Fox1545 is offline
Registered User
Join Date: Jul 2004
Posts: 78
Fox1545 is on a distinguished road
Quote:
Originally Posted by excaliber7388
this script works fine in some areas, but not in others X_x what would cause this?
Well, except stupidly using a global variable in a loop spanning about 22 frames in which every single other one of your retarded scripts can break it, I do not see anything technically wrong with your script.

You should consider removing the useless { } block, using a gani for the warping animation and perhaps even formatting your code so it is more readable. Other than that, it is pretty cool. I do not see how you can fail at scripting a goddamned warp ring though...
Reply With Quote
  #4  
Old 11-28-2005, 10:31 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 Fox1545
Well, except stupidly using a global variable in a loop spanning about 22 frames in which every single other one of your retarded scripts can break it, I do not see anything technically wrong with your script.

You should consider removing the useless { } block, using a gani for the warping animation and perhaps even formatting your code so it is more readable. Other than that, it is pretty cool. I do not see how you can fail at scripting a goddamned warp ring though...
XD erm thx i think...instead of starting a new thread i may as well say it here: how would I make a person be able to have a lvl5 sword. im using setsword, but thats not working.
Reply With Quote
  #5  
Old 11-29-2005, 12:01 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 excaliber7388
XD erm thx i think...instead of starting a new thread i may as well say it here: how would I make a person be able to have a lvl5 sword. im using setsword, but thats not working.
playerswordpower = 5;
Reply With Quote
  #6  
Old 11-29-2005, 03:35 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
I've tried everything i could think of (not that much really ) but i can't set the players swor d and change their sword level. It changes for a sec. then goes back. this scrip has 2 things i tried X_x
NPC Code:
if(created){
setshape 1,35,96;
}
if(actionsword){
if(strequals(#p(0),psy)){
setsword swordc-reverseblade.png,5;
playerswordpower = 5;
}
if(strequals(#p(0),war)){
setsword swordc-reverseblade.png,6;
playerswordpower = 6;
}
}

//#CLIENTSIDE
if(playerchats&&strequals(#c,bell)){
if(hasweapon(Psy system)){
setsword swordc-reverseblade.png,5;
playerswordpower = 5;
triggeraction x,y,sword,psy;
}
}
if(playerchats&&strequals(#c,bell)){
if(hasweapon(Warrior system)){
setsword swordc-reverseblade.png,6;
playerswordpower = 6;
triggeraction x,y,sword,war;
}
}

if (created) {
x=x+.5;
showcharacter;
setcharprop #3,#3;
setcharprop #C0,#C0;
setcharprop #C1,#C1;
setcharprop #C2,#C2;
setcharprop #C3,#C3;
setcharprop #C4,#C4;
setcharprop #n,Mati's Ghost;
setcharprop #8,#8;
dir = 2;
}

Reply With Quote
  #7  
Old 11-29-2005, 06:39 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
Is the swordlimit serveroption on your server at least as much as you are trying to set it to?
Reply With Quote
  #8  
Old 11-29-2005, 10:41 AM
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
Do some checks
if(hasweapon(Warrior system)){
does it detect this weapon?

triggeraction x,y,sword,war;
Does it send the triggeraction?

if(strequals(#p(0),war)){
does it send the triggeraction here?
__________________
Reply With Quote
  #9  
Old 11-29-2005, 04:26 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by excaliber7388
[code]
if(playerchats&&strequals(#c,bell)){
if(hasweapon(Psy system)){
setsword swordc-reverseblade.png,5;
playerswordpower = 5;
triggeraction x,y,sword,psy;
}
}
if(playerchats&&strequals(#c,bell)){
if(hasweapon(Warrior system)){
setsword swordc-reverseblade.png,6;
playerswordpower = 6;
triggeraction x,y,sword,war;
}
}[CODE]
Erm, you need to learn how to group your code together better :|

PHP Code:
if(playerchats) {
  if(
strequals(#c,bell)) {
    
if(hasweapon(Warrior system)) {
      
// ..
    
} else if(hasweapon(Psy system)) {
      
// ..
    
}
  }

Or something along those lines. In your version, if they have both weapons, both blocks of code are being called, and that is inefficient and stupid.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #10  
Old 11-29-2005, 10:48 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
yeah it could be lousey formatting, this is an old offline script. And the swor dlimit on DR is 8 so a lvl 5 and 6 are no problem
Reply With Quote
  #11  
Old 11-29-2005, 11:52 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by excaliber7388
yeah it could be lousey formatting, this is an old offline script. And the swor dlimit on DR is 8 so a lvl 5 and 6 are no problem
Being an offline script is no excuse for poor formatting. Infact, it should produce even more formatted code, because of the nifty 'style' button.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #12  
Old 12-01-2005, 10:39 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
Okay made a clean version of the sword power thing but it still doesn't work. It sets the sword image, and the power for less than a second, then it goes back. X_x
NPC Code:
// NPC made by Excaliber
if(created){
setshape 1,32,64;
}

if(actionsword){
playerswordpower = 5;
}
//#CLIENTSIDE
if (playertouchsme) {
setplayerprop #1,hot-sword.gif;
playerswordpower = 5;
setsword hot-sword.gif,5;
say2 A NEW SWORD!;
triggeraction 0,0,x,y,sword,sword;
}

Reply With Quote
  #13  
Old 12-01-2005, 11:32 PM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Quote:
Originally Posted by excaliber7388
triggeraction 0,0,x,y,sword,sword;
You might want to rethink that..
Reply With Quote
  #14  
Old 12-02-2005, 12:21 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Riot
You might want to rethink that..
If he had actually debugged it before posting here, he would have noticed it.

ALWAYS make sure stuff you call is working, before you post on here :|

a simple:
NPC Code:
if(actionsword) {
setplayerprop #c,LOL SWORD IS GETTING KALLED!!1;
}


would have stopped you from looking like an idiot.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #15  
Old 12-02-2005, 01:40 AM
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
Speaking of right...
Quote:
Originally Posted by excaliber7388
NPC Code:
triggeraction 0,0,x,y,sword,sword;

You have already defined your X and Y action coordinates, a second time is not required.

Also, sending your triggeraction to the npc-server (<- HINT action name HINT) may help.

Also, these forums are not here to fix your scripts. You've made over eighteen threads asking us to. Read the rules, and don't post asking for desperate help if it is above your skill level.
__________________
Skyld
Reply With Quote
  #16  
Old 12-02-2005, 04:13 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
o ****. never even saw that...man that just ruined my day...and improved it thanks guys
Reply With Quote
  #17  
Old 12-02-2005, 04:23 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
doesn't work and the action IS being called
NPC Code:
// NPC made by Excaliber
if(created){
setshape 1,32,64;
}

if(actionsword){
if(strequals(#p(0),sword)){
playerswordpower = 5;
}
}
//#CLIENTSIDE
if (playertouchsme) {
setplayerprop #1,hot-sword.gif;
playerswordpower = 5;
setsword hot-sword.gif,5;
say2 A NEW SWORD!;
triggeraction x,y,sword,sword;
}

Reply With Quote
  #18  
Old 12-02-2005, 05:11 AM
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
I have never experimented with swordpower > 3.

It looks like you have checked to make sure your serverops allow a sword power of 5. However, edit your attributes with RC and check to see if you can even have a sword power of 5 because I have never seen it done (with the default sword system).
__________________
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
  #19  
Old 12-02-2005, 05:36 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 Skyld
Speaking of right...

You have already defined your X and Y action coordinates, a second time is not required.
Right on.

Quote:
Also, sending your triggeraction to the npc-server (<- HINT action name HINT) may help.
(HINT level NPC HINT)

Quote:
Also, these forums are not here to fix your scripts. You've made over eighteen threads asking us to. Read the rules, and don't post asking for desperate help if it is above your skill level.
We are here to help, but...

Excaliber: if you don't take even the simplest steps (e.g. asking yourself, "Is this triggeraction being received?") to figure out why your scripts aren't working, then I'm going to put a halt to these threads. The rule Skyld referenced is an important one. I suggest reading this to gain some more perspective.

props to Loriel for the link
Reply With Quote
  #20  
Old 12-02-2005, 05:37 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
I have never experimented with swordpower > 3.

It looks like you have checked to make sure your serverops allow a sword power of 5. However, edit your attributes with RC and check to see if you can even have a sword power of 5 because I have never seen it done (with the default sword system).
On a related note, does it work if you try to set the playerswordpower to something less than or equal to three?
Reply With Quote
  #21  
Old 12-02-2005, 11:05 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
ARG it works on levels under 5 but not 5. even though the swor dlimit is set to 8 why even have an option to change the sword limit if it really cannot be changed? X_x
Reply With Quote
  #22  
Old 12-02-2005, 11:55 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
why even have an option to change the sword limit if it really cannot be changed? X_x
I guess for servers who only want the max sword power to be 1 or 2.
__________________
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
  #23  
Old 12-03-2005, 12:05 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
I guess for servers who only want the max sword power to be 1 or 2.
or 3 or 4.
Reply With Quote
  #24  
Old 12-03-2005, 12:06 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
prototype of sword (this will replace the current sword's damage system only, it's not perfect, it has trouble hurting baddies and NPCs, and yes, i know it has to have an action serverside for other players i'll add that after i get the bugs wirked out with the baddies. the enemies can get too close and the baddies are hurt when im not facing the right direction ( i know why that happens for the player hitting one)
NPC Code:
//#CLIENTSIDE

if(isweapon){
if(keypressed&&strequals(#p(1),F)){
testx = playerx+.5;
testy = playery+2;
setani sword,;
for (i=1; i<playerscount; i++) {
if (abs(testx-(players[i].x+.5))<=2.5 && abs(testy-(players[i].y+1.5))<=3.5) {
hitplayer i,strtofloat(#s(clientr.playerswordlevel)),players[i].x,players[i].y;
}
if (!abs(testx-(players[i].x+.5))<=3.25 &&
!abs(testy-(players[i].y+1.5))<=3.25) {
if(playerdirection==0){hitobjects strtofloat(#s(clientr.playerswordlevel)),playerx+. 5,playery-1;}
if(playerdirection==2){hitobjects strtofloat(#s(clientr.playerswordlevel)),playerx+. 5,playery+3.25;}
if(playerdirection==1){hitobjects strtofloat(#s(clientr.playerswordlevel)),playerx-3,playery+1.5;}
if(playerdirection==3){hitobjects strtofloat(#s(clientr.playerswordlevel)),playerx+3 ,playery+1.5;}
}
}
}
}

Reply With Quote
  #25  
Old 12-03-2005, 12:30 AM
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
or 3 or 4.
I didn't know about 4 :P.

3 is default? or no?
__________________
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 12-03-2005, 02:45 PM
sage_scooby sage_scooby is offline
"seized by somnolence"
sage_scooby's Avatar
Join Date: Jan 2003
Location: MN USA
Posts: 605
sage_scooby is on a distinguished road
Quote:
Originally Posted by napo_p2p
I didn't know about 4 :P.

3 is default? or no?
The legendary Golden Sword. Some servers used to use it. 3 just seems to be the commonly used max.
__________________
Aeon!Sage Cypher (Special Aeon Person)

________________________________
Retired Governor Sage Cypher (Crescent Pirates)
________________________________
Contact Info:
-[email protected]
Reply With Quote
  #27  
Old 12-03-2005, 06:27 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
anyway this is what I'm currently using, but i'm having trouble hitting players, hit objects works on players, so i put hitplayer serverside, but that doesn't work either :/ what should i change to make this hit players?
NPC Code:
if(actionserverside){
if(strequals(#p(0),sword)){
for(playerz=1;playerz<=playerscount;playerz++){

for(sword=0;sword<=10;sword++){
if(playerdir==0){hitplayer playerz,strtofloat(#s(clientr.playerswordlevel)),t estx-.09,playery-1.05;}
if(playerdir==2){hitplayer playerz,strtofloat(#s(clientr.playerswordlevel)),t estx-.09,playery+3.5;}
if(playerdir==1){hitplayer playerz,strtofloat(#s(clientr.playerswordlevel)),p layerx-1.5,testy;}
if(playerdir==3){hitplayer playerz,strtofloat(#s(clientr.playerswordlevel)),p layerx+2.9,testy;}
testx=testx+.05;
testy=testy+.05;
}
}
}
}
//#CLIENTSIDE

if(isweapon){
if(keypressed&&strequals(#p(1),S)){
triggeraction 0,0,serverside,-sword,sword;
testx = playerx+.5;
testy = playery+2;
setani sword,;
for(sword=0;sword<=10;sword++){
if(playerdir==0){hitobjects strtofloat(#s(clientr.playerswordlevel)),testx-.09,playery-1.05;}
if(playerdir==2){hitobjects strtofloat(#s(clientr.playerswordlevel)),testx-.09,playery+3.5;}
if(playerdir==1){hitobjects strtofloat(#s(clientr.playerswordlevel)),playerx-1.5,testy;}
if(playerdir==3){hitobjects strtofloat(#s(clientr.playerswordlevel)),playerx+2 .9,testy;}
testx=testx+.05;
testy=testy+.05;
}
}
}

Reply With Quote
  #28  
Old 12-04-2005, 01:20 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by sage_scooby
The legendary Golden Sword. Some servers used to use it. 3 just seems to be the commonly used max.
Old Classic used to have the level 4 (golden) sword, (sword4.gif in your swords folder), but having a sword that hit 2 hearts to people, and killed all baddies in one hit was considered overpowered, I think.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #29  
Old 12-04-2005, 05:26 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
Level 4 doesn't kill all baddies in one hit (i don't think 8 does) But anyway, there are 20 hearts in the server, and also the player will have the ability to block all attacks with their sword, so it levels stuff like that out. There are also advanced sword and dodging techniques that will be used to make it more even. I'm just having trouble with making the NPC for the 2nd swords (level 5 to eight) hurt people.
Reply With Quote
  #30  
Old 12-06-2005, 06:05 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by excaliber7388
Level 4 doesn't kill all baddies in one hit (i don't think 8 does)
It used to
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
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 11:39 PM.


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