Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » scripts.dll 1.5.1/1.6
scripts.dll 1.5.1/1.6 [message #78098] Fri, 09 April 2004 17:33 Go to previous messageGo to previous message
[REHT]Spirit is currently offline  [REHT]Spirit
Messages: 277
Registered: April 2003
Karma:
Recruit

Sure, no problem Smile

void Reborn_Deployable_Vehicle::Custom(GameObject * obj,int message,int param,GameObject * sender)
{
	Vector3 nppos;
	Vector3 vpos;
	if (message == 1000000028) {
		pilotID = Commands->Get_ID(sender);
	}
	if (message == 1000000029) {
		pilotID = 0;
		nppos = Get_Vector3_Parameter("LeaveOffset");
		vpos = Commands->Get_Position(obj);
		nppos.X += vpos.X;
		nppos.Y += vpos.Y;
		nppos.Z += vpos.Z;
		Commands->Set_Position(sender,nppos);
	}
}

can become

void Reborn_Deployable_Vehicle::Custom(GameObject * obj,int message,int param,GameObject * sender)
{
	if (message == 1000000028) {
		pilotID = Commands->Get_ID(sender);
	}
	if (message == 1000000029) {
		pilotID = 0;
	}
}


and

void Reborn_Deployable_Vehicle::Killed(GameObject * obj,GameObject * shooter)
{
	if (pilotID != 0)
		Commands->Set_Position(Commands->Find_Object(pilotID),Get_Vector3_Parameter("LeaveOffset"));
}


can be deleted completely actually.

Probally also want to change
ScriptRegistrant<Reborn_Deployable_Vehicle> Reborn_Deployable_Vehicle_Registrant ("Reborn_Deployable_Vehicle","Animated_Preset:string,Explosion_Preset:string,LeaveOffset:Vector3");

to
ScriptRegistrant<Reborn_Deployable_Vehicle> Reborn_Deployable_Vehicle_Registrant ("Reborn_Deployable_Vehicle","Animated_Preset:string,Explosion_Preset:string");


so the parameter is taken out and people aren't as confused (I say as I write a post full of C++ code in a public forum).
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Custom c++ Scripting question
Next Topic: Broken Surface Effects
Goto Forum:
  


Current Time: Mon Dec 02 15:56:34 MST 2024

Total time taken to generate the page: 0.01762 seconds