Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   i'm stumped, script help (https://forums.graalonline.com/forums/showthread.php?t=47733)

Gravis2k 09-06-2003 10:52 AM

i'm stumped, script help
 
i made a bird transformation for my server, and i have made all of the ganis (walk,idle,attack etc...) and for some reason the walk one doesnt show on me... for an hour it would show on other people, but now it doesn't. i don't see anything wrong with the script what so ever.. if some1 could point it out i would really appreciate it.


//#CLIENTSIDE
if (weaponfired&&this.on=0) {
setani birdtransform,;
replaceani idle,birdidle;
replaceani sword,birdattack2;
replaceani walk,birdidle;
this.on=1;
}else if (weaponfired&&this.on=1) {
setani birdreform1,;
replaceani idle,idle;
replaceani sword,sword;
replaceani walk,walk;
this.on=0;
}
if(playerchats&&strequals(#c,land)){
setplayerprop #c,::Descends slowly::;
setani birdland,;
disabledefmovement;
}
if(playerchats&&strequals(#c,fly)){
setplayerprop #c,::Rises rapidly into the air::;
setani birdfly1,;
enabledefmovement;
}

Kaimetsu 09-06-2003 11:14 AM

Re: i'm stumped, script help
 
replaceani walk,birdidle;

Gravis2k 09-06-2003 11:21 AM

should have mentioned that
 
i know it says birdidle, they both are the same gani for flying and idling so i only made the idle. it worked for a little bit on other people and now it doesnt work at all :(

Kaimetsu 09-06-2003 03:47 PM

Fair enough. Fix it up in accordance with KSI-GS and I'll try to help you in other ways.

Gravis2k 09-06-2003 08:13 PM

Ok i think i got this right lol
 
//#CLIENTSIDE

if (weaponfired&&this.on=0) {
setani birdtransform,;
replaceani idle,birdidle;
replaceani sword,birdattack2;
replaceani walk,birdidle;
this.on=1;
}


else if (weaponfired&&this.on=1) {
setani birdreform1,;
replaceani idle,idle;
replaceani sword,sword;
replaceani walk,walk;
this.on=0;
}


if (playerchats&&strequals(#c,land)){
setplayerprop #c,:escends slowly::;
setani birdland,;
disabledefmovement;
}


if (playerchats&&strequals(#c,fly)){
setplayerprop #c,::Rises rapidly into the air::;
setani birdfly1,;
enabledefmovement;
}

------------------------------------------------------------------
if there is anything wrong with the format tell me and i will fix it

Tseng 09-06-2003 08:16 PM

Regarding conforming to KSI-GS:

You have two successive checks of the same event. :-\

Rather than doing:

NPC Code:

if (event1 && condition1) {
dostuff();
}
if (event1 && condition2) {
dootherstuff();
}



Do:

NPC Code:

if (event1) {
if (condition1) {
dostuff();
}
else if (condition2) {
dootherstuff();
}
}



Also, you are using one equals sign for comparisons - bad!

Gravis2k 09-06-2003 08:25 PM

Better?
 
//#CLIENTSIDE

if (weaponfired){
if (this.on==0) {
setani birdtransform,;
replaceani idle,birdidle;
replaceani sword,birdattack2;
replaceani walk,birdidle;
this.on=1;
}
else if (this.on==1){
setani birdreform1,;
replaceani idle,idle;
replaceani sword,sword;
replaceani walk,walk;
this.on=0;
}
}


if (playerchats&&strequals(#c,land)){
setplayerprop #c,:escends slowly::;
setani birdland,;
disabledefmovement;
}


if (playerchats&&strequals(#c,fly)){
setplayerprop #c,::Rises rapidly into the air::;
setani birdfly1,;
enabledefmovement;
}

Tseng 09-06-2003 08:33 PM

Now apply the same idea to the second block, and then test the script out again.

Python523 09-06-2003 08:35 PM

use [code] tags on the forums

Gravis2k 09-06-2003 08:50 PM

i tried
 
i tried, it still doesn't work.
NPC Code:

//#CLIENTSIDE

if (weaponfired){
if (this.on==0) {
setani birdtransform,;
replaceani idle,birdidle;
replaceani sword,birdattack2;
replaceani walk,birdidle;
this.on=1;
}
else if (this.on==1){
setani birdreform1,;
replaceani idle,idle;
replaceani sword,sword;
replaceani walk,walk;
this.on=0;
}
}


if(playerchats&&strequals(#c,land)){
setplayerprop #c,::Descends slowly::;
setani birdland,;
disabledefmovement;
}
if(playerchats&&strequals(#c,fly)){
setplayerprop #c,::Rises rapidly into the air::;
setani birdfly1,;
enabledefmovement;
}


Gravis2k 09-06-2003 09:31 PM

am i being ignored now lol??

Tseng 09-06-2003 10:21 PM

Quote:

Originally posted by Gravis2k
am i being ignored now lol??
You didn't listen to my last set of helping directions. :(

Gravis2k 09-06-2003 10:53 PM

ok done (sorry)
NPC Code:
//#CLIENTSIDE 

if (weaponfired){
if (this.on==0) {
setani birdtransform,;
replaceani idle,birdidle;
replaceani sword,birdattack2;
replaceani walk,birdidle;
this.on=1;
}
else if (this.on==1){
setani birdreform1,;
replaceani idle,idle;
replaceani sword,sword;
replaceani walk,walk;
this.on=0;
}
}


if (playerchats){
if (strequals(#c,land)){
setplayerprop #c,:Descends slowly::;
setani birdland,;
disabledefmovement;
}


else if (strequals(#c,fly)){
setplayerprop #c,::Rises rapidly into the air::;
setani birdfly1,;
enabledefmovement;
}
}



but that's not where my problem was.... when i am in bird form and i try to move i switch back to looking human again, my friend zach can use it and fly and still look like a bird but i can't, i can also see him flying. please help lol

everything but the walk one works. fly,land,idle, and attack all work fine.

mhermher 09-06-2003 11:54 PM

You probablly got some NPC using a loop to replaceani walk,walk; or so

Python523 09-07-2003 12:01 AM

Quote:

Originally posted by mhermher
You probablly got some NPC using a loop to replaceani walk,walk; or so
What? You do not loops replaceani's, I thought you were a scripter


All times are GMT +2. The time now is 05:50 AM.

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