Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » script question (script question)
script question [message #302180] Sun, 09 December 2007 19:37 Go to next message
neofmat is currently offline  neofmat
Messages: 42
Registered: February 2005
Karma: 0
Recruit
Is there an event I can catch when a vehicle is hit by a weapon ? I need to run a script on the vehicle that is being hit b a new weapon. Can someone please post a sample script or explain how this can be acomplished ?

Thanks.


Re: script question [message #302239 is a reply to message #302180] Mon, 10 December 2007 07:56 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
The closest one I can think of is the Damaged() function..

(.h file)
class some_Class : public ScriptImpClass {
   void Created(GameObject *obj);
   void Damaged(GameObject *shooter, float damage, GameObject *obj); // I forget the other param :P
};



(.cpp file)

void some_Class::Damaged(GameObject *shooter, float damage, GameObject *obj)
{
  // code here.
}



I don't know if you can find out what weapon the person is hold when they fired those shots, but I believe you'd use the Damaged function above ^^


~MathK1LL
Re: script question [message #302417 is a reply to message #302180] Mon, 10 December 2007 20:20 Go to previous messageGo to next message
neofmat is currently offline  neofmat
Messages: 42
Registered: February 2005
Karma: 0
Recruit
How does engine know which weapon hit the vehicle or person? or does the client calculates damage and sends it to server ?

Re: script question [message #302418 is a reply to message #302180] Mon, 10 December 2007 20:27 Go to previous message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

The closest you can get to knowing who/what did the damage/kill is the way I have done it in the script JFW_Kill_Message_Display in jfwdmg.cpp


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Previous Topic: HUD textures
Next Topic: Scripts.dll
Goto Forum:
  


Current Time: Sat Dec 14 09:51:39 MST 2024

Total time taken to generate the page: 0.00801 seconds