I'm a complete novice trying to learn C# by making mods for a game called RimWorld. I obtained the source code of a mod that does something similar to what I'm trying to do, and have been tweaking it to see what I can make work. The following error has me stumped, as the bit of code in question is unmodified from the source code that I obtained from a working mod. I also don't know C# well enough to know what specifically Visual Studio is looking for, and copying solutions from similar questions hasn't yielded any results.
Error: CS1001 - Identifier Expected - File: GetPawnThing.cs - Line 20
using System;
using RimWorld;
using Verse;
namespace VehicleSpawnerName
{
// Token: 0x02000002 RID: 2
public class GetPawnThing : MoteThrown
{
// Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
public override void Tick()
{
bool flag = base.Map == null;
if (flag)
{
this.Destroy(0);
}
PawnKindDef Vehicle_Name = PawnKindDefOf.Vehicle_Name;
PawnGenerationRequest pawnGenerationRequest;
pawnGenerationRequest..ctor(Vehicle_Name, null, 2, -1, true, false, false, false, true, false, 20f, false, true, true, false, false, false, false, null, null, null, null, null, null, null, null);
Pawn pawn = PawnGenerator.GeneratePawn(pawnGenerationRequest);
pawn.ageTracker.AgeBiologicalTicks = 70000000L;
GenSpawn.Spawn(pawn, base.Position, base.Map, 0);
this.Destroy(0);
}
}
}
The line in question (according to the error report) is:
pawnGenerationRequest..ctor(Vehicle_Name, null, 2, -1, true, false, false, false, true, false, 20f, false, true, true, false, false, false, false, null, null, null, null, null, null, null, null);
Any help is greatly appreciated!
I think you are missing your parameter types is your method.
Here is a link of a similar error. c# identifier expected?
User contributions licensed under CC BY-SA 3.0