Home   Help Search Login Register  

Author Topic: noob on Config, class UserActions  (Read 2267 times)

0 Members and 1 Guest are viewing this topic.

Offline Floobie

  • Members
  • *
  • Gastovski... James Gastovski
noob on Config, class UserActions
« on: 14 Sep 2008, 17:52:08 »
Hallo, I'm making a very basic car addon based on the SkodaGreen. I'm adding some custom actions for a turbo script and a selfdestruct script to the config file, but I can't figure out what I'm doing wrong. Here's my config:

Code: [Select]
// some basic defines
#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 true 1
#define false 0



// type scope
#define private 0
#define protected 1
#define public 2

#define WeaponNoSlot 0// dummy weapons
#define WeaponSlotPrimary 1// primary weapons
#define WeaponSlotSecondary 16// secondary weapons
#define WeaponSlotItem 256// items
#define WeaponSlotBinocular 4096// binocular
#define WeaponHardMounted 65536

#define CanSeeRadar 1
#define CanSeeEye 2
#define CanSeeOptics 4
#define CanSeeEar 8
#define CanSeeCompass 16
#define CanSeeRadarC CanSeeRadar+CanSeeCompass
#define CanSeeAll 31



class CfgPatches
{
class flb_ssc
{
units[] = {flb_ssc};
weapons[] = {};
requiredVersion = 1.01;
};
};

class CfgVehicles
   {
class All {};
class AllVehicles: All {};
class Land: AllVehicles {};
class LandVehicle : Land {};
class Car: LandVehicle {};
class SkodaHelper: Car {};
class SkodaBase: SkodaHelper {};
class SkodaGreen: SkodaBase {};
class flb_ssc: SkodaGreen
   {
scope=2;
unitInfoType="UnitInfoShip";
displayName="Secret Service Car";
icon="car";
        armor=700;
        side=TEast;
crew=SoldierESaboteurPipe;
fuelCapacity=500;
        maxSpeed=195;
        irScanRange = 5000;
armorGlass=1;
        armorWheels=1;
driverCanSee = CanSeeAll;
type=VArmor;
        cost=100000;
terrainCoef=0;




};

class UserActions
{
class turbo
{
displayName="Boost";
position = "flb_ssce";
radius = 1;
condition="alive this";
statement="[this] exec ""\flb_ssc\turbo.sqs""";
};
class selfd
{
displayName="Self-destruct";
position = "flb_ssce";
radius = 1;
condition="alive this";
statement="[this] exec ""\flb_ssc\destruct.sqs""";
};
};

What I want is, the user actions and sqs files packed with the addon, so you don't have to add the actions to the car in the mission editor using AddAction etc. So you can select every option only one time, and then it becomes unavailable. Also, I have absolutely no clue what the "position" and "radius" lines mean. I'm an absolute noob on addon making and on config.cpp thingy's, please help me out :D
« Last Edit: 14 Sep 2008, 17:54:26 by Floobie »

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: noob on Config, class UserActions
« Reply #1 on: 15 Sep 2008, 12:57:40 »
Hi Floobie
Position is a memory point in the Memory LOD of the 3D model
Radius is the distance from that point that the action will be available (i.e. 1 meter)

Your immediate problem is that the memory point "flb_ssce" will not be definited in BI's SkodaGreen 3D model. Hence it wont work.
What will likely be definited (just outside the doors) is "pos driver" or maybe "zamerny" (centre of vehicle).
You could try using one of those memory point and increase the radius to say 4 (meters).
To then restrict people OUTSIDE the vehicle using the action, change the condition to something like this;
condition="alive this and player in this";

cheers.

Offline Floobie

  • Members
  • *
  • Gastovski... James Gastovski
Re: noob on Config, class UserActions
« Reply #2 on: 18 Sep 2008, 14:09:45 »
Hey Gnat,

I did what you said, but it still doesn't work :( There are no errors of any kind, but the actions are not showing up in the action-menu. Here is a copy of what my config file looks like now:
Code: [Select]
// some basic defines
#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 true 1
#define false 0



// type scope
#define private 0
#define protected 1
#define public 2

#define WeaponNoSlot 0// dummy weapons
#define WeaponSlotPrimary 1// primary weapons
#define WeaponSlotSecondary 16// secondary weapons
#define WeaponSlotItem 256// items
#define WeaponSlotBinocular 4096// binocular
#define WeaponHardMounted 65536

#define CanSeeRadar 1
#define CanSeeEye 2
#define CanSeeOptics 4
#define CanSeeEar 8
#define CanSeeCompass 16
#define CanSeeRadarC CanSeeRadar+CanSeeCompass
#define CanSeeAll 31



class CfgPatches
{
class flb_ssc2
{
units[] = {flb_ssc2};
weapons[] = {};
requiredVersion = 1.01;
};
};

class CfgVehicles
   {
class All {};
class AllVehicles: All {};
class Land: AllVehicles {};
class LandVehicle : Land {};
class Car: LandVehicle {};
class SkodaHelper: Car {};
class SkodaBase: SkodaHelper {};
class SkodaGreen: SkodaBase {};
class flb_ssc2: SkodaGreen
   {
scope=2;
unitInfoType="UnitInfoShip";
displayName="Secret Service Car";
icon="car";
        armor=700;
        side=TEast;
crew=SoldierESaboteurPipe;
fuelCapacity=500;
        maxSpeed=195;
        irScanRange = 5000;
armorGlass=700;
        armorWheels=1;
driverCanSee = CanSeeAll;
type=VArmor;
        cost=100000;
terrainCoef=0;
};
};


class UserActions
{
class turbo
{
displayName="Boost";
position = "zamerny";
radius = 4;
condition="alive this and player == (driver this)";
statement="[this] exec ""\flb_ssc2\a.sqs""";
};
class selfd
{
displayName="Self-destruct";
position = "zamerny";
radius = 4;
condition="alive this and player == (driver this)";
statement="[this] exec ""\flb_ssc2\i.sqs""";
};
};

.. I hate being a noob :( :P
« Last Edit: 18 Sep 2008, 14:15:43 by Floobie »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: noob on Config, class UserActions
« Reply #3 on: 18 Sep 2008, 14:37:57 »
You closed your class flb_ssc2, before adding the class UserActions.

Try moving the class UserActions inside the class flb_ssc2 definition.


Planck
I know a little about a lot, and a lot about a little.

Offline Floobie

  • Members
  • *
  • Gastovski... James Gastovski
Re: noob on Config, class UserActions
« Reply #4 on: 18 Sep 2008, 16:52:21 »
Allright, I tried it, but it only seems to make matters worse... now it doesn't even show up in the mission editor anymore... :o
Sorry for constantly posting the whole config file, but here's the part with the user actions as I have it now:
Code: [Select]
class CfgPatches
{
class flb_ssc2
{
units[] = {flb_ssc2};
weapons[] = {};
requiredVersion = 1.01;
};

class UserActions
{
class turbo
{
displayName="Boost";
position = "pos driver";
radius = 4;
condition="alive this and player == (driver this)";
statement="[this] exec ""\flb_ssc2\a.sqs""";
};

class selfd
{
displayName="Self-destruct";
position = "pos driver";
radius = 4;
condition="alive this and player == (driver this)";
statement="[this] exec ""\flb_ssc2\i.sqs""";
};

};

class CfgVehicles.. blablabla...

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: noob on Config, class UserActions
« Reply #5 on: 19 Sep 2008, 12:22:09 »
OK, not quite what I meant, try this:

Code: [Select]
// some basic defines
#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 true 1
#define false 0



// type scope
#define private 0
#define protected 1
#define public 2

#define WeaponNoSlot 0// dummy weapons
#define WeaponSlotPrimary 1// primary weapons
#define WeaponSlotSecondary 16// secondary weapons
#define WeaponSlotItem 256// items
#define WeaponSlotBinocular 4096// binocular
#define WeaponHardMounted 65536

#define CanSeeRadar 1
#define CanSeeEye 2
#define CanSeeOptics 4
#define CanSeeEar 8
#define CanSeeCompass 16
#define CanSeeRadarC CanSeeRadar+CanSeeCompass
#define CanSeeAll 31



class CfgPatches
{
class flb_ssc2
{
units[] = {flb_ssc2};
weapons[] = {};
requiredVersion = 1.01;
};
};

class CfgVehicles
{
class All {};
class AllVehicles: All {};
class Land: AllVehicles {};
class LandVehicle : Land {};
class Car: LandVehicle {};
class SkodaHelper: Car {};
class SkodaBase: SkodaHelper {};
class SkodaGreen: SkodaBase {};
class flb_ssc2: SkodaGreen
        {
  scope=2;
  unitInfoType="UnitInfoShip";
  displayName="Secret Service Car";
  icon="car";
          armor=700;
          side=TEast;
  crew=SoldierESaboteurPipe;
  fuelCapacity=500;
          maxSpeed=195;
          irScanRange = 5000;
  armorGlass=700;
          armorWheels=1;
  driverCanSee = CanSeeAll;
  type=VArmor;
          cost=100000;
  terrainCoef=0;

  class UserActions
  {
    class turbo
    {
displayName="Boost";
position = "zamerny";
radius = 4;
condition="alive this and player == (driver this)";
statement="[this] exec ""\flb_ssc2\a.sqs""";
    };
    class selfd
    {
displayName="Self-destruct";
position = "zamerny";
radius = 4;
condition="alive this and player == (driver this)";
statement="[this] exec ""\flb_ssc2\i.sqs""";
    };
  };
        };
};

If it still has problems, don't worry we can surely get it working this year   :yes:


Planck
I know a little about a lot, and a lot about a little.