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 |
|
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 =]
|
|
|
|
|
Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Sat, 16 June 2007 05:53
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Sat, 16 June 2007 12:42
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Sat, 16 June 2007 16:16
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Sat, 16 June 2007 17:34
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Sat, 16 June 2007 18:37
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Sun, 17 June 2007 04:20
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Sun, 17 June 2007 14:50
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Mon, 18 June 2007 00:09
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Mon, 18 June 2007 10:08
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Mon, 18 June 2007 21:42
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Tue, 19 June 2007 00:20
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Tue, 19 June 2007 02:53
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Tue, 19 June 2007 04:00
|
|
|
Re: Scripts Part 3
By: reborn on Tue, 19 June 2007 10:37
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Tue, 19 June 2007 16:11
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Tue, 19 June 2007 16:58
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Wed, 20 June 2007 00:20
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: Tunaman on Wed, 20 June 2007 01:30
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: reborn on Wed, 20 June 2007 15:21
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
By: jnz on Wed, 20 June 2007 16:41
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
|
|
Re: Scripts Part 3
|
Goto Forum:
Current Time: Sat Dec 21 22:10:46 MST 2024
Total time taken to generate the page: 0.01504 seconds
|