need help with an error

need help with an error

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

need help with an error

Post by Erik »

I decided to make a 2nd unit after the first worked well. I made new scipts and files (basically copies of the other tank) with a different model. But when i load the mod it crashes in the moment it would be spawned (counter hits 0 ) and says "couldnt find unittype behmoth". Im really out of ideas about this bug so help would be very nice.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: need help with an error

Post by Argh »

Several things might cause that. One of the more obvious ones is that the S3O doesn't have the tex1 defined.

Scripts must be named the same as the Unit as well. Check for any small discrepancies between the first unit and the second- usually it's something basic, like a missing comma / semicolon, etc. But the fact that the engine reported the UnitDef name means it's probably the model or script, since you probably haven't started messing with sounds yet.
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: need help with an error

Post by Erik »

My other tank doesnt have one aswell, they both only have the basic texture with colourmap and housecolour.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: need help with an error

Post by Argh »

That's tex1. So, it's almost certainly something missing in the text files. Post your Unit TDF / Lua files, let's take a look.
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: need help with an error

Post by Erik »

These are the files. I compared them and they are identical to the others with only some values different.
Attachments
Behmoth.lua
(4.85 KiB) Downloaded 8 times
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: need help with an error

Post by Argh »

Here, try this. I actually think the main error is at the very bottom- you had "runner" instead of "Behmoth".

Code: Select all

unitDef = {
  unitname            = [[Behmoth]],
  name                = [[Behmoth]],
  description         = [[>Ground units< >Aircraft<]],
  acceleration        = 0.5,
  brakeRate           = 3,
  buildCostEnergy     = 0,
  buildCostMetal      = 4000,
  builder             = false,
  buildPic            = [[Runner.png]],
  buildTime           = 1000,
  canAttack           = true,
  canGuard            = true,
  canMove             = true,
  canPatrol           = true,
  canstop             = [[1]],
  category            = [[LAND]],
  --corpse              = [[DEAD]],

  customParams        = {
    helptext       = [[ ]],
  },

  defaultmissiontype  = [[Standby]],
  --explodeAs           = [[SMALL_UNITEX]],
  footprintX          = 2,
  footprintZ          = 2,
  --iconType            = [[Tank]],
  idleAutoHeal        = 0,
  idleTime            = 300,
  --leaveTracks         = true,
  mass                = 20.5,
  maxDamage           = 1000,
  maxSlope            = 25,
  maxVelocity         = 3.5,
  maxWaterDepth       = 22,
  movementClass       = [[SPECIALHOVER]],
  noAutoFire          = false,
  noChaseCategory     = [[]],
  objectName          = [[T125.s3o]],
  seismicSignature    = 4,
  --selfDestructAs      = [[SMALL_UNITEX]],

  sfxtypes            = {

    explosiongenerators = {
     -- [[custom:emg_shells_l]],
     -- [[custom:flashmuzzle1]],
    },

  },

  sightDistance       = 425,
  smoothAnim          = true,
  TEDClass            = [[COMMANDER_CTRL_C]],
  --trackOffset         = 0,
  --trackStrength       = 8,
  --trackStretch        = 1,
  --trackType           = [[ComTrack]],
  --trackWidth          = 80,
  turnRate            = 150,
  upright             = false,
  workerTime          = 0,

  weapons             = {

    {
      def                = [[T125Cannon]],
      badTargetCategory  = [[]],
      onlyTargetCategory = [[]],
    },

  },


  weaponDefs          = {

    T125Cannon = {
      name                    = [[T125Cannon]],
      alphaDecay              = 0.1,
      areaOfEffect            = 8,
     -- burst                   = 0,
     -- burstrate               = 0,
      colormap                = [[1 0.95 0.4 1   1 0.95 0.4 1    0 0 0 0.01    1 0.7 0.2 1]],
      craterBoost             = 1,
      craterMult              = 2,
      damage                  = {
        default = 200,
     --   Terrordrone=3,
	  --  Infantry=3,
		--Harassment=45,
		--ANTI_INF=35,
		--ANTI_AIR=40,
		--LIGHT_TANK=30,
		--Medium_TANK=20,
		--Heavy_TANK=15,
        --Support=40,
      },

      endsmoke                = [[0]],
      --explosionGenerator      = [[custom:FLASHPLOSION]],
      impactOnly              = true,
      impulseBoost            = 0,
      impulseFactor           = 0.4,
      intensity               = 0.7,
      interceptedByShieldType = 1,
      lineOfSight             = true,
      noGap                   = false,
      noSelfDamage            = true,
      range                   = 500,
      reloadtime              = 2.0,
      renderType              = 4,
      rgbColor                = [[1 0.95 1]],
      separation              = 1.5,
      size                    = 5.55,
      sizeDecay               = 0,
      --soundStart              = [[flashemg]],
      sprayAngle              = 1180,
      stages                  = 10,
      startsmoke              = [[0]],
      tolerance               = 5000,
      turret                  = true,
      weaponTimer             = 0.1,
      weaponType              = [[Cannon]],
      weaponVelocity          = 550,
    },

  },

}

return lowerkeys({ Behmoth = unitDef })
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: need help with an error

Post by Forboding Angel »

Copying CA unitdefs makes baby jesus cry.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: need help with an error

Post by Argh »

'Specially since they still include stuff like bmcode, which has no meaning in Spring, hehe.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: need help with an error

Post by CarRepairer »

We have an external script that tracks the bowel movements of every unit type, doesn't use spring. bmcode is crucial.
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: need help with an error

Post by Erik »

What are you talking of?
And should i type the whole unit definition out of nothing, without errors without any reference file?

btw thx for the help, i think it was the wrong name that caused the error.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: need help with an error

Post by Forboding Angel »

Lets just say this... CA does unitdefs in a very... interesting way.
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: need help with an error

Post by Erik »

So i tried making a thrid unit ( a building this time) and again i get a "couldnt find unittype" error, but im sure that my .Lua file is correct, a script is there and also a model with all the skins.
What can this error mean? Perhaps it would be easier for beginners if the error messages would be a bit more accurate.
For example "Missing script" "Missing skin" and so on instead of always "Couldnt find unittype xyz"
Post Reply

Return to “Game Development”