Server side mods [message #380952] |
Sat, 18 April 2009 02:40 |
Vaati19
Messages: 50 Registered: April 2009 Location: Sweden
Karma: 0
|
Recruit |
|
|
In some servers u can type !guardtower in the chatbox and there it comes a GDI guard tower. I wonder how to do it
|
|
|
Re: Server side mods [message #380957 is a reply to message #380952] |
Sat, 18 April 2009 03:50 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Download SSGM2.02 here.
Un-pack the plug-in source code example and remove the un-needed code from it, the objecthookcall and the settings loader stuff, plus the example scripts and chat hooks.
Then write your own chat hook to create the guard tower object.
You'll need to be familiar with C++, and get used to the renegade API.
|
|
|
|
|
Re: Server side mods [message #380967 is a reply to message #380952] |
Sat, 18 April 2009 05:06 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Many people will offer different advice about how to learn to program in c++, I learned allot through the renegade API itself, looking at others code and simple trial and error. I have a whole bunch of books on the subject, the best one I think for beginners to programming and the c++ language is this one here.
|
|
|
|
|
Re: Server side mods [message #381162 is a reply to message #380952] |
Sat, 18 April 2009 17:16 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
If you're using the plug-in source code, then start with plugin.cpp and plugin.h. However, you're going to have to do some reading first before you jump right in.
|
|
|
|
Re: Server side mods [message #381346 is a reply to message #380952] |
Sun, 19 April 2009 13:19 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
Start by making your own scripts.
Base Script:
class zbl_Example_Script : public ScriptImpClass
{
public:
void Created(GameObject *o);
void Timer_Expired(GameObject *o, int num);
void Killed(GameObject *o, GameObject *s);
};
void zbl_Example_Script::Created(GameObject *o)
{
Commands->Start_Timer(o, this, 300.0f, 123);
}
void zbl_Example_Script::Timer_Expired(GameObject *o, int num)
{
if ( num == 123 )
{
Console_Input("msg zbl_Example_Script::Timer_Expired has expired...continuing!");
Commands->Start_Timer(o, this, 300.0f, 123);
}
}
void zbl_Example_Script::Killed(GameObject *o, GameObject *s)
{
Console_Input("msg zbl_Example_Script::Killed called.");
}
ScriptRegistrant<zbl_Example_Script> zbl_Example_Script_Registrant("zbl_Example_Script", "");
Keep in mind, that when writing scripts, if you expect to release them, pick a prefix for your scripts. Mine is "zbl_" as those are my initials. jonwil's prefix is "JFW_" cos those are his initials. APB uses "RA_" and SCUD Storm uses "SCUD_" generally.
etc etc.
Just start by playing with the Scripts API and you'll learn more and more.
Some of the key stuff is in scripts.h and engine_*.h
Just explore the ScriptCommands struct ("Commands" variable; "Commands->_____")
|
|
|