I'm just messing around with this trying to get the hang of it. Using the sample VS solution, I've managed to tool around and echo messages to the console about various game data.
I decided to start exploring further, so I decided to start with targetting/facing other objects in the area. Here is the basic code:
I also figured maybe having it search using (type, target) for each action was inefficient, so I tried the following to see if I could get it to work.
Creating a Pawn object to work with:
Getting the Pawn's place in the Pawn list and referencing it using that:
Basically I've tried several different ways of trying to target an object, then face it. The first one I posted above with (type, target) as parameters works sometimes, but again - it's extremely inconsistent.
Can anyone provide some insight as to what I'm doing wrong or give any hints on the correct way to do what I'm trying to do?
Thanks!
I decided to start exploring further, so I decided to start with targetting/facing other objects in the area. Here is the basic code:
Code:
Extension Ext = new Extension();
string type = "Crafting Station";
string target = "Blacksmith Forge";
Ext.Pawn(type, target).Target();
Ext.Pawn(type, target).Face();
Creating a Pawn object to work with:
Code:
Pawn thisPawn = Ext.Pawn(type, target);
thisPawn.Target();
thisPawn.Face();
Code:
int pawnID = 0;
for (int thisPawnID = 1; thisPawnID <= Ext.VG().PawnCount - 1; thisPawnID++)
{
if ((Ext.Pawn(thisPawnID).Name == target) && (Ext.Pawn(thisPawnID).Type == type))
{
pawnID = thisPawnID;
break;
}
}
Ext.Pawn(pawnID).Target();
Ext.Pawn(pawnID).Face();
Basically I've tried several different ways of trying to target an object, then face it. The first one I posted above with (type, target) as parameters works sometimes, but again - it's extremely inconsistent.
Can anyone provide some insight as to what I'm doing wrong or give any hints on the correct way to do what I'm trying to do?
Thanks!