UnrealEd error prompts (For Coding)

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

UnrealEd error prompts (For Coding)

Postby Allan » Sun Jan 22, 06 10:19 pm

Title Explains Topic.

Error 1:

"Type Mismatch in..."-One or more of your variables doesn't match/isnt copatible with it's original details.
An Example:
Code: Select all

class Rocket extends DeusExProjectile;

var float mpBlastRadius;

var ParticleGenerator fireGen;
var ParticleGenerator smokeGen;

//Pointless code of no value to this example here.

simulated function SpawnRocketEffects()
{
   fireGen = Spawn(class'ParticleGenerator', Self);
   if (fireGen != None)
   {
      fireGen.RemoteRole = ROLE_None;
      fireGen.particleTexture = Texture'Effects.Fire.Fireball1';
      fireGen.particleDrawScale = 0.1;
      fireGen.checkTime = 0.01;
      fireGen.riseRate = 0.0;
      fireGen.ejectSpeed = 0.0;
      fireGen.particleLifeSpan = 0.1;
      fireGen.bRandomEject = True;
      fireGen.SetBase(Self);
   }
   smokeGen = Spawn(class'[b]WeaponAssaultGun[/b]', Self);
   if (smokeGen != None)
   {
      smokeGen.RemoteRole = ROLE_None;
      smokeGen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
      smokeGen.particleDrawScale = 0.3;
      smokeGen.checkTime = 0.02;
      smokeGen.riseRate = 8.0;
      smokeGen.ejectSpeed = 0.0;
      smokeGen.particleLifeSpan = 2.0;
      smokeGen.bRandomEject = True;
      smokeGen.SetBase(Self);
   }
}


If it's in bold, it's at fault.smokeGen = Spawn(class'WeaponAssaultGun', Self);.

This would give the followng error: "Type Mismatch in '=' ". This means that something is amiss after one of the '='s on that line. In this case, it's that the class of 'smokeGen' (ParticleGenerator) doesn't match the given class(WeaponAssaultGun) in this line. This can be rectified by filling in the correct class name in the bolded spot. It needent be case sensetive in this case, but it's best to do it like it is originally done anyway.

_____________________________________________________________

A useful Hint #1: Parenthesis.

If you didnt already know, Parenthesis is the old fashioned, and still occasionally used word for brackets if this type: ( and ), and this term is used in UEd. So if an error pops up about parenthesis, search for the brackets ;)

_____________________________________________________________
Error 2:

"Unexpected end of file...". This is one i found that baffled me for a bit. It's when there isnt a { or a } in the right place, and it can screw up an otherwise brilliant bit of coding. Checking for this error can be a pain, so I count up the {'s and }'s with this system: {=1 and }=-1.

If you cound these all up, and you get a negative number, you are missing some {'s, and a positive number means you are missing some }'s. The value of these should always end up adding up to 0.

Then, it's just a simple cose of finding where the missing {'s and }'s are :D.

Helpful Hint 2: Case sensetivity. Class names are generally not case sensetive in UEd, but be careful when coding, as you may find that that extra time reaching for the shift key results in you pressing extra buttons unneededly. Also, Functions generally ARE case sensetive (By function, i mean stuff like "Timer" and "PreBeginPlay"), so watch out for those :)

Anything to add, please do post, and it'll be added to this list, and you'll get some credit for it :).
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Return to Editing issues

Who is online

Users browsing this forum: No registered users and 5 guests