Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > NPC Server
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 07-26-2001, 08:05 AM
Bravo_LAT-Admin Bravo_LAT-Admin is offline
Registered User
Join Date: Jun 2001
Location: banana
Posts: 165
Bravo_LAT-Admin will become famous soon enough
more scripting

for this script it works fine offline but yet again won't work online with npcserver. What needs to be changed to get it to function properly:

if (playerenters) {
timereverywhere;
timeout=.05;
xmove=0;
ymove=0;
}
if(timeout){
timeout=.05;
if(playery<66&&playerx<64){
if(playersprite>0&&playersprite<9){
if(abs(xmove)<1.5){
if(playerdir=3)
xmove+=.1;
if(playerdir=1)
xmove-=.1;
}
if(abs(ymove)<1.5){
if(playerdir=2)
ymove+=.1;
if(playerdir=0)
ymove-=.1;
}
}
if(xmove>0){
if (!onwall((playerx+xmove+2),playery)&&
!onwall((playerx+xmove+2),(playery+1))&&
!onwall((playerx+xmove+2),(playery+2))){
playerx+=xmove;
xmove-=.05;
}else{
xmove=0;
}
}
if(xmove<0){
if (!onwall((playerx+xmove),playery)&&
!onwall((playerx+xmove),(playery+1))&&
!onwall((playerx+xmove),(playery+2))){
playerx+=xmove;
xmove+=.05;
}else{
xmove=0;
}
}
if(ymove>0){
if (!onwall(playerx,(playery+2+ymove))&&
!onwall((playerx+1),(playery+2+ymove))&&
!onwall((playerx+2),(playery+2+ymove))){
playery+=ymove;
ymove-=.05;
}else{
ymove=0;
}
}
if(ymove<0){
if (!onwall(playerx,(playery+ymove))&&
!onwall((playerx+1),(playery+ymove))&&
!onwall((playerx+2),(playery+ymove))){
playery+=ymove;
ymove+=.05;
}else{
ymove=0;
}
}
if(abs(xmove)<.05)
xmove=0;
if(abs(ymove)<.05)
ymove=0;
}
else{
ymove=0;
xmove=0
}
}
__________________

  #2  
Old 07-26-2001, 08:18 AM
General General is offline
Banned
Join Date: Apr 2001
Location: Station Square
Posts: 984
General is on a distinguished road
Send a message via ICQ to General Send a message via AIM to General Send a message via Yahoo to General
you must change everywhere it says if to else, and everywhere it says else to if
  #3  
Old 07-26-2001, 09:19 AM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
one thing I noticed just scrolling down really fast is your timeout

you have to timeout=0.1 (you cant do 0.05 on npc server unless it is clientside)
__________________
Thanks,
-KJL
  #4  
Old 07-26-2001, 08:54 PM
Bravo_LAT-Admin Bravo_LAT-Admin is offline
Registered User
Join Date: Jun 2001
Location: banana
Posts: 165
Bravo_LAT-Admin will become famous soon enough
ty

aww crap. Yeah this has to be serverside...hmmm maybe it'll look okay with that delay 0.o thx kjs
__________________

  #5  
Old 07-27-2001, 06:08 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
That script could be cut down a lot using vector X and Y.... =\
Also there are some Really long stuff that dont need to be tehre butr ill let you figure it out. You learn better if its not done for you.
__________________

subliminal message: 1+1=3
  #6  
Old 07-28-2001, 05:13 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
you can cut it down alot also by using an array of the onwall+loop instead of putting a whole bunch of if's
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
  #7  
Old 07-28-2001, 06:04 AM
GarusRiblet GarusRiblet is offline
Registered User
Join Date: Jul 2001
Location: Get down! A **** recon bike!
Posts: 88
GarusRiblet is on a distinguished road
Send a message via AIM to GarusRiblet
Quote:
Originally posted by Falcor
That script could be cut down a lot using vector X and Y.
yesh, and it would cut down on the lag to boot!
 


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 10:52 AM.


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