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 09-27-2001, 05:42 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
Improving..

well i was working on this to make the speed of player faster but not go on walls well it works but sometimes you get stuck on a wall..
if anyone can help improve i'd appreciate it, thanks.

// NPC made by Merlin
//9-26-01
//speed up
if (playertouchsme) {
toweapons Boot-Test;
this.mode = 0;
}
if (weaponfired) {
if (this.mode==0) {
setplayerprop #c,Boots off;
this.mode=1;
timeout = 0;
}
elseif (weaponfired) {
if (this.mode==1) {
setplayerprop #c,Boots on;
timeout = .5;
this.mode = 0;
}
}
}
if (timeout) {
timeout = .1;
}
if (timeout) {
if (keydown(0)) {
if (this.mode==0) {
if (!onwall(playerx,playery)) {
playery--;
timeout = .1;
}
}
}
}
if (timeout) {
if (keydown(2)) {
if (this.mode==0) {
if (!onwall(playerx,playery)) {
playery++;
timeout = .1;
}
}
}
}
if (timeout) {
if (keydown(1)) {
if (this.mode==0) {
if (!onwall(playerx,playery)) {
playerx--;
timeout = .1;
}
}
}
}
if (timeout) {
if (keydown(3)) {
if (this.mode==0) {
if (!onwall(playerx,playery)) {
playerx++;
timeout = .1;
}
}
}
}
if (playerenters||created) {
if (this.mode==1) {
timeout = .1;
}
}
Reply With Quote
  #2  
Old 09-27-2001, 06:09 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Onwall is not a scripter's best friend. But, with my Super-Duper-Awesome-Mega-Onwall-Routine© code, you hit those onwalls on the nose! =P I would have to extract the code and port it to a version which would work for your situation, though.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #3  
Old 09-27-2001, 06:20 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
Re: Improving..

sorry to say but your code is the devil...

you have a lot of usless coding...

mabie try this
NPC Code:

if(playertouchsme)
toweapons Boost-up;
if(isweapon&&playerenters)
timeout=0.1;
if(weaponfired)
this.on=1-this.on;
if(timeout&&this.on==1){
for(this.i==0;this.i<4;this.i++) if(keydown(this.i))
if(!onwall(playerx+1.5+vecx(playerdir)*2,playery+1 .5+vecy(playerdir)*2)&&!onwater(playerx+1.5+vecx(p layerdir)*2,playery+1.5+vecy(playerdir)*2)){
playerx+=vecx(playerdir);
playery+=vecy(playerdir);
}
}



try that out... (the onwall and onwater code isn't the best but oh well)...
__________________
Thanks,
-KJL

Last edited by KJS; 09-27-2001 at 06:57 PM..
Reply With Quote
  #4  
Old 09-27-2001, 08:05 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
kool

yours is pretty kool (at KJS)

better than i would do ... i am still just starting to get onwall and onwater used properly

Last edited by nyghtGT; 09-27-2001 at 08:07 AM..
Reply With Quote
  #5  
Old 09-27-2001, 06:56 PM
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
Re: Re: Re: Improving..

Quote:
Originally posted by Kaimetsu


Yours has a couple of inefficiencies. Try this.on=1-this.on.
humm intresting I have never though of making anything that way befor...
__________________
Thanks,
-KJL
Reply With Quote
  #6  
Old 09-27-2001, 08:40 PM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
lol i'm not even gonna try posting my peddly little script.
__________________

-=Shard IceFire=-
Reply With Quote
  #7  
Old 09-27-2001, 11:31 PM
Riot-Starter Riot-Starter is offline
Registered User
Join Date: Aug 2001
Location: Central Florida, USA
Posts: 79
Riot-Starter is on a distinguished road
Send a message via AIM to Riot-Starter
Re: Re: Re: Improving..

Quote:
Originally posted by Kaimetsu


Yours has a couple of inefficiencies. Try this.on=1-this.on.
that never works for me i just use:
this.on=(this.on+1)%2
Reply With Quote
  #8  
Old 09-28-2001, 12:26 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
Re: Re: Re: Re: Re: Improving..

Quote:
Originally posted by Kaimetsu


Ack, no! Do not use something so inefficient!
whats the big diference ?
its 1 little line of code that doesnt really matter =\
in real programming it matters if u do a for loop or while loop .. cuz they work faster then the other and differently.. but something so simple =\
you people are weird
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #9  
Old 09-28-2001, 01:10 AM
Sep3kP2P Sep3kP2P is offline
Registered User
Join Date: Aug 2001
Location: CT
Posts: 183
Sep3kP2P is on a distinguished road
Send a message via ICQ to Sep3kP2P Send a message via AIM to Sep3kP2P
kjl, u got that onwall crap from newfeatures2001, and it doesnt eve work right =/ if u hold down like up and left u can go thru blocks (at least i could)
__________________
Sephiroth2k - Co-Owner Of Dragon Quest (Look In Profile For Website)
Reply With Quote
  #10  
Old 09-28-2001, 02:45 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
Quote:
Originally posted by Sep3kP2P
kjl, u got that onwall crap from newfeatures2001, and it doesnt eve work right =/ if u hold down like up and left u can go thru blocks (at least i could)
first off I didn't get it from newfeatures...

do you know what

playerx+1.5+vecx(playerdir)*2 does?

playerx+1.5 is right in the middle of the player

then vecx*2 = -2, 0, 2

so

(middle of player)+2 or -2

that will get the block right infront of the player....

(and like I said the onwall script isn't the best)...

I didn't feel like making a complex onwall script (I just gave the basic code merlin can do the rest of the touch ups like for onwall and ect)
__________________
Thanks,
-KJL
Reply With Quote
  #11  
Old 09-28-2001, 03:06 AM
Cybnext_Design Cybnext_Design is offline
Registered User
Join Date: Jun 2001
Posts: 244
Cybnext_Design is on a distinguished road
Send a message via AIM to Cybnext_Design
Quote:
Originally posted by Sep3kP2P
kjl, u got that onwall crap from newfeatures2001, and it doesnt eve work right =/ if u hold down like up and left u can go thru blocks (at least i could)
It might look like its from newfeatures, but most scripts that use that kind of check ends up looking just like it.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #12  
Old 09-28-2001, 04:23 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Quote:
Originally posted by Cybnext_Design


It might look like its from newfeatures, but most scripts that use that kind of check ends up looking just like it.
What?? *confused* How would you even connect that in your mind with newfeatures.txt??
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #13  
Old 09-28-2001, 05:47 AM
Cybnext_Design Cybnext_Design is offline
Registered User
Join Date: Jun 2001
Posts: 244
Cybnext_Design is on a distinguished road
Send a message via AIM to Cybnext_Design
Quote:
Originally posted by Xaviar

What?? *confused* How would you even connect that in your mind with newfeatures.txt??
Sep3kP2P said that part of KJL's script was taken out of newfeatures2001.txt, but all of the scripts that use vecx/vecy for onwall/triggeraction/etc end up looking the same.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #14  
Old 09-28-2001, 08:15 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Quote:
Originally posted by Cybnext_Design


Sep3kP2P said that part of KJL's script was taken out of newfeatures2001.txt, but all of the scripts that use vecx/vecy for onwall/triggeraction/etc end up looking the same.
Hehe...Wow..Thats getting pretty lame to copy script straight out of the examples in newfeatures2001.txt...
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #15  
Old 09-28-2001, 08:27 AM
Sep3kP2P Sep3kP2P is offline
Registered User
Join Date: Aug 2001
Location: CT
Posts: 183
Sep3kP2P is on a distinguished road
Send a message via ICQ to Sep3kP2P Send a message via AIM to Sep3kP2P
the net script is in newfeatures2001.txt
__________________
Sephiroth2k - Co-Owner Of Dragon Quest (Look In Profile For Website)
Reply With Quote
  #16  
Old 09-28-2001, 08:30 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Quote:
Originally posted by Sep3kP2P
the net script is in newfeatures2001.txt
Truly? *slaps forehead* Huh...But thats still pretty lame
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #17  
Old 10-03-2001, 04:44 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
if the players x is not a multiple of .5 like when you go along a side of a opject and your x,y gets a wierd decimal if believe that would screw up the onwall thing you listed above
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 02:14 PM.


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