Weapon Views from scratch QC
-
- Posts: 50
- Joined: Sun Oct 13, 2013 7:53 pm
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?
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.
-
- Posts: 50
- Joined: Sun Oct 13, 2013 7:53 pm
Re: Weapon Views from scratch QC
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.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.
:roll:
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 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)
-
- Posts: 50
- Joined: Sun Oct 13, 2013 7:53 pm
Re: Weapon Views from scratch QC
OK, I'm calling UpdateWeapon (like W_SetCurrentAmmo in original Quake) in these placesfrag.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 ?
- 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!
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 pm
Re: Weapon Views from scratch QC
This one doesn't even count as a call. It's just the function declaration for use further down in the code.ScatterBox wrote:- items_btl.qc (items.qc)
: at the top of the file - Line 1: void() UpdateWepaon;
A function call will look something like this:
Code: Select all
void blablabla ()
{
// some code
UpdateWeapon();
// more code
};
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()
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)
-
- Posts: 50
- Joined: Sun Oct 13, 2013 7:53 pm
Re: Weapon Views from scratch QC
Thanks for explaining the whole function declaration thing! That does help. Here I tried this and it didn't work. I'm stuck, so here's my quakec files for anyone to muck through who wants to help... just beware, it's truly a mess... good luck in there. http://www.mediafire.com/download/5y34fjwyxzldro9/QC.rarfrag.machine wrote:This one doesn't even count as a call. It's just the function declaration for use further down in the code.ScatterBox wrote:- items_btl.qc (items.qc)
: at the top of the file - Line 1: void() UpdateWepaon;
A function call will look something like this:
From what I see, you are not calling it at least once per frame, as I said it should be.Code: Select all
void blablabla () { // some code UpdateWeapon(); // more code };
For comparison, W_SetCurrentAmmo () is called in the following points in regular QuakeC:You' re lacking a call to updateWeapon() in PlayerPreThink (), which is ALWAYS executed at the beggining of every game frame (10 times per second).Code: Select all
client.qc: - PutClientInServer() - PlayerPreThink() items.qc: - weapon_touch() - ammo_touch() - BackpackTouch() weapons.qc: - W_CheckNoAmmo() - W_ChangeWeapon() - CheatCommand() - CycleWeaponCommand() - CycleWeaponReverseCommand()
The remaining calls are optional depending if your scratch-based code have the equivalent functions.
-
- Posts: 96
- Joined: Thu Dec 15, 2011 1:00 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();
}
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
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 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)
-
- Posts: 50
- Joined: Sun Oct 13, 2013 7:53 pm
Re: Weapon Views from scratch QC
You're probably right.. which is why I still have a backup copy of my old progs build off of the 1.06 source. I will stick to this until I gather more knowledge. Thanks everyone for your help!!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.