Weapon Views from scratch QC
Moderator: InsideQC Admins
25 posts
• Page 2 of 2 • 1, 2
Re: Weapon Views from scratch QC
OK, I think the problem is that it doesn't load the gun at the start of a map (like the axe/shotgun in original quake) I know how to change this in default QuakeC in client.qc with SetNewParms but how would I do this with scratch QC? 
-

ScatterBox - Posts: 50
- Joined: Sun Oct 13, 2013 7:53 pm
Re: Weapon Views from scratch QC
the same? i maybe wrong. everything iv learned has either been from tutorials, or from reading the 1.06 qc. so i'd assume the best way to do things would be either similar or the same as ID.
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
Re: Weapon Views from scratch QC
ceriux wrote:the same? i maybe wrong. everything iv learned has either been from tutorials, or from reading the 1.06 qc. so i'd assume the best way to do things would be either similar or the same as ID.
I literally copy and pasted all of the need Parm code from client.qc (eg SetNewParms ect.) and adjusted it some places and it didn't work.
-

ScatterBox - Posts: 50
- Joined: Sun Oct 13, 2013 7:53 pm
Re: Weapon Views from scratch QC
You must ensure that updateweapon is called somewhere at every frame, so any weapon change (pickups, running out of ammo, etc) are visually represented to the player. Are you doung this ? And where exactly ?
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
Re: Weapon Views from scratch QC
frag.machine wrote:You must ensure that updateweapon is called somewhere at every frame, so any weapon change (pickups, running out of ammo, etc) are visually represented to the player. Are you doung this ? And where exactly ?
OK, I'm calling UpdateWeapon (like W_SetCurrentAmmo in original Quake) in these places
- Weapons.qc
: W_CheckNoAmmo
: W_ChangeAmmo
: CheatCommand
- items_btl.qc (items.qc)
: at the top of the file - Line 1: void() UpdateWepaon;
: weapon_touch
That's the places I'm calling it.. Hope this helps!
-

ScatterBox - Posts: 50
- Joined: Sun Oct 13, 2013 7:53 pm
Re: Weapon Views from scratch QC
ScatterBox wrote:- items_btl.qc (items.qc)
: at the top of the file - Line 1: void() UpdateWepaon;
This one doesn't even count as a call. It's just the function declaration for use further down in the code.
A function call will look something like this:
- Code: Select all
void blablabla ()
{
// some code
UpdateWeapon();
// more code
};
From what I see, you are not calling it at least once per frame, as I said it should be.
For comparison, W_SetCurrentAmmo () is called in the following points in regular QuakeC:
- Code: Select all
client.qc:
- PutClientInServer()
- PlayerPreThink()
items.qc:
- weapon_touch()
- ammo_touch()
- BackpackTouch()
weapons.qc:
- W_CheckNoAmmo()
- W_ChangeWeapon()
- CheatCommand()
- CycleWeaponCommand()
- CycleWeaponReverseCommand()
You' re lacking a call to updateWeapon() in PlayerPreThink (), which is ALWAYS executed at the beggining of every game frame (10 times per second).
The remaining calls are optional depending if your scratch-based code have the equivalent functions.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
Re: Weapon Views from scratch QC
frag.machine wrote:ScatterBox wrote:- items_btl.qc (items.qc)
: at the top of the file - Line 1: void() UpdateWepaon;
This one doesn't even count as a call. It's just the function declaration for use further down in the code.
A function call will look something like this:
- Code: Select all
void blablabla ()
{
// some code
UpdateWeapon();
// more code
};
From what I see, you are not calling it at least once per frame, as I said it should be.
For comparison, W_SetCurrentAmmo () is called in the following points in regular QuakeC:
- Code: Select all
client.qc:
- PutClientInServer()
- PlayerPreThink()
items.qc:
- weapon_touch()
- ammo_touch()
- BackpackTouch()
weapons.qc:
- W_CheckNoAmmo()
- W_ChangeWeapon()
- CheatCommand()
- CycleWeaponCommand()
- CycleWeaponReverseCommand()
You' re lacking a call to updateWeapon() in PlayerPreThink (), which is ALWAYS executed at the beggining of every game frame (10 times per second).
The remaining calls are optional depending if your scratch-based code have the equivalent functions.
Thanks for explaining the whole function declaration thing!
-

ScatterBox - Posts: 50
- Joined: Sun Oct 13, 2013 7:53 pm
Re: Weapon Views from scratch QC
impulse test(works)
what about items(lol)
you missed SUB_UseTargets and DelayThink(for SUB_UseTargets) from original quake
you just defined it in your defs.qc but not wrote the code:)
your doors,buttons will not work without SUB_UseTargets
- Code: Select all
if(self.impulse == 20)
{
self.weapon = IT_BLUN;
UpdateWeapon();
}
what about items(lol)
you missed SUB_UseTargets and DelayThink(for SUB_UseTargets) from original quake
you just defined it in your defs.qc but not wrote the code:)
your doors,buttons will not work without SUB_UseTargets
Sorry for my english 
- Max_Salivan
- Posts: 93
- Joined: Thu Dec 15, 2011 1:00 pm
Re: Weapon Views from scratch QC
It seems to me you dont have (yet) the required experience and engine knowledge to use the scratch code base. Maybe you should just take progs 106, strip out the unused parts and add your code ? At least would be easier to ask for help if something gets screwed.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
Re: Weapon Views from scratch QC
frag.machine wrote:It seems to me you dont have (yet) the required experience and engine knowledge to use the scratch code base. Maybe you should just take progs 106, strip out the unused parts and add your code ? At least would be easier to ask for help if something gets screwed.
You're probably right.. which is why I still have a backup copy of my old progs build off of the 1.06 source.
-

ScatterBox - Posts: 50
- Joined: Sun Oct 13, 2013 7:53 pm
25 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest