View Single Post
  #14  
Old 02-07-2002, 09:42 AM
Lomgren Lomgren is offline
Senior Member, Anti-Spam
Join Date: Mar 2001
Location: Missouri
Posts: 196
Lomgren will become famous soon enough
Here is a script like what you are making;

NPC Code:

if (isweapon) {
setarray fireshot,3;
}
if (weaponfired) {
fireshot[0] = playerdir;
fireshot[1] = playerx+2*vecx(playerdir);
fireshot[2] = playery+2*vecy(playerdir);
timeout = .05;
}
if (timeout) {
putexplosion 2,fireshot[1],fireshot[2];
fireshot[1]+=vecx(fireshot[0]);
fireshot[2]+=vecy(fireshots[0]);
checkforwalls/players();
if (hitwall==1) {
break;
}
timeout = .05;
}
function checkforwalls/players() {
<insert code here>;
}



I would have put an option for multiple fireshots, but that would have taken longer to write, and that takes time...
__________________
Lomgren - devoted to classic, even though I may be gone for months on end
Reply With Quote