Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   warp (https://forums.graalonline.com/forums/showthread.php?t=62553)

excaliber7388 11-28-2005 10:02 PM

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;
}
}


Skyld 11-28-2005 10:11 PM

Be more specific.

"It doesn't work" doesn't help any of us solve your problem.

Fox1545 11-28-2005 10:17 PM

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...

excaliber7388 11-28-2005 10:31 PM

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. :\

Lance 11-29-2005 12:01 AM

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;

excaliber7388 11-29-2005 03:35 AM

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;
}


Lance 11-29-2005 06:39 AM

Is the swordlimit serveroption on your server at least as much as you are trying to set it to?

xAndrewx 11-29-2005 10:41 AM

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?

ApothiX 11-29-2005 04:26 PM

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.

excaliber7388 11-29-2005 10:48 PM

yeah it could be lousey formatting, this is an old offline script. And the swor dlimit on DR is 8 :D so a lvl 5 and 6 are no problem

ApothiX 11-29-2005 11:52 PM

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 :D so a lvl 5 and 6 are no problem

Being an offline script is no excuse for poor formatting. :frown: Infact, it should produce even more formatted code, because of the nifty 'style' button.

excaliber7388 12-01-2005 10:39 PM

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;
}


Riot 12-01-2005 11:32 PM

Quote:

Originally Posted by excaliber7388
triggeraction 0,0,x,y,sword,sword;

You might want to rethink that..

ApothiX 12-02-2005 12:21 AM

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.

Skyld 12-02-2005 01:40 AM

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.

excaliber7388 12-02-2005 04:13 AM

o ****. never even saw that...man that just ruined my day...and improved it thanks guys

excaliber7388 12-02-2005 04:23 AM

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;
}


napo_p2p 12-02-2005 05:11 AM

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).

Lance 12-02-2005 05:36 AM

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

Lance 12-02-2005 05:37 AM

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?

excaliber7388 12-02-2005 11:05 PM

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

napo_p2p 12-02-2005 11:55 PM

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.

Lance 12-03-2005 12:05 AM

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.

excaliber7388 12-03-2005 12:06 AM

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;}
}
}
}
}


napo_p2p 12-03-2005 12:30 AM

Quote:

Originally Posted by Lance
or 3 or 4.

I didn't know about 4 :P.

3 is default? or no?

sage_scooby 12-03-2005 02:45 PM

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.

excaliber7388 12-03-2005 06:27 PM

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;
}
}
}


ApothiX 12-04-2005 01:20 AM

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.

excaliber7388 12-04-2005 05:26 AM

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. :\

ApothiX 12-06-2005 06:05 PM

Quote:

Originally Posted by excaliber7388
Level 4 doesn't kill all baddies in one hit (i don't think 8 does)

It used to


All times are GMT +2. The time now is 06:22 PM.

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