Re: Short Bot Note
Posted: Mon Nov 09, 2015 11:12 am
Ok... I'll give this a try now. Expect to get noob questions.
I'm not sure what you did but let's see what I had in first version. Bots were functional but I did not heared any of native sounds (jump, die, fall, etc.), I have reimported separate as stand-alone sounds just because they were muted. Each time at recompiling I had to drop them in Editor and rewrite default properties - I don't know why they did not work. So because I got them out of stock, were always functional audible. That's all with those sounds. If you get rid of them in next compilation you might see them muted - then see what you have messed. It's more wise to move them as backup rather than deleting.Rocky wrote:Also the sounds importing problem is solved. So I simply removed the "Sounds" folder.
Removed in the sense that I did Cut-Paste the folder and moved to "Backup" folder, so that I can retrieve it back whenever I want.It's more wise to move them as backup rather than deleting.
I can show you how I fixed the problem, but my UT is in external HDD and my brother took it for a day.I'm not sure what you did but let's see what I had in first version. Bots were functional but I did not heard any of native sounds (jump, die, fall, etc.), I have reimported separate as stand-alone sounds just because they were muted. Each time at recompiling I had to drop them in Editor and rewrite default properties - I don't know why they did not work. So because I got them out of stock, were always functional audible. That's all with those sounds. If you get rid of them in next compilation you might see them muted - then see what you have messed.
Code: Select all
.....
//ClearPaths(); //this one I think is bullshitting everything
MoveTarget = FindPathTo(Enemy.Location+vect(0,0,-5)); //See something...
if ( MoveTarget != None )
{
// log( Self.GetHumanName()$" > I found a path to enemy "$Enemy.GetHumanName() );
return; //If tracking a path normally is possible then use THAT WAY
}
if ( FindBestPathToward(Enemy, false) ) //Changed to False ... no comment. This one doesn't amazes me.
return;
....
First of all I'm totally appreciating that you are interested in improvements. At first look things might be a bit harder but they aren't really rocket science.Rocky wrote:Besides, I have a list of dumb questions as follows:
1. What is the difference between PickDestination and PickRegDestination in state TacticalMove??
2. What is the difference between MoveTarget, RoamTarget and OrderObject??
3. What is Bump??
4. What does state StakeOut does?
5. What is RouteCache??
Then you need a wrapper - destroy TTarget if exist one or trigger a default check before translocation. There is nothing to be removed - Removal is not a fix, sanitize code.Rocky wrote: For a moment, MBotv2 sometimes by mistake fires two transloc modules at a same time, when translocating to control points.
This is kinda annoying.
I screwed something at picking inventory. I've figured in some moments attempts to recover weapons flew on walls not really reachable. But Pinata type drop still fool them, example in my MH2 they get everything around from other Bot/player murdered by monsters. In DM they get the mostly marked items (Level Items) attempting to load the nearby weaponry only if encounter a threat, else they get "fresh" stuff (some people drop almost empty weaponry which was fooling them). So to speak if you want original "get everything way" you can put back default PickLocalInventory if I well recall its name, and also that 600 UU picking habit. My way was get minimum and hunt pawns not crawling too busy with items.Rocky wrote:Some weird bugs/things I found from original MBot:
MBot doesn't really care to pickup guns near him when they are given orders to Cover you! They think Enforcer (and other enforcer mods) is Almighty Father.
You can release what you might think necessary, for me showing codes is enough to drop them in my classes.Rocky wrote: I haven't touched MBotv2 since last week! And those double Transloc Module problem is also solved and now they run and translocate well.
Should I release with whatever I have done so far??
Code: Select all
..
Moving: //internal label
else if ( MoveTarget != None && MoveTarget.IsA('Inventory') && Level.Game.bTeamGame )
{
if ( Orders == 'Follow' && Pawn(OrderObject) != None )
ShareWith(Pawn(OrderObject));
else if ( SupportingPlayer != None )
ShareWith(SupportingPlayer);
}
//from here go couple of changes
if ( MoveTarget != None ) //must have something
{
if ( !Region.Zone.bWaterZone ) //Won't happen in water
{
if ( MoveTarget.Location.Z < ( Location.Z-50 ) //lower point
&& SpecialPause == 0 //not a lift or special handling
&& !FastTrace( MoveTarget.Location,Location+vect(0,0,-20)) //and not really traceable
&& FRand() > 0.7 ) //Change this random if measure is too rare eg: 0.5 - 0.6
{
if ( JumpZ > 200 ) //if is not rammed at jumping
{
if ( mk != None ) //test existence of our new thing-tool used
{
// log (Self.GetHumanName()@"going down way."); //Spy if code works
// mk.SetRotation(Rotation); //Rotate as Owner //see this in detail
mk.SetLocation(Location); //Bring to Owner
mk.Touch(Self); //Call drop - it's not self called mainly - the rest is operated by mk itself
}
}
}
if ( ( Vsize(Velocity) > 10 && ( FRand() < 0.1 ) ) )
{
if ( !bWallAdjust && PickWallAdjust() )
if ( mk != None )
{
// mk.SetRotation(Rotation);
mk.SetLocation(Location);
mk.Touch(Self);
}
}
if ( Vsize(Velocity) > 10 )
if ( !FastTrace( MoveTarget.Location,Location+vect(0,0,-20))
&& ( MoveTarget.Location.Z-Location.Z ) <= ( MaxStepHeight + CollisionHeight )
&& ( MoveTarget.Location.Z-Location.Z ) > MaxStepHeight )
{
if ( mk != None )
{
// mk.SetRotation(Rotation);
mk.SetLocation(Location);
mk.Touch(Self);
}
}
}
if ( VSize(Location-MoveTarget.Location) < CollisionRadius * 0.5
&& SpecialPause == 0 && FRand() > 0.5 )
{
CampTime = 1.0;
bCampOnlyOnce = true;
GoTo('Camp');
}
Code: Select all
function PreBeginPlay()
{
bIsPlayer = true;
mk = Spawn( class 'MyKick',Self,,Location+Vect(0,0,100),Rotation); //spawn at some location - let's call it warehouse
Super(Pawn).PreBeginPlay(); //get over Bot because it goes at Pawn anyway
if (Orders == '')
Orders = 'FreeLance';
}
Code: Select all
class MyKick expands Keypoint;
var MBot Pending;
var Vector Direction;
var float Distance;
var int JumpZ;
var Vector StartLocation;
event PreBeginPlay()
{
// No relevance shite
}
event PostBeginPlay()
{
StartLocation = Location; //save location
if ( Pawn(Owner) != None )
{
JumpZ=Pawn(Owner).JumpZ; //assign if needs or don't use original
if (!Level.Game.bGameEnded) //Never work if everything is finished
Touch(Owner); //call touch - eh, not necessary but let it be
}
}
event Timer()
{
if ( Pending != None
&& Pending.Health >= 1
&& Pending.MoveTarget != None
&& !Pending.bCamping )
{
SetRotation(Pending.Rotation); //adjust rotation of jump based on Owner
Pending.SetPhysics(PHYS_Falling); //Will need fall
// Pending.Velocity = Pending.GroundSpeed * Vector(Rotation);
// Distance = VSize(Pending.MoveTarget.Location-Pending.Location);
// Direction = ( Pending.MoveTarget.Location-Pending.Location )/Distance;
// Pending.Velocity = Pending.GroundSpeed * Direction;
if ( Pending.Region.Zone.ZoneGravity == class'ZoneInfo'.default.ZoneGravity )
Pending.Velocity.Z = Clamp((JumpZ*FRand()),200,JumpZ); //rule for normal gravity
else
Pending.Velocity.Z = Clamp((JumpZ*FRand()),100,JumpZ/2); //pick another for lowgraw cases
// Pending.Acceleration = Direction * Pending.AccelRate;
Pending.Destination = Pending.MoveTarget.Location; //I want that location
Pending.bJumpOffPawn = True; //jump this way
Pending.SetFall(); //Fall down after jump
}
SetLocation(StartLocation); //Do party and move at home
}
function Touch( actor Other )
{
if ( Other == Owner //Having owner and only owner
&& MBot(Other) != None //having special owner
&& !MBot(Other).bHidden //Not a hidden or such
&& !Level.Game.bGameEnded //no ended double check
&& !Owner.Region.Zone.bWaterZone //no water with any matter
&& MBot(Owner).IsInState('Roaming')) //only for roaming - don't react at impactjumping or translocation
{
Pending = MBot(Other); //set as our value
SetTimer(0.15, false); //wait a bit and call
// log (Self$" > I'm gonna throw "$Other.GetHumanName());
}
}
defaultproperties
{
bDirectional=True
JumpZ=320 //rise this up if is not good - or follow owner
CollisionHeight=20
CollisionRadius=20
RemoteRole=ROLE_None
bStatic=False
}
Code: Select all
if ( Vsize(Velocity) > 10 && FRand() > 0.5 ) //modified here
if ( !FastTrace( MoveTarget.Location,Location+vect(0,0,-20))
&& ( MoveTarget.Location.Z-Location.Z ) <= ( MaxStepHeight + CollisionHeight )
&& ( MoveTarget.Location.Z-Location.Z ) > MaxStepHeight )