Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Scripts Part 3
Re: Scripts Part 3 [message #266619 is a reply to message #266592] Sat, 16 June 2007 05:53 Go to previous messageGo to previous message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma:
General (3 Stars)
He means something different to that.. He wants to be able to say something in-game like "!buy med" and it drops off a med tank to him, or "!gt" and it places a Mini guard tower for him.

This is possible by modifying the existing chat hook in SSAOW, to find the chat hook search for this bit:

const char *WideCharToChar(const wchar_t *wcs);
void Chat(int ID, int Type, const wchar_t *Msg) {


Then you will have to have it catch your desired chat, I would just add this to the end of the existing code, so say you want to have it catch the word "!build_turret" then it will look something like this at the end of the chat hook:


		else if ((stricmp(Msg2, "!Turret") == 0))
Pos = Commands->Get_Position(obj);
  Vector3 Pos.Z += 0;
GameObject *turret = Commands->Create_Object(team==0?"Nod_Turret_MP":"Nod_Turret_MP_Improved",Pos);
				Commands->Disable_Physical_Collisions(turret);
if (team == 1)
					Commands->Set_Player_Type(turret,1);
	}
}



but you must remember to declare the actual player as the object to get the position, so the beginning will look something like:

const char *WideCharToChar(const wchar_t *wcs);
void Chat(int ID, int Type, const wchar_t *Msg) {

GameObject *obj = Get_GameObj(ID);
	int team = Commands->Get_Player_Type(obj);

	if (Type == 2) return;


This would most likely not compile even if you added it to the right places, I don't have the time really to adapt the code to suit SSAOW 1.5, although the only problem will most likely be with the vector3 stuff, as it changed after version 1.5 in the engine.cpp file I think. But it will give you a good idea of how to go about creating your own version.
If you wanted a cost involved you would have to add that too, I would also suggest adding a limit to them too.

Hope that helps you get a good start =]



 
Read Message
Read Message
Read Message
Read Message
Read Message icon12.gif
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
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: GB
Next Topic: SSGM, previously SSAOW, Version 2.0
Goto Forum:
  


Current Time: Sat Dec 21 11:55:48 MST 2024

Total time taken to generate the page: 0.01648 seconds