bow and arrow problem
Moderator: InsideQC Admins
14 posts
• Page 1 of 1
bow and arrow problem
Hi there, I've had this problem for months and I still don't know how to fix it
I have made a bow and arrow type weapon, and depending on its charge animation frame, shoots an arrow at a specific velocity. What the problem is, is soon after loading a map, and charging up an arrow, it crashes the server. But if I wait for a while, its safe to use it. It's been driving me nuts
Below is the code from weapons.qc
http://pastebin.com/m681eb311
And this is from player.qc
http://pastebin.com/m10c639c4
If this isn't enough information, I can provide a link to all my .qc files. I've got a few more bugs to handle too, but it might be asking for much to ask for help on those too
Thanks for reading.
Below is the code from weapons.qc
http://pastebin.com/m681eb311
And this is from player.qc
http://pastebin.com/m10c639c4
If this isn't enough information, I can provide a link to all my .qc files. I've got a few more bugs to handle too, but it might be asking for much to ask for help on those too
Thanks for reading.
-

MDave - Posts: 76
- Joined: Mon Dec 17, 2007 7:08 pm
Well, for one thing, you should not be using 'other' in Arrow_Explode (since you are using it as a delayed think function). Do 'self.enemy = other;' in arrow_f_touch(), and use that instead. Don't know if this is what is causing your crash though. Are you getting a useful error message, or is the crash completely mysterious?
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
- Sajt
- Posts: 1215
- Joined: Sat Oct 16, 2004 3:39 am
Nothing to add, just wanted to point out Inside3d's own QC Pastebin - http://www.inside3d.com/pastebin.php
Be nice to see it used for something other than just keeping the spambots occupied =)
Be nice to see it used for something other than just keeping the spambots occupied =)
-

scar3crow - InsideQC Staff
- Posts: 1054
- Joined: Tue Jan 18, 2005 8:54 pm
- Location: Alabama
scar3crow, thanks, I must of missed it somehow
Thanks for the tip!
Ahh sorry, forgot to post the error message:
"CALL0 14421(?]
: W_WeaponFrame
: PlayerPostThink
(NO FUNCTION)
NULL function
Host_Error : Program error"
EDIT: After further testing, it only seems to happen when you change level, and not when you use the map command or start a new game.
Sajt wrote:Well, for one thing, you should not be using 'other' in Arrow_Explode (since you are using it as a delayed think function). Do 'self.enemy = other;' in arrow_f_touch(), and use that instead. Don't know if this is what is causing your crash though. Are you getting a useful error message, or is the crash completely mysterious?
Thanks for the tip!
Ahh sorry, forgot to post the error message:
"CALL0 14421(?]
: W_WeaponFrame
: PlayerPostThink
(NO FUNCTION)
NULL function
Host_Error : Program error"
EDIT: After further testing, it only seems to happen when you change level, and not when you use the map command or start a new game.
-

MDave - Posts: 76
- Joined: Mon Dec 17, 2007 7:08 pm
Can you post the contents of W_WeaponFrame?
Also, what QCC compiler are you using? I think many of them (FTEQCC included) have an evil habit of warning when they should error. For example, you could call a nonexistant function (perhaps misspelled) and it would still compile. Are you getting any qcc compiler warnings?
Also, what QCC compiler are you using? I think many of them (FTEQCC included) have an evil habit of warning when they should error. For example, you could call a nonexistant function (perhaps misspelled) and it would still compile. Are you getting any qcc compiler warnings?
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
- Sajt
- Posts: 1215
- Joined: Sat Oct 16, 2004 3:39 am
I'm using Frikqcc.
I posted the code in the pastebin:
http://www.inside3d.com/pastebin.php?ac ... ow&id=4491
and W_Attack here.
http://www.inside3d.com/pastebin.php?ac ... ow&id=4492
I apologise for the somewhat messy code, I'm not really a coder by nature.
I posted the code in the pastebin:
http://www.inside3d.com/pastebin.php?ac ... ow&id=4491
and W_Attack here.
http://www.inside3d.com/pastebin.php?ac ... ow&id=4492
I apologise for the somewhat messy code, I'm not really a coder by nature.
-

MDave - Posts: 76
- Joined: Mon Dec 17, 2007 7:08 pm
player_arrow1 I assume is your new animation sequence. Post that code please? I suspect the error has to deal with the next function in the state macros. If there's a spelling or typo error in the name(s) of the functions in the state macros you can get a NULL function when it tries to call it.
Dunno why FrikQCC didn't error if that is the case however, which version of frikqcc are you using? (wish I never did all those hacks to make Nehahra compile and never reverted them, damnit)
Dunno why FrikQCC didn't error if that is the case however, which version of frikqcc are you using? (wish I never did all those hacks to make Nehahra compile and never reverted them, damnit)
- FrikaC
- Site Admin
- Posts: 1026
- Joined: Fri Oct 08, 2004 11:19 pm
I posted the player_arrow1 code in my first post
http://pastebin.com/m10c639c4
I'm using version 2.7.
http://pastebin.com/m10c639c4
I'm using version 2.7.
-

MDave - Posts: 76
- Joined: Mon Dec 17, 2007 7:08 pm
- Code: Select all
if (self.aflag == 1) // make sure to fix downed gun
{
self.aflag = 0; // no longer down
self.think1(); // function called to raise gun
self.think1=SUB_Null; // reset pointer
}
Just a guess - are you properly setting up self.think1 on changelevel? That could be why you're getting a null function error, if you're calling self.think1() and you haven't set it to anything yet (ie another weapon hasn't set it to SUB_Null/anything else yet).
-

Supa - Posts: 164
- Joined: Tue Oct 26, 2004 8:10 am
Thanks, that seems to have fixed it! I added other.think1=SUB_Null; in the 'execute_changelevel' function's while loop.
Many thanks!
I can get onto my next problem then.
How can I make my arrows and remote mines not stick to doors/platforms/trains? And fall down to the floor instead?
Many thanks!
I can get onto my next problem then.
How can I make my arrows and remote mines not stick to doors/platforms/trains? And fall down to the floor instead?
-

MDave - Posts: 76
- Joined: Mon Dec 17, 2007 7:08 pm
Ok, I fixed it for good this time, just added:
before player_arrow1; in W_Attack
I also fixed my arrows and remote mines problem. Almost glitch free now! Now I just need to figure out the best way to stick remote mines onto players/monsters properly.
- Code: Select all
self.aflag = 0; // we'll say gun isn't down yet
self.think1=SUB_Null; // so we don't need to raise it
before player_arrow1; in W_Attack
I also fixed my arrows and remote mines problem. Almost glitch free now! Now I just need to figure out the best way to stick remote mines onto players/monsters properly.
-

MDave - Posts: 76
- Joined: Mon Dec 17, 2007 7:08 pm
14 posts
• Page 1 of 1
Who is online
Users browsing this forum: Bing [Bot] and 1 guest