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-05-2003, 12:06 AM
TheStivi TheStivi is offline
Registered User
Join Date: Sep 2002
Location: Germany - NRW
Posts: 78
TheStivi is on a distinguished road
Send a message via ICQ to TheStivi Send a message via AIM to TheStivi
a Present for you :)

Yeah a little after Graaloween present for the kids rofl

My Bomy Script

but there are errors in onwall of waterfall "climbing" dont know how to say it XD

Its an weapon and works perfect online :
NPC Code:

//#CLIENTSIDE
if (timeout || playerenters){
hideimgs 100,400;
this.sittiles={0x2A9,0x2AA,0x2B9,0x2BA,0x467,0x468 ,0xD97,0xD98,0xDA7,0xDA8};
this.waterfall={0x464,0x463,0x464,0x463,0x467,0x46 8,0x471,0x472};
if (strtofloat(#s(client.isbomy))=1 && isweapon){
disabledefmovement;
if (this.hide=1){
setani bomy_hide,;
}
if (this.swim=1){
this.counter+=1;
if (this.counter=6){
putleaps 5,playerx+1.5,playery+2;
this.counter=0;
}
if (keydown(0)){
if (this.ymove>-0.8){this.ymove-=0.15;}
if (this.xmove<0){this.xmove+=0.05;}
if (this.xmove>0){this.xmove-=0.05;}
}
if (keydown(2)){
if (this.ymove<0.8){this.ymove+=0.15;}
if (this.xmove<0){this.xmove+=0.05;}
if (this.xmove>0){this.xmove-=0.05;}
}
if (keydown(1)){
if (this.xmove>-0.8){this.xmove-=0.15;}
if (this.ymove<0){this.ymove+=0.05;}
if (this.ymove>0){this.ymove-=0.05;}
}
if (keydown(3)){
if (this.xmove<0.8){this.xmove+=0.15;}
if (this.ymove<0){this.ymove+=0.05;}
if (this.ymove>0){this.ymove-=0.05;}
}
if (this.xmove<0){
if (this.xmove>-1){
this.xmove-=0.1;}
}
if (this.xmove>0){
if (this.xmove<1){
this.xmove+=0.1;}
}
if (this.ymove<0){
if (this.ymove>-1){
this.ymove-=0.1;}
}
if (this.ymove>0){
if (this.ymove<1){
this.ymove+=0.1;}
}
if (tiles[playerx+1,playery+2] in this.waterfall){
if (this.ymove<1.6){
this.ymove+=0.28;
}
}
else{
if (this.ymove>1){
this.ymove-=0.1;
}
}
this.newx=playerx+this.xmove;
this.newy=playery+this.ymove;
if ((onwall(this.newx+1.5,this.newy+1.5) || onwall(this.newx+1.5,this.newy+2.5) || onwall(this.newx+2.5,this.newy+1.5) || onwall(this.newx+2.5,this.newy+2.5)) && !(tiles[this.newx+1.5,this.newy+2] in this.waterfall || tiles[this.newx+1.5,this.newy+1] in this.waterfall || tiles[this.newx+2.5,this.newy+3] in this.waterfall)){
this.ymove=this.ymove*(-1);
this.xmove=this.xmove*(-1);
this.newx=playerx+this.xmove;
this.newy=playery+this.ymove;
}
if (onwater(this.newx+1,this.newy+2) || tiles[this.newx+1,this.newy] in this.waterfall || tiles[this.newx+2,this.newy] in this.waterfall || tiles[this.newx+1,this.newy+1] in this.waterfall || tiles[this.newx+2,this.newy+1] in this.waterfall || tiles[this.newx+1,this.newy+2] in this.waterfall || tiles[this.newx+2,this.newy+2] in this.waterfall || tiles[this.newx+1,this.newy+3] in this.waterfall || tiles[this.newx+2,this.newy+3] in this.waterfall){
if (tiles[this.newx+1,this.newy+1] in this.waterfall){}
else{
this.xmove=this.xmove*(-1);
this.newx=playerx+this.xmove;
}
if (tiles[this.newx+2,this.newy+1] in this.waterfall){}
else{
this.xmove=this.xmove*(-1);
this.newx=playerx+this.xmove;
}
this.swim=1;
}
else{
this.swim=0;}
playerx=this.newx;
playery=this.newy;
showimg 200,bomycompass.gif,screenwidth-60,20;
showimg 201,bomycompassdot.gif,screenwidth-39+this.xmove*5,41+this.ymove*5;
showimg 202,bomysom.gif,screenwidth-60,70;
this.speed=this.xmove*4+this.ymove*4;
showimg 203,bomycompassdot.gif,screenwidth-39+this.speed,75;
changeimgvis 200,4;
changeimgvis 201,4;
changeimgvis 202,4;
changeimgvis 203,4;
setani bomy_swim,;
}
if (this.swim=0){
if (this.xmove<>0 || this.ymove<>0){
this.outofwater=1;
setani bomy_swim,;
this.freeze=0.6;
if (this.xmove>0){
this.xmove-=0.15;
}
if (this.ymove<0){
this.ymove+=0.15;
}
if (this.xmove<0){
this.xmove+=0.15;
}
if (this.ymove>0){
this.ymove-=0.15;
}
if (this.xmove in |-0.15,0.15|){
this.xmove=0;
}
if (this.ymove in |-0.15,0.15|){
this.ymove=0;
}
this.newx=playerx+this.xmove;
this.newy=playery+this.ymove;
if ((onwall(this.newx+1.5,this.newy+1.5) || onwall(this.newx+1.5,this.newy+2.5) || onwall(this.newx+2.5,this.newy+1.5) || onwall(this.newx+2.5,this.newy+2.5))){
this.ymove=this.ymove*(-1);
this.xmove=this.xmove*(-1);
}
else{
playerx=this.newx;
playery=this.newy;
}
}
else{
if (this.outofwater=1){
this.x=playerx-int(playerx);
this.y=playery-int(playery);
if (this.x>0.5){this.x=0.5}
else{this.x=0};
if (this.y>0.5){this.x=0.5};
else{this.y=0};
playerx=int(playerx)+this.x;
playery=int(playery)+this.y;
this.outofwater=0;
}
}
if (this.xmove=0 && this.ymove=0 && this.freeze=0){
if (!keydown(1) && !keydown(2) && !keydown(0) && !keydown(3) && !keydown(6) && !keydown(5)){
this.hide=0;
if (this.idle=0){
setani bomy_idle,;
}
this.idle=1;
}
elseif (keydown(6)){
if (this.hide=0){
setani bomy_duck,;
}
this.freeze=0.1;
this.idle=0;
this.hide=1;
}
elseif (keydown(5)){
this.hide=0;
this.freeze=0.4;
this.idle=0;
setani bomy_attack,;
}
else{
this.hide=0;
this.idle=0;
setani bomy_walk,;
}
}
if (tiles[playerx+1,playery+2] in this.sittiles){
setani bomy_sit,;
}
if (onwater(playerx+1.5,playery+2)){
if (playerdir=1 || playerdir=3){
this.xmove=(playerdir-2)/10;
}
else{
this.ymove=(playerdir-1)/10;
}
this.swim=1;
}
if (!keydown(4) && this.freeze=0 && this.swim=0){
if (keydown(0)){
playerdir=0;
this.newx=playerx;
this.newy=playery-0.5;
if (!onwall(this.newx+2,this.newy+1) && !onwall(this.newx+0.5,this.newy+1) && !onwall(this.newx+1.5,this.newy+1)){
playery-=0.5;
}
}
if (keydown(1)){
playerdir=1;
this.newx=playerx-0.5;
this.newy=playery;
if (!onwall(this.newx+0.5,this.newy+1) && !onwall(this.newx+0.5,this.newy+2.5) && !onwall(this.newx+0.5,this.newy+1.5)){
playerx-=0.5;
}
}
if (keydown(2)){
playerdir=2;
this.newx=playerx;
this.newy=playery+0.5;
if (!onwall(this.newx+2,this.newy+2.5) && !onwall(this.newx+0.5,this.newy+2.5) && !onwall(this.newx+1.5,this.newy+2.5)){
playery+=0.5;
}
}
if (keydown(3)){
playerdir=3;
this.newx=playerx+0.5;
this.newy=playery;
if (!onwall(this.newx+2,this.newy+1) && !onwall(this.newx+2,this.newy+2.5) && !onwall(this.newx+2,this.newy+1.5)){
playerx+=0.5;
}
}
}
}
}
else{
enabledefmovement;
}
if (this.freeze>0){
this.freeze-=0.05;}
timeout=0.05;
}

if (playerchats){
if (startswith(setbomy,#c)){
tokenize #c;
if (!strequals(#t(2),)){
setplayerprop #3,bomy_#t(1)#t(2).png;
}
}
}
if (playerchats && strequals(#c,be human)){
if (strtofloat(#s(client.isbomy))=1){
setstring client.isbomy,;
setstring client.bomy,#3;
setplayerprop #3,#s(client.head);
setani idle,;
}
}
if (playerchats && strequals(#c,be bomy)){
if (!strtofloat(#s(client.isbomy))=1){
setstring client.isbomy,1;
playerx=int(playerx);
playery=int(playery);
setstring client.head,#3;
setplayerprop #3,#s(client.bomy);
}
}



Commands :
Be Bomy / Be Human - Change your race
Setbomy Name Number - Change your skin
__________________
Old Staff Jobs :
Graal 2002 : Gani Maker || Doomsday : Developer || Terra : Developer || Zenkou : NAT || Anystria : Manager || Galeon : Co Manager || Kabruriki : NAT Chief || Archaic : NAT || Age of Legends : Manager
Reply With Quote
  #2  
Old 11-05-2003, 12:55 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
If you're going to bother to post scripts at least follow the KSI-GS
Reply With Quote
  #3  
Old 11-06-2003, 12:00 AM
Fogy Fogy is offline
Registered User
Join Date: Aug 2003
Posts: 108
Fogy is on a distinguished road
Quote:
Originally posted by Python523
If you're going to bother to post scripts at least follow the KSI-GS
Please do not offend the users of the board, this is suppose to be a nice community not a bad one, sure he violated the rule but he should be told nicely so he can learn, not like that.
Reply With Quote
  #4  
Old 11-06-2003, 12:15 AM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Quote:
Originally posted by Fogy


Please do not offend the users of the board, this is suppose to be a nice community not a bad one, sure he violated the rule but he should be told nicely so he can learn, not like that.
Not when there is a "Rules" thread and a "KSI-GS" standard thread.
__________________
Reply With Quote
  #5  
Old 11-06-2003, 12:56 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by Fogy


Please do not offend the users of the board, this is suppose to be a nice community not a bad one, sure he violated the rule but he should be told nicely so he can learn, not like that.
Please don't try to interpret the rules better than me, I think I'm a mod for a reason, plus I didn't 'offend' him by telling him to follow a rule. Oh yes, and please do not be a hypocrite Post reviver.
Reply With Quote
  #6  
Old 11-06-2003, 03:03 AM
Deek2 Deek2 is offline
Registered User
Join Date: May 2002
Location: Springfield, Missouri
Posts: 1,578
Deek2 is on a distinguished road
Pretty simple script. Looks a little messy though, possibly with a little bit of tweaking and maintainience here and there it could be better.
Reply With Quote
  #7  
Old 11-07-2003, 02:13 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally posted by Fogy


Please do not offend the users of the board, this is suppose to be a nice community not a bad one, sure he violated the rule but he should be told nicely so he can learn, not like that.
bah...dude learn who your talking to before you say things, python is part of the global scripting team and there is a stickied thread in this forum which clearly states that you cannot post scripts....and any dunce wouldve seen that thread (unless they cant read)...and its true what python said "i am mod for a reason", its to control idiots who disobey the rules (i aint callin anyone in this thread an idiot so dont go all ****in "mommy!" on me ) anyways, whats done is done
Reply With Quote
  #8  
Old 11-07-2003, 02:14 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Wow! That looks really, really... messy and inefficient . I guess it might work but if it does I wouldn't bet extremely well. But hey, atleast you are being nice and giving (me\us) a gift .
__________________
new account: Trevor
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 03:06 AM.


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