Home   Help Search Login Register  

Author Topic: Configing a Bicycle  (Read 4028 times)

0 Members and 2 Guests are viewing this topic.

Offline Abs_01

  • Members
  • *
  • I'm a llama!
Configing a Bicycle
« on: 26 Sep 2005, 21:53:12 »
Hi. I'm doing my best to configure a bicycle, but I'll be damned if I can do it. I've UnPBO'd other bike addons, and copied their configs over, and it's not working. The problem lines seems to be:

Code: [Select]
class Motorcycle: LandVehicle {};
class MyAddonName: Motorcycle
{
.....
}

Whenever I change that to:
Code: [Select]
//class Motorcycle: LandVehicle {};
class MyAddonName: Jeep
{
.....
}

it seems to work. I also have a config for a second unit in there, and it works properly.

Any hints as to where I could look?

Abs_01

[NOTE: Here is the full config.cpp]

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

class CfgPatches
{
   class AbsAnimations                        //name of the new class
   {
      units[] = {Unit1,Unit2};   //new unit to be added
      weapons[] = {};
      requiredVersion = 1.91                  //minimum version of OFP
   };
};

class CfgVehicles
{
   class All {};
   class AllVehicles: All {};
   class Land: AllVehicles {};
   class LandVehicle: Land {};
   class Car: LandVehicle {};
   class Motorcycle: LandVehicle {};
   class Jeep: Car {};
   class Unit1: Jeep
   {
      vehicleClass="Abs";
      displayName = "TwoGH";
      model=\Abs_Anim\2gh.p3d;
      transportSoldier=2;
      side=3;
      crew="Civilian2";
      maxSpeed=0;
      driverAction = ManActAnim1;
      cargoAction[]={
         ManActAnim2,
         ManActAnim3
      };
      icon="unknown_object";
      fuelCapacity=0;
      getInRadius = 2.5;
      transportAmmo = 0;
      transportMaxMagazines = 0;
      transportMaxWeapons = 0;
      transportFuel = 0;
      transportRepair = 0;
      transportVehiclesCount = 0;
      transportVehiclesMass = 0;
      weapons[]={};
      magazines[]={};
      unloadInCombat = false;
      getInAction="ManActGetInCar";
      getOutAction="ManActGetOutCar";
      castDriverShadow = true;
      castCargoShadow = true;
      ejectDeadDriver = false;
      ejectDeadCargo = true;
      class Reflectors {};

   };


   class Unit2: Motorcycle                   //This is where I'm having trouble
   {
      access = ReadOnly;
      vehicleClass="Abs";
      canFloat = false;
      isBicycle = true;

      hideWeaponsDriver = false;

      displayName="OneGCW";

      scope=public;
      icon="unknown_object";
      maxSpeed=20;
      crew = Civilian5;
      side = TCivilian;

      nameSound="car";
      accuracy=0.50;

      model=\Abs_Anim\1gcw.p3d;
      terrainCoef=6.0;

      soundEngine[]={"\Kolo\bc_chain.wav",db-35,1};

      weapons[]={BikeHorn};
      magazines[]={};


      driverAction = ManActKoloDriver;
      transportSoldier = 0;
      transportAmmo = 0;
   }
};



class CfgVehicleActions
{
   Anim1="Anim1";
   Anim2="Anim2";
   Anim3="Anim3";
   Anim4="Anim4";
   Anim5="Anim5";
};

class CfgMovesMC
{
   class Default {};
   class DefaultDie: Default {};
   class States
   {
      class Driver: Default {};
      class Anim1: Driver
      {
         file="\Abs_Anim\Anims\Anim1.rtm";
         speed=-2;
         looped=1;
         variantsAI[]={"Anim1V1",0.700000,"Anim1"};
         interpolateWith[]={"Anim1V1",0.500000};
         equivalentTo="Anim1";
         interpolationSpeed=1;
         connectTo[]={"Anim1Dying",1};
         interpolateTo[]={"Anim1Dying",0.100000};
      };
      class Anim1V1: Anim1
      {
         file="\Abs_Anim\Anims\Anim1.rtm";
         speed=-4;
         looped=1;
         interpolateTo[]={"Anim1Dying",0.100000};
      };
      class Anim1Dying: DefaultDie
      {
         actions="NoActions";
         file="\Abs_Anim\Anims\Anim1smrt.rtm";
         speed=-1;
         looped=0;
         soundEnabled=0;
         connectFrom[]={"Anim1Driver",1};
      };
      class Anim1Dead: Anim1Dying
      {
         actions="DeadActions";
         file="\Abs_Anim\Anims\Anim1smrt2.rtm";
         speed=-2.5;
         terminal=1;
         connectFrom[]={"Anim1Dying",1};
         connectTo[]={"DeadState",1};
      };

      // Anim2
      class Anim2: Driver
      {
         file="\Abs_Anim\Anims\Anim2.rtm";
         speed=SPEED_STATIC;
         looped=1;
         variantsAI[]= {Anim2B,0.7,Anim2};
         interpolateWith[]={Anim2,0.5};
         equivalentTo=Anim2;
         interpolationSpeed=1;
         connectTo[]={Anim2dying,1};
      }
      class Anim2B: Anim2
      {
         file="\Abs_Anim\Anims\Anim2.rtm";
         speed=-5;
         looped=1;
      }
      class Anim2dying: DefaultDie
      {
         actions = "NoActions";
         file="\Abs_Anim\Anims\Anim2smrt.rtm";
         speed=-1;
         looped=0;
         soundEnabled=0;
         connectFrom[]={Anim2,1};
      };
      class Anim2dead: Anim2dying
      {
         actions = "DeadActions";
         file="\Abs_Anim\Anims\Anim2smrt2.rtm";
         speed=SPEED_STATIC;
         terminal = 1;
         connectFrom[]={Anim2dying,1};
         connectTo[]={DeadState,1};
      };

      //Anim3

      class Anim3: Driver
      {
         file="\Abs_Anim\Anims\Anim3.rtm";
         speed=SPEED_STATIC;
         looped=1;
         variantsAI[]= {Anim3B,0.7,Anim3};
         interpolateWith[]={Anim3,0.5};
         equivalentTo=Anim3;
         interpolationSpeed=1;
         connectTo[]={Anim3dying,1};
      }
      class Anim3B: Anim3
      {
         file="\Abs_Anim\Anims\Anim3.rtm";
         speed=-5;
         looped=1;
      }
      class Anim3dying: DefaultDie
      {
         actions = "NoActions";
         file="\Abs_Anim\Anims\Anim3smrt.rtm";
         speed=-1;
         looped=0;
         soundEnabled=0;
         connectFrom[]={Anim3,1};
      };
      class Anim3dead: Anim3dying
      {
         actions = "DeadActions";
         file="\Abs_Anim\Anims\Anim3smrt2.rtm";
         speed=SPEED_STATIC;
         terminal = 1;
         connectFrom[]={Anim3dying,1};
         connectTo[]={DeadState,1};
      };




      //Anim4

      class Anim4: Driver
      {
         file="\Abs_Anim\Anims\Anim4.rtm";
         speed=SPEED_STATIC;
         looped=1;
         variantsAI[]= {Anim4B,0.7,Anim4};
         interpolateWith[]={Anim4,0.5};
         equivalentTo=Anim4;
         interpolationSpeed=1;
         connectTo[]={Anim4dying,1};
      }
      class Anim4B: Anim4
      {
         file="\Abs_Anim\Anims\Anim4.rtm";
         speed=-5;
         looped=1;
      }
      class Anim4dying: DefaultDie
      {
         actions = "NoActions";
         file="\Abs_Anim\Anims\Anim4smrt.rtm";
         speed=-1;
         looped=0;
         soundEnabled=0;
         connectFrom[]={Anim4,1};
      };
      class Anim4dead: Anim4dying
      {
         actions = "DeadActions";
         file="\Abs_Anim\Anims\Anim4smrt2.rtm";
         speed=SPEED_STATIC;
         terminal = 1;
         connectFrom[]={Anim4dying,1};
         connectTo[]={DeadState,1};
      };

      //Anim5

      class Anim5: Driver
      {
         file="\Abs_Anim\Anims\Anim5.rtm";
         speed=SPEED_STATIC;
         looped=1;
         variantsAI[]= {Anim5B,0.7,Anim5};
         interpolateWith[]={Anim5,0.5};
         equivalentTo=Anim5;
         interpolationSpeed=1;
         connectTo[]={Anim5dying,1};
      }
      class Anim5B: Anim5
      {
         file="\Abs_Anim\Anims\Anim5.rtm";
         speed=-5;
         looped=1;
      }
      class Anim5dying: DefaultDie
      {
         actions = "NoActions";
         file="\Abs_Anim\Anims\Anim5smrt.rtm";
         speed=-1;
         looped=0;
         soundEnabled=0;
         connectFrom[]={Anim5,1};
      };
      class Anim5dead: Anim5dying
      {
         actions = "DeadActions";
         file="\Abs_Anim\Anims\Anim5smrt2.rtm";
         speed=SPEED_STATIC;
         terminal = 1;
         connectFrom[]={Anim5dying,1};
         connectTo[]={DeadState,1};
      };
   };
};

class CfgNonAIVehicles            // For custom proxies?
{

};


« Last Edit: 26 Sep 2005, 21:54:59 by Abs_01 »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Configing a Bicycle
« Reply #1 on: 26 Sep 2005, 22:57:11 »
In cfgPatches you have:

class AbsAnimations

But in cfgVehicles your pbo name is stated as Abs_Anim.

This may or may not be the problem.

I also note that there is no cfgModels section.

Maybe you should try:

class Motorcycle: LandVehicle {};
class Kolo: Motorcycle {};
class MyAddonName: Kolo
{
.....
}


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

Offline Abs_01

  • Members
  • *
  • I'm a llama!
Re:Configing a Bicycle
« Reply #2 on: 26 Sep 2005, 23:30:45 »
Hi Planck, thanks for stopping by to help out!

I changed the class to Abs_Anim, and added kolo under motorcycle but unfortunately it resulted in a CTD like usual.

As far as the cfgModels section, I haven't been able to find a tutorial that really defines what it does (Yes, I've read snYper's tut)...it basically defines any parts that I have in my model right? My model isn't complex (it's just a plane) and it worked with Unit1.

Abs_01

PS: I've only been at this for two days.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Configing a Bicycle
« Reply #3 on: 26 Sep 2005, 23:58:31 »
Try this for a cfgModels section.

Code: [Select]
class CfgModels
{
   class Default
   {
      sections[]={};
      sectionsInherit="";
   };
   class Vehicle: Default {};
   class Car: Vehicle {};
   class 2gh: Vehicle {};
   class lgcw: Vehicle {};
};

Plonk it down after the cfgPatches section.

Does your bike have all the relevant parts that it should have.........named properties and named selections etc etc?

If not, then have a look at BIS's bike in Oxygen for details.



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

Offline Abs_01

  • Members
  • *
  • I'm a llama!
Re:Configing a Bicycle
« Reply #4 on: 27 Sep 2005, 01:25:08 »
Quote
Does your bike have all the relevant parts that it should have.........named properties and named selections etc etc?

Errr, no it doesn't. See, I'm not exactly making a bike. I was trying to figure out a way to allow soldiers to carry other soldiers. An example of what I mean can be seen here:

[Edit: Image removed to save my bandwidth]

The above is a jeep, whose actual p3d model is a plane that is really small at 0,0,0. I've configged 3 proxies, and animated them to produce that effect.

It wouldn't work for carrying a soldier, because if I tried the same thing, the soldier animation would never stop. The only anim where it does stop is on the bicycle, and so I thought I would try the same method.

If I emailed you what I have, would you mind taking a look at it?

Abs_01
« Last Edit: 03 Oct 2005, 16:35:44 by Abs_01 »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Configing a Bicycle
« Reply #5 on: 27 Sep 2005, 01:31:10 »
Quote
If I emailed you what I have, would you mind taking a look at it?

No, I doubt I could help you with that.

I have no knowledge when it comes to animations at all, I have never had the need to learn about them.

Your best hope is for someone who does know about animations to come along and find your topic.  ;D

Anyway, best of luck with it, I'll pop in now and then to see how its going.


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

Offline Abs_01

  • Members
  • *
  • I'm a llama!
Re:Configing a Bicycle
« Reply #6 on: 27 Sep 2005, 01:33:42 »
 :) Thanks for the wellwishes.

I think it's more of a config issue though. There's no need to start working on the animations until i can get a "bicycle" working in the game.

Abs

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Configing a Bicycle
« Reply #7 on: 27 Sep 2005, 09:47:19 »
Try commenting out the model from your 'bike' config and changing it into some other model...
If that 'cures' the CTD then it's an issue with the model..

I have experienced some model related problems which in many cases come up as CTDs without any error messages..
I think even a faulty path to the model in the model=XXXXX can cause a CTD...

Quote
The above is a jeep, whose actual p3d model is a plane that is really small at 0,0,0. I've configged 3 proxies, and animated them to produce that effect.
Very interesting approach you have there btw...  :thumbsup:
Makes me wanna punch my forehead and shout "Now why didn't I think of that..." :)

How well does that work in-game? Do you need to get in and out of the 'vehicle' when you escort the prisoner/wounded?
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline bdfy85

  • Contributing Member
  • **
Re:Configing a Bicycle
« Reply #8 on: 27 Sep 2005, 11:39:42 »
Abs_01
Your question is still a bit unclear for me...
IIUC you want to config a vehicle ( class Car ) with several proxies and animate crew while moving just like they move in normal game ?


Liberation Mod scripts&balance

Offline Abs_01

  • Members
  • *
  • I'm a llama!
Re:Configing a Bicycle
« Reply #9 on: 27 Sep 2005, 13:29:38 »
Thanks for the comments, HateR_Kint :D . It's exactly like you figured. The one in the pic above is only a static anim, and my attempts with the bicycle will be the first time i try to make a carrying animation move. I figure with scripting I can probably make the cargo get out once the driver is killed, or perhaps set a really low armour level to the mode so that if it gets hit both of them will exit the vehicle. I'm just playing with the idea so far, and I really have no clue about how well it will work.

I'm going to try seperating the config today (i.e. Rewriting it to remove the above model, and see if my second model works alone). I've already had success getting both models in-game, but only if they were both classed as a jeep. I'll keep you guys posted about how it works if I'm successful.

bdfy85, yes you understand correctly, except that I want to class it as a bicycle, because that anim stops moving when the player does. I know that there will probably be a problem of the guys foot in the air if he stops mid step or something, but if it doesn't look that bad I don't think that people will mind using it to carry disabled comrades during their missions. ;)

I've posted the working addon up in the combat photography screenshots, but here I'll post the one that doesn't work too (note that it's a WIP, and there are only placeholder anims for the second model).

[Edit: Links removed to save my bandwidth.]

PS: There are no real LOD's for the models yet. It hasn't seemed to be a problem yet, and I planned on adding them at the end, even though I don't think a single plane is going to lag any systems.

Abs_01
« Last Edit: 03 Oct 2005, 16:36:26 by Abs_01 »

Offline bdfy85

  • Contributing Member
  • **
Re:Configing a Bicycle
« Reply #10 on: 27 Sep 2005, 14:53:20 »
I'm currently working on fully animated movable 45mm gun for LIBMOD
 But I use not config , but scriptable way to set anims to work... Using EventHandler engine
 Also check out this addon
http://ofp.gamezone.cz/index.php?showthis=8152
Quote
Third version: you can move by hand to the action for a little "close combat"
Liberation Mod scripts&balance

Lean Bear

  • Guest
Re:Configing a Bicycle
« Reply #11 on: 02 Oct 2005, 18:51:53 »
@ Abs_01

Nice idea.

From your config I can't see anything devastatingly wrong. So I dunno what the problem is...

When you get it working, you can include a little script which monitors the speed of the "vehicle". So when the speed = 0 (the unit has stopped moving) you can switchMove the unit into a standing static anim.

Hang on...check that. Some of your problems could come from the fact that you're missing about half your semi-colons :D

After each closing curly bracket } you need a ; and you're missing quite a few. Mainly where you define your anims, but also where you class your bicycle ;)

Also, with anims, you should do all you're inheriting before you define the states, otherwise your anims won;t work properly.

Code: [Select]
class CfgMovesMC
{
   class Default {};
   class DefaultDie: Default {};
   class Driver: Default {};

   class States
   {
      class Anim1: Driver
      {
         file="\Abs_Anim\Anims\Anim1.rtm";
         speed=-2;

Offline Abs_01

  • Members
  • *
  • I'm a llama!
Re:Configing a Bicycle
« Reply #12 on: 02 Oct 2005, 23:14:42 »
Thanks a lot bdfy85 and Lean Bear!

Sorry I haven't replied in a while. Third year of university can be quite hectic, but I haven't dropped this project.

bdfy85: the addon you linked to is pretty much the idea that I was going after and I wouldn't have found it since I'm not into the WW2 mods, so thanks for the link! I'll UnPBO it and look at their anims.

Edit: I don't speak Russian, so that first link couldn't help me :(. I appreciate the effort still!

Lean Bear: Thanks for the cpp help! Being new to this, I have almost no idea what I'm doing  ;) so I'll take any advice where I can get it! This week is a little hectic for me, but I'll try to post some progress pics this weekend of what I've done.

Believe me when I say I'll need more help in the future (specifically with the driver "aka: man carrying wounded guy" getting killed first...it won't do to have a wounded man floating in mid air).

Abs
« Last Edit: 02 Oct 2005, 23:36:48 by Abs_01 »

Offline bdfy85

  • Contributing Member
  • **
Re:Configing a Bicycle
« Reply #13 on: 03 Oct 2005, 00:17:15 »
Quote
bdfy85: the addon you linked to is pretty much the idea that I was going after and I wouldn't have found it since I'm not into the WW2 mods, so thanks for the link! I'll UnPBO it and look at their anims.

Edit: I don't speak Russian, so that first link couldn't help me . I appreciate the effort still!

You can download that gun http://redhammer.h14.ru/45mm_move.7z
and look at the config and scripting. Hint: look at the EH45.h part of the config ( especially "engune" EH )
There're still some error in the version you can download - but most of them are fixed. I'm gonna to release that movable gun day to day.  


Liberation Mod scripts&balance

Offline Abs_01

  • Members
  • *
  • I'm a llama!
Re:Configing a Bicycle
« Reply #14 on: 03 Oct 2005, 04:08:41 »
Thanks for the link, bdfy85  :)

K, so after replying to this thread earlier today, I dropped my homework assignments (that's means I'll be extra busy tomorrow :() and did the static carrying anim. Here's what it looks like:

[Edit: Image removed to save my bandwidth.]

I'm playing with the config right now. Gotta do some tests to see if what I've learned so far will help any  ;), and then I've got to finish the model...oh yea, I also have to do the complete animation, as it's only a static right now.

I'll keep you guys posted.

Abs
« Last Edit: 03 Oct 2005, 16:36:57 by Abs_01 »

Offline Abs_01

  • Members
  • *
  • I'm a llama!
Re:Configing a Bicycle
« Reply #15 on: 03 Oct 2005, 16:35:00 »
Hey.

So, I've configured it as a bicycle. I think the problem might have been something to do with missing terrainCoef from my config.

Either way, I've added bits and pieces from people's configs and it's configured as a bicycle now.  :)

I've still got other problems, but that's all model related (I'm sure of it).

All of you have earned a place in my readme for all the help! bdfy85, I'm definately looking into event handlers...thanks for pointing me in that direction!

Abs


Kyle Sarnik

  • Guest
Re:Configing a Bicycle
« Reply #16 on: 03 Oct 2005, 20:41:58 »
That looks great. Glad that someone else is messing around with bicycles. This thread inspired me to pick up this project again:

Lean Bear

  • Guest
Re:Configing a Bicycle
« Reply #17 on: 04 Oct 2005, 19:57:08 »
Glad you're gonna continue with this Abs, also, instead of posting a direct link to the image using the img tags, why not link to a site like imageshack or paintbucket so you can keep the links and we can see the miages before they are removed ;)