![]() |
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; } } |
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.
|
Re: Improving..
sorry to say but your code is the devil...
you have a lot of usless coding... mabie try this NPC Code: try that out... (the onwall and onwater code isn't the best but oh well)... |
kool
yours is pretty kool (at KJS)
better than i would do ... i am still just starting to get onwall and onwater used properly |
Re: Re: Re: Improving..
Quote:
|
lol i'm not even gonna try posting my peddly little script.
|
Re: Re: Re: Improving..
Quote:
this.on=(this.on+1)%2 |
Re: Re: Re: Re: Re: Improving..
Quote:
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 |
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)
|
Quote:
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) |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
the net script is in newfeatures2001.txt
|
Quote:
|
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
|
| All times are GMT +2. The time now is 12:40 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.