Ok so I'm using the UDK Game Programming With Unrealscript Beginner's Guide and it was working great. It had me create some test enemies and they worked fine. Then all of a sudden I test the code to see where I stopped at the day before, I like to go back and remember what I did the previous day, and then my test enemies were spawning but I would only see a flash of them and then they would disappear. I checked the log and got this
Here's the code that deals with the testenemy.Code:[0022.65] Log: Octree Warning (AddPrimitive): CylinderComponent_3 (Owner: AwesomeTestMap.TheWorld:PersistentLevel.TestEnemy_0) Outside World. [0023.79] Log: Octree Warning (AddPrimitive): CylinderComponent_4 (Owner: AwesomeTestMap.TheWorld:PersistentLevel.TestEnemy_1) Outside World. [0025.53] Log: Octree Warning (AddPrimitive): CylinderComponent_5 (Owner: AwesomeTestMap.TheWorld:PersistentLevel.TestEnemy_2) Outside World. [0026.38] Log: Octree Warning (AddPrimitive): CylinderComponent_6 (Owner: AwesomeTestMap.TheWorld:PersistentLevel.TestEnemy_3) Outside World.
Then this is the enemy spawner.Code:class TestEnemy extends AwesomeActor placeable; var Pawn Enemy; var float BumpDamage; var float MovementSpeed; var float AttackDistance; var bool bFreeze; function Tick(float Deltatime) { local AwesomePlayerController PC; local Vector NewLocation; if(Enemy == none) { foreach LocalPlayerControllers(class'AwesomePlayerController', PC) { if(PC.pawn != none) { Enemy = PC.Pawn; } } } else if(!bFreeze) { if(VSize(Location - Enemy.Location) < AttackDistance) { Enemy.Bump(self, CollisionComponent, vect(0, 0, 0)); } else { NewLocation = Location; NewLocation += (Enemy.Location - Location) * MovementSpeed * DeltaTime; SetLocation(NewLocation); } } } function Freeze() { bfreeze = true; } DefaultProperties { BumpDamage=5.0 MovementSpeed=256.0 AttackDistance=96.0 bBlockActors=true bCollideActors=true begin object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment bEnabled=true end object components.add(MyLightEnvironment) begin object class=StaticMeshComponent Name=PickupMesh StaticMesh=StaticMesh'UN_SimpleMeshes.TexPropCube_Dup' Materials(0)=Material'EditorMaterials.WidgetMaterial_X' LightEnvironment=MyLightEnvironment Scale3D=(x=0.25,y=0.25,Z=0.5) end object Components.add(PickupMesh) begin object class=CylinderComponent Name=CollisionCylinder CollisionRadius=32.0 CollisionHeight=64.0 BlockNonZeroExtent=true BlockZeroExtent=true BlockActors=true CollideActors=true end object CollisionComponent=CollisionCylinder Components.Add(CollisionCylinder) }
I'm not sure if anything else could effect the test enemy. Gameinfo just calls the enemyspawner after checking if there is a spawner that isn't right next to the pawn, I think the distance was 1300. But that code works properly. I just get that error whenever the test enemy is supposed to spawn.Code:class AwesomeEnemySpawner extends AwesomeActor placeable; var TestEnemy MySpawnedEnemy; function SpawnEnemy() { if(MySpawnedEnemy == none) MySpawnedEnemy = spawn(class'TestEnemy', self,, Location); } function EnemyDied() { SpawnEnemy(); } function FreezeEnemy() { if(MySpawnedEnemy != none) MySpawnedEnemy.freeze(); } function bool CanSpawnEnemy() { return MySpawnedEnemy == none; } DefaultProperties { begin object Class=SpriteComponent Name=Sprite Sprite=Texture2D'EditorResources.S_NavP' HiddenGame=true end object Components.Add(Sprite) }



Reply With Quote


Bookmarks