Home   Help Search Login Register  

Author Topic: Help with my first addon  (Read 1858 times)

0 Members and 1 Guest are viewing this topic.

Offline Zorasht

  • Members
  • *
    • 4th Perrus Squadron
Help with my first addon
« on: 02 Jun 2008, 10:56:42 »
Hi,
I'm new in addon making . I do not really know where to start from.
I have taken a look at diferent addons to see how  are they structured and get a rough idea of how it might be done.

Let's start from the begining, we have a dedicated server, and we use a lot of addons on it. The thing is that we have loads of different weapons from the addons, and when it comes to missions making, we have to be creating scritps for ammo boxes, because we don't use all the weapons at once, just the ones that fits for the mission or the mission author like.

So my idea is to create an addon which add all those scripts to the game editor as ammo boxes, so instead having to use and edit the scritps for each mission we could have a bunch of custom mixed ammo crates on the editor, simplifiying everything.

So my first question is how to add a custom ammo box to the editor menu. Because the addon that i've been looking at as examples are weapons addons, and they have all the entries for each weapon and I get a little bit confused of what is actually needed to add only for the ammo boxes.

The second idea is to make custom groups using the units and the vehicles from addons. I mean, create a group which appears in the editor under BLUEFOR, OPFOR or Independent using for example the technicals from QG with insugents from the WP addon, o desert vehicles from McNools vechicles pack with desert soldiers from any other addon. There are many addons which add their own groups, but other doesn't, so I would like to have them ready to use in the editor. Would it be to complex to do?

I'm also not too pretty sure how dependencies work, but I assume that might be somehow like in the missions that depends on addons, isn't it?

And the third idea is about adding music as an addon. I mean, adding 10 or 20 songs that can be used by the mission editor for intros and outros, and having them as an addon the mission size should be normal, because everytime we create a mission with music, it grows to one or two Mb. So I would like to have all the songs as an addon so the mission size is not affected by the inclusion of music.
And as we have music in the addon, would it be possible to play that music as a MP3 player when the player is a in a vehicle? I thing this last bit might be much more dificult, but I still have it in mind.

So if somebody could point me to the right direction, tell me what tutorials should I read or could give me some examples that would help me to create this three addons I would be very grateful. Because the problem is that I don't know how to start.

Thanks in advance.

Zorasht


"When you're pushed, killing is as easy as breathing"
John Rambo

Offline Sparky

  • Former Staff
  • ****
    • Hellenic Warfare Mod
Re: Help with my first addon
« Reply #1 on: 09 Jun 2008, 14:45:04 »
Ok, let's start.
1) first create a folder and name it whate ever you like

2) class CfgVehicles {
   class All;   // External class reference
   class Strategic;   // External class reference
   class Land;   // External class reference

   class ReammoBox;   // External class reference
   class AmmoBoxWest;
   class WeaponBoxWest;
   
   
   class My_WeaponBox : AmmoBoxWest {
      model = "\ca\Weapons\hromada_beden.p3d";
      displayName = $STR_DN_AMMO_CRATES_HWM; \\if you have a stringtable cfg or displayName = "My ammo box"; write inside the "" your desired name
      vehicleclass = "My Ammo class"; \\\ or vehicleClass = "Ammo"; if you want to be in the same drop down menu in the editor as BIS ones
      
      class TransportMagazines {
         class MagC1 {
            magazine = "HWM_HKG3Mag";
            count = 200;
         };
         add here other magazine classes
                           .......
                        Keep not magazine name should be the appropriate magazine name defined in CfgMagazines.hpp

      };
      
      class TransportWeapons {
         class WeapC1 {
            weapon = "HWM_HKG3A3";
            count = 20;
         };
         add here other weapon classes
                           .......
                        Keep not magazine name should be the appropriate magazine name defined in CfgWeapons.hpp
         
      };
   };
};
General notes.
1)your class name give your desired name
2)the vehicles class watch the comment above
3)in each class you add in classTransportWeapons or TransportMagazines should have different name according to this example class WeapC1 the other should be WeapC2 the other WeapC3 etc..


save this as CfgVehicles.hpp

3) if you want to creat a pbo only with your ammo boxes the you need to add this too.
class CfgPatches {
   class My pbo name{ //write here your pbo name
      units[] = {};
      weapons[] = {"My_WeaponBox"};   //write here the class name of your ammo box
      requiredVersion = 0.1;
      requiredAddons[] = {"CAData", "CA_Anims_Char", "HWM_Core"};
   };
};

save this file as CfgPatches.cpp

4)this is if you want to create you custom vehicle class (for the editor drop down menu)
class CfgVehicleClasses {
   class My Ammo class { //write here you previously vehicle class name withouth the ""
      displayName = "This is my Custom Ammo boxes"; write here a name that you want to apear in the editor unde empty->name
   };
};
 
save this as CfgVehicleClasses.hpp

5)
#define true   1
#define false   0

#define VSoft      0
#define VArmor      1
#define VAir      2

#define private      0
#define protected      1
#define public      2

#define TEast      0
#define TWest      1
#define TGuerrila      2
#define TCivilian      3
#define TSideUnknown      4
#define TEnemy      5
#define TFriendly      6
#define TLogic      7

#define ReadAndWrite      0
#define ReadAndCreate      1
#define ReadOnly      2
#define ReadOnlyVerified      3

#define LockNo      0
#define LockCadet      1
#define LockYes      2

#include "CfgVehicleClasses.hpp"
#include "CfgVehicles.hpp"
#include "CfgPatches.hpp"

copy the previously exactly as is and name it confg.cpp

6) pbo your folder and give it a go..  :good:
« Last Edit: 09 Jun 2008, 14:47:52 by XSparky »