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-01-2007, 05:40 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Guns Not Shooting

i have 2 scripts and the both wont shoot, im confused.... ive tried everything!
Attached Files
File Type: doc gunscript_improved.doc (24.0 KB, 214 views)
File Type: txt gun.txt (1.2 KB, 194 views)
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #2  
Old 09-01-2007, 05:44 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
in the second script? it works until u try to reload........
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #3  
Old 09-01-2007, 07:08 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Okay, first, don't post your script in attachments. Copy and paste it into your post enclosed in php tags.

Second, try and see if you can find which part of your script (if any) isn't executing when it's supposed to by having the different parts set player.chat to something or place a bomb somewhere or produce some other visible effect if they otherwise wouldn't.
__________________
Reply With Quote
  #4  
Old 09-01-2007, 07:13 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
You can't post scripts in php tags anymore, a large percentage of the time the forums will give you a "bad request error" because it thinks you're posting malicious code. I've posted to have this fixed, but still nothing.
Reply With Quote
  #5  
Old 09-01-2007, 07:20 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally Posted by DustyPorViva View Post
You can't post scripts in php tags anymore, a large percentage of the time the forums will give you a "bad request error" because it thinks you're posting malicious code. I've posted to have this fixed, but still nothing.
What about code tags? At the very least, if all else fails put it in a pastebin and post the link.
__________________
Reply With Quote
  #6  
Old 09-01-2007, 07:23 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
As long as it's in the post it'll screw up, no matter the tag. As for the bin, I don't think it's that widely known, at least, I didn't know about it.
Reply With Quote
  #7  
Old 09-01-2007, 07:24 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Quote:
Originally Posted by Googi View Post
Okay, first, don't post your script in attachments. Copy and paste it into your post enclosed in php tags.

Second, try and see if you can find which part of your script (if any) isn't executing when it's supposed to by having the different parts set player.chat to something or place a bomb somewhere or produce some other visible effect if they otherwise wouldn't.
its all working, and here:
PHP Code:
//Nightmare’s Faulty Gun
//#CLIENTSIDE
function onCreated() {
DeactivateGun();

this.ganilist = {
"idle",//nightmare_m16_idle
"sword",//nightmare_m16_fire
"walk"//nightmare_m16_walk
};

this.shootdelay 0.1;
this.attackpower 10;

client.strafe_direction = -1;

setTimer(0.05);
}


// Gun Code
function onTimeout() {
if(
keydown2(160true)) {
if(
client.strafe_direction == -1) {
client.strafe_direction player.dir;
}

player.dir client.strafe_direction;
} else {
client.strafe_direction = -1;
}

setTimer(0.05);
}

function 
onKeyPressed() {
if(
player.freezetime
if(
this.active) {
if(
keydown(5)) {
freezeplayer(this.shootdelay);
setani(nightmare_m16_fireNULL);
this.angle=getangle(vecx(playerdir),vecy(playerdir));
this.bulletangle = -.2;
setshootparams(player.accountthis.attackpower 3);
shoot(player.x+.3player.y+.3player.zthis.angle+random
(this.bulletangleabs(this.bulletangle)), 00" bullet1",”” );
}
if(
keydown(6)) {
DeactivateGun();
}
}
}


function 
onWeaponFired() {
if(!
this.active) {
ActivateGun();
} else {
DeactivateGun();
}
}

function 
ActivateGun() {
setplayerprop ,nightmare_m16rifle.gif;
replaceani("idle"“nightmare_m16_idle”);
replaceani("sword"“nightmare_m16_attack”);
replaceani("walk",” nightmare_m16_walk”);

setani(“nightmare_m16_idle”);

this.active true;
}

function 
DeactivateGun() {
replaceani("idle""idle");
replaceani("sword""sword");
replaceani("walk""walk");

setani("idle"NULL);

this.active false;

this one makes most sence (if any) and can exacute perfectly
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #8  
Old 09-01-2007, 07:26 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Poor scripting styling makes for awful reading of your code.
__________________
Stan.
Reply With Quote
  #9  
Old 09-01-2007, 07:43 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally Posted by Knightmare1 View Post
hey my scripting style aint got nothing on you -.-
Notice how all the other scripts on the forum indent each line based on how many ifs/withs/fors/whiles/etc it's within? Learn to do that.
__________________
Reply With Quote
  #10  
Old 09-01-2007, 07:44 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
o.O wow
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #11  
Old 09-01-2007, 08:17 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
If you can't be bothered to style, on RC type "/style weapon test" replacing 'test' with your weapon name. Change 'weapon' to dbnpc if it's a dbnpc and so forth. Makes it easier for the rest of us
Reply With Quote
  #12  
Old 09-01-2007, 08:35 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Quote:
Originally Posted by Knightmare1 View Post
hey my scripting style aint got nothing on you -.-
That didn't make any sense. o_O
__________________
Stan.
Reply With Quote
  #13  
Old 09-03-2007, 01:41 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
hm... maybe i need to use the onActionProjectile(); but i have no clue where to put it now o.O
ive never used before
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #14  
Old 09-03-2007, 02:08 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
I don't read scripts unless they're styled properly, thats just how it is.
__________________
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 06:28 PM.


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