Inside3D!
     

help me please

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
quakecorpse



Joined: 18 Apr 2006
Posts: 8

PostPosted: Sun Nov 26, 2006 5:24 pm    Post subject: help me please Reply with quote

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
View user's profile Send private message
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Sun Nov 26, 2006 5:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
FrikaC
Site Admin


Joined: 08 Oct 2004
Posts: 947

PostPosted: Mon Nov 27, 2006 7:15 am    Post subject: Reply with quote

Why are you using decompiled code?
Back to top
View user's profile Send private message Send e-mail
quakecorpse



Joined: 18 Apr 2006
Posts: 8

PostPosted: Mon Nov 27, 2006 7:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
quakecorpse



Joined: 18 Apr 2006
Posts: 8

PostPosted: Sun Dec 03, 2006 11:44 am    Post subject: Reply with quote

ok, no kickback ...

about the wizard, scrag, what should i do to make him summon Tarbaby, Spawn, ?
Back to top
View user's profile Send private message
scar3crow
Inside3D Staff


Joined: 18 Jan 2005
Posts: 837
Location: Las Vegas, NV

PostPosted: Sun Dec 03, 2006 8:59 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group