.


Welcome to Quake3World: Your World is waiting...



UBBFriend: Email This Page to Someone!
  Quake3World.com Forums
  Editing & Modifications
  Entity question

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Entity question
miljam
Soldier

Posts: 56
Registered: Nov 1999

posted 06-14-2000 10:35 PM     Click Here to See the Profile for miljam     Edit/Delete Message Reply w/Quote   
How can I find the number of a projectile entity? I'm trying to code a freeze gun function ala Weapons of Destruction. I have the actual projectile code done...that part was easy. I also have the actual freezing of the player figured out. It's the part where the freeze gun "bullet" actually hits the player that has me stuck. My idea is to call the freezePlayer function when the player takes damage caused by the Freeze Gun "bullet" (G_Damage, g_combat.c). I just don't know how I can find the Freeze Gun 'bullet' bit. I'm sure my inexperience is showing...

Help? ...thanks..

miljam

]missi[
Caveman

Posts: 3
Registered: Jun 2000

posted 06-15-2000 04:56 AM     Click Here to See the Profile for ]missi[   Click Here to Email ]missi[     Edit/Delete Message Reply w/Quote   
Hi,

you could use the "int mod" that you have in G_Damage to identify the weapon that do damage to the player IE

if(mod == MOD_FREEZEGUN) {
//freeze the player
}

That's just a thought, maybe there is even a better way, but this should work.

zarqoon
Quaker

Posts: 20
Registered: Dec 1999

posted 06-15-2000 02:05 PM     Click Here to See the Profile for zarqoon   Click Here to Email zarqoon     Edit/Delete Message Reply w/Quote   
Yeah, just like ]missi[ said, you can use if (mod == MOD_FREEZEGUN) in G_Damage...

try this example code to prevent people from walking:
(I don't have the code to look at, I've done this in my mod Elite Squad Arena)
but here's an example:

code:

if (mod == MOD_FREEZEGUN) {
client->ps.powerups[PW_FREEZE] = level.time + 10000; // 10 seconds in milliseconds
}

and then in g_active.c where the player speeds are handled:

code:

if (client->ps.powerups[PW_FREEZE])
client->ps.speed = 0;
else
client->ps.speed = g_speed;

I don't know if all the code is correct, but it should give you a clue about how to do.

[This message has been edited by zarqoon (edited 06-15-2000).]

All times are PT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Quake3World

Powered by: Ultimate Bulletin Board, Version 5.43b
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.