View previous topic :: View next topic |
Author |
Message |
quakecorpse
Joined: 18 Apr 2006 Posts: 8
|
Posted: Sun Nov 26, 2006 5:24 pm Post subject: help me please |
|
|
I've found a tutorial for the shotgun's kickback, i tried but, of course, i failed.
-------------------------------------------------------------------------------------
It say:
Open up the weapons.qc file and add this function just under the prototypes:
float(float numb) kickback
{
local float kick;
kick = numb * -1; // reverse it
kick = kick * random(); // randomise it, by multiplying it by a random number from 0 to 1
if (kick > -5) kick = -5; // changes the number if its too small
return kick;
}
-------------------------------------------------------------------------------------
in my weapon.qc I have:
};
void (float numb) kickback =
{
local float kick;
kick = (numb * CONTENT_EMPTY);
kick = (kick * random ());
if ((kick > CONTENT_LAVA))
{
kick = CONTENT_LAVA;
}
};
------------------------------------------------------------------------------------
how do i have to mix them?
thank you |
|
Back to top |
|
 |
Dr. Shadowborg Inside3D Staff

Joined: 16 Oct 2004 Posts: 726
|
Posted: Sun Nov 26, 2006 5:52 pm Post subject: |
|
|
I haven't the foggiest how that tutorial is laid out but...
If it's intended to affect your punchangle, then make sure it matches the tutorial, then in w_fireshotgun put:
self.punchangle_x = kickback(whatever amount of kickback you want);
If, on the other hand it actually affects your velocity, that's a whole 'nother kettle of fish. _________________ "Roboto suggests Plasma Bazooka." |
|
Back to top |
|
 |
FrikaC Site Admin

Joined: 08 Oct 2004 Posts: 947
|
Posted: Mon Nov 27, 2006 7:15 am Post subject: |
|
|
Why are you using decompiled code? |
|
Back to top |
|
 |
quakecorpse
Joined: 18 Apr 2006 Posts: 8
|
Posted: Mon Nov 27, 2006 7:46 pm Post subject: |
|
|
Dr. Shadowborg wrote: | I haven't the foggiest how that tutorial is laid out but... |
the second part of the tut. says:
Scroll down to the W_FireShotgun function, and add this code at bottom of it:
msg_entity = self; // send the message to yourself
WriteByte(MSG_ONE,10); // use the protocol 10 , the SVC_SETANGLES protocol, which obviously changes the viewport angles
WriteAngle(MSG_ONE,self.v_angle_x + kickback(12)); // add the kickback to the x axis, the vertical rotation axis
WriteAngle(MSG_ONE,self.angles_y); // the y axis rotates the view horizontaly, we don't want to modify it
WriteAngle(MSG_ONE,0); // reset the z axis, which rolls the view
but i don't know how to use the first part ...
FrikaC wrote: | Why are you using decompiled code? |
i'm sorry ... i just opened the progs.dat with winfrik26 and then i started to mess around with the code ... i don't know if i 've broken some rule or etiquette ... |
|
Back to top |
|
 |
quakecorpse
Joined: 18 Apr 2006 Posts: 8
|
Posted: Sun Dec 03, 2006 11:44 am Post subject: |
|
|
ok, no kickback ...
about the wizard, scrag, what should i do to make him summon Tarbaby, Spawn, ? |
|
Back to top |
|
 |
scar3crow Inside3D Staff

Joined: 18 Jan 2005 Posts: 837 Location: Las Vegas, NV
|
Posted: Sun Dec 03, 2006 8:59 pm Post subject: |
|
|
Look at the code for putting an entity into the world, namely a spawn and see if you can emulate such behavior under certain conditions of the scrag.
The more difficult part would be finding a suitable location to summon them... Hrmm... if you made the summoning part of the attack routine, the scrag is in almost all cases where they would check to attack facing you, and thus there is open space between you... You could simply have them then summon the spawn x number of units in front of them... or do a check of distance between them and the player and use that value with a modifier of -10 randomized or something to place the spawn not necessarily in the same spot always, but in the general region and near the player. I dont know, Im not a coder =)
Regarding decompiled code, its not so much a matter of etiquette as decompiled code is generally ugly and hard to work with. It can put you at a disadvantage, needlessly usually. |
|
Back to top |
|
 |
|