Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Is_Beacon in SSGM Plugin (ObjectHookCall)
Is_Beacon in SSGM Plugin [message #369871] Sun, 01 February 2009 05:36 Go to next message
raven
Messages: 595
Registered: January 2007
Location: Toronto, Ontario
Karma: 0
Colonel
Hey

I've been trying to attach a script to beacons inside a plugin. It simply just doesn't work..

void ObjectHookCall(void *data,GameObject *obj) {
	if (Is_Soldier(obj)) {
		Console_Input("msg LOL HI IM A SOLDIER");
	}
	else if (Is_Vehicle(obj)) {
		Console_Input("msg LOL HI IM A VEHICLE");
	}
	else if (Is_Cinematic(obj)) {
		Console_Input("msg LOL HI IM A CINEMATIC");
	}
	else if (Is_Powerup(obj)) {
		Console_Input("msg LOL HI IM A POWERUP");
	}
	else if (Is_C4(obj)) {
		Console_Input("msg LOL HI IM A C4");
	}
	else if (Is_Beacon(obj)) {
		Console_Input("msg LOL HI IM A BEACON");
	}
}


All of that works except for beacons. Anyone know why or have a workaround/solution?

Thanks.


-Jelly Administrator
-Exodus Administrator
Re: Is_Beacon in SSGM Plugin [message #369878 is a reply to message #369871] Sun, 01 February 2009 06:32 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
SSGM does some strange things to beacons for some very weird reason.

void ObjectCreate(void *stub, GameObject *o)
{
	DLOG;
	YaRRCrate::ObjectCreated(o);
	if(stricmp(Commands->Get_Preset_Name(o), "Invisible_Object") == 0)
	{
		Vector3 pos = Commands->Get_Position(o);
		for(GenericSLNode *x = BaseGameObjList->HeadNode; x != 0; x = x->NodeNext)
		{
			GameObject *obj = (GameObject *)x->NodeData;
			if(obj && As_BeaconGameObj(obj) != 0)
			{
				Vector3 objp = Commands->Get_Position(obj);
				if((pos.X == objp.X) && (pos.Y == objp.Y))
				{
					o = obj;
					break;
				}
			}
		}
	}

	if(Commands->Is_A_Star(o) && Is_Soldier(o))
	{
		Attach_Script_Once(o, "YaRRPlayer", "");
		Attach_Script_Once(o, "YaRRVeteran", "");
	}
	else if(Is_Vehicle(o))
	{
		Attach_Script_Once(o, "YaRRVehicle", "");
	}
	else if(Is_Beacon(o))
	{
		Attach_Script_Once(o, "YaRRBeacon",  "");
	}
	else if(Is_C4(o))
	{
		Attach_Script_Once(o, "YaRRC4", "");
	}
}
Re: Is_Beacon in SSGM Plugin [message #369882 is a reply to message #369871] Sun, 01 February 2009 07:33 Go to previous message
raven
Messages: 595
Registered: January 2007
Location: Toronto, Ontario
Karma: 0
Colonel
Perfect, thanks =]

-Jelly Administrator
-Exodus Administrator
Previous Topic: [request] High Res Vehicle textures
Next Topic: [WIP] Texture Replacement Mod
Goto Forum:
  


Current Time: Thu Dec 12 05:06:14 MST 2024

Total time taken to generate the page: 0.00619 seconds