Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Server side mods (I have some questions)
Server side mods [message #380952] Sat, 18 April 2009 02:40 Go to next message
Vaati19 is currently offline  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 Go to previous messageGo to next message
reborn is currently offline  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 #380961 is a reply to message #380957] Sat, 18 April 2009 04:06 Go to previous messageGo to next message
Vaati19 is currently offline  Vaati19
Messages: 50
Registered: April 2009
Location: Sweden
Karma: 0
Recruit
Thanks a lot Wink
Re: Server side mods [message #380965 is a reply to message #380952] Sat, 18 April 2009 04:28 Go to previous messageGo to next message
Vaati19 is currently offline  Vaati19
Messages: 50
Registered: April 2009
Location: Sweden
Karma: 0
Recruit
Where do I learn about C++
Re: Server side mods [message #380967 is a reply to message #380952] Sat, 18 April 2009 05:06 Go to previous messageGo to next message
reborn is currently offline  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 #381072 is a reply to message #380952] Sat, 18 April 2009 12:50 Go to previous messageGo to next message
Vaati19 is currently offline  Vaati19
Messages: 50
Registered: April 2009
Location: Sweden
Karma: 0
Recruit
I got another question now. And that is: Where am I supposed to place these commands. There is a lot of files
Re: Server side mods [message #381107 is a reply to message #380952] Sat, 18 April 2009 14:31 Go to previous messageGo to next message
ExEric3 is currently offline  ExEric3
Messages: 746
Registered: February 2005
Location: Slovakia
Karma: 0
Colonel
Try look to gmmain.cpp
Re: Server side mods [message #381162 is a reply to message #380952] Sat, 18 April 2009 17:16 Go to previous messageGo to next message
reborn is currently offline  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 #381310 is a reply to message #380952] Sun, 19 April 2009 10:31 Go to previous messageGo to next message
Vaati19 is currently offline  Vaati19
Messages: 50
Registered: April 2009
Location: Sweden
Karma: 0
Recruit
Well... I don't understand Dont Get It
Aren't there some better examples
Re: Server side mods [message #381346 is a reply to message #380952] Sun, 19 April 2009 13:19 Go to previous message
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->_____")
Previous Topic: Suggest Vehicles
Next Topic: Comment on mod pics
Goto Forum:
  


Current Time: Mon Dec 23 22:44:01 MST 2024

Total time taken to generate the page: 0.00777 seconds