Jump to content


SarumanBitch

Member Since 21 Apr 2020
Offline Last Active May 08 2020 02:38 AM

Topics I've Started

How to make a unit Periodaclly spawn a unit

07 May 2020 - 09:55 PM

For example, I want Shelob to Spawn an Egg which after a short time will die and spawn 1 spiderling thus theoratically over time you can produce an army of single spiderling units simply by having Shelob on the Battlefield. 

 

I have attempted to code this MANY MANY MANY times, however in all cases, it works for the Human player without issue but after one or 2 spawnings from an Ai controlled Shelob, the game abruptly crashes to desktop with a Runtime Error.

 

Any thoughts or help would be appreciated.


How to make a unit Periodaclly spawn a unit

07 May 2020 - 09:55 PM

For example, I want Shelob to Spawn an Egg which after a short time will die and spawn 1 spiderling thus theoratically over time you can produce an army of single spiderling units simply by having Shelob on the Battlefield. 

 

I have attempted to code this MANY MANY MANY times, however in all cases, it works for the Human player without issue but after one or 2 spawnings from an Ai controlled Shelob, the game abruptly crashes to desktop with a Runtime Error.

 

Any thoughts or help would be appreciated.


Error with ai slave object

07 May 2020 - 06:35 PM

Hi so i have a Hero: Shelob, that spawns an egg dummy unit which has a timed life, when that dummy unit dies it spawns a horde of spiderlings via an OCL, after a period of time Shelob will spawn another egg which will then go through the same process, my issue however is quite puzzling for my novice self, the system works without error for human players, however the moment the ai controled Shelob spawns her seconds egg the game crashes with no error code.....just gives a Runtime error.

 

Here is the code in Shelob's ini

;-------babies-------------------------------------------------------

	
 Behavior = ProductionUpdate ProductionUpdateModuleTag_1
    NumDoorAnimations            = 0
    DoorOpeningTime              = 0  ;in mSeconds how long you want doors to be in open state
    DoorWaitOpenTime             = 0  ;in mSeconds time the door stays open, so units can exit
    DoorCloseTime                = 0  ;in mSeconds how long you want doors to be in open state
    ConstructionCompleteDuration = 0  ;in mSeconds   wait time so if you have multiple units they don't run over each other
    GiveNoXP					 = Yes   ;will not give any xp when building units
    ;;;;;;;;;UnitPreparationTime			 = 4333		; time of the unit build animation
    ;;;;;;;;;; 4-1/3 second prep needs to be set in ThingTemplate, for Both trolls, now
  End


       Behavior = QueueProductionExitUpdate ModuleTag_11
		UnitCreatePoint			= X:-15.0 Y:0.0 Z:0.0
		NaturalRallyPoint		= X:-15.0 Y:0.0 Z:0.0
		ExitDelay				= 300
		NoExitPath				= Yes
	End

	Behavior = SpawnBehavior ModuleTag_SpawnFighters
		SpawnNumber				= 1
		InitialBurst			= 0
		SpawnTemplateName		= SpiderlingsShelobEgg
		SpawnReplaceDelay		= 30000
		FadeInTime				= 1000
	End

Here's the code for the egg dummy in the wildspiderling ini

//-----------------------------------------------------------------------------------------
Object SpiderlingsShelobEgg
	Draw = W3DScriptedModelDraw ModuleTag_Draw
		DefaultModelConditionState
			Model = MUSpiderEgg
		End
	End
	KindOf = INERT IMMOBILE UNATTACKABLE
	
	Body = ActiveBody ModuleTag_MakesKillWork
		MaxHealth = 1
	End
	Behavior = LifetimeUpdate ModuleTag_HatchTrigger
		MinLifetime = 20000.0
		MaxLifetime =  20000.0
	End
	Behavior = SlowDeathBehavior ModuleTag_HatchProcess
		DestructionDelay	= 3000
		FX = INITIAL FX_SpiderlingsSummonStart
		FX = FINAL FX_SpiderlingsSummonFinish
		OCL	= FINAL OCL_SpawnSpiderlingsShelobEgg
		
	End
End
;//------------------------------------------------------------------------------

ChildObject WildSpiderlingHordeMember WildSpiderling
	KindOf			= PRELOAD INFANTRY SCORE ATTACK_NEEDS_LINE_OF_SIGHT ENVIRONMENT SELECTABLE CAN_CLIMB_WALLS
End

I can include the code for the wildspiderling.ini and its horde code, but the only changes I made there was removing Command point cost.


Bugs I have found

21 April 2020 - 05:54 PM

pls delete.