Stygs 25 Posted February 5, 2017 Hi there, I was trying to recreate the CnC Generals drone upgrades, but it seems ObjectCreationUpgrade doenst seem to work anymore - any suggestions what else I could use? Share this post Link to post
Mjjstral 25 Posted February 6, 2017 Just a random idea: Use "ReplaceSelfUpgrade" module to get an equal object but which has an additional "SpawnUnitBehavior" or "SpawnBehavior" module that can give you the (slaved) drone. Give the drone a "SlavedUpdate" module (see here). But wait maybe you can do it without ReplaceSelfUpgrade cause SpawnUnitBehavior has a LogicCommand entry so there might be a direct way. SpawnUnitBehavior was only used in BFME II and ROTWK but seems to be still in the C&C3 game. Share this post Link to post
Ravendark 43 Posted February 9, 2017 Hi there, I was trying to recreate the CnC Generals drone upgrades, but it seems ObjectCreationUpgrade doenst seem to work anymore - any suggestions what else I could use? Care to elaborate, can't remember the drones from generals all to well anymore...weren't they just a spy, repair and hellfire drone upgrade? Either im missing something or its jut using 3 object upgrades for each drones? Share this post Link to post
Stygs 25 Posted February 9, 2017 Yeah, its just object upgrades - but ObjectCreationUpgrade was used to spawn them once the upgrade was purchased and I couldnt think of another simple way to trigger an OCL with an upgrade. Share this post Link to post
Ravendark 43 Posted February 10, 2017 (edited) Ah ok, was thinking i was missing something, use the following then: <SpawnBehavior id="ModuleTag_SpawnType1" SpawnNumberData="1" InitialBurst="1" SpawnReplaceDelayData="30s" SpawnedRequireSpawner="true" KillSpawnsOnCaptured="true" SpawnInsideBuilding="false" KillSpawnsOnDisabled="true"> <Die DeathTypes="ALL" /> <SpawnTemplate>DroneType01</SpawnTemplate> <TriggerdBy>Upgrade_DroneType01</TriggerdBy> </SpawnBehavior> <SpawnBehavior id="ModuleTag_SpawnType2" SpawnNumberData="1" InitialBurst="1" SpawnReplaceDelayData="30s" SpawnedRequireSpawner="true" KillSpawnsOnCaptured="true" SpawnInsideBuilding="false" KillSpawnsOnDisabled="true"> <Die DeathTypes="ALL" /> <SpawnTemplate>DroneType02</SpawnTemplate> <TriggerdBy>Upgrade_DroneType02</TriggerdBy> </SpawnBehavior> <UpgradeTemplate id="Upgrade_DroneType01" Type="OBJECT" BuildCost="500" BuildTime="30.0s" SkirmishAIHeuristic="IGNORE"> <GameDependency> <ForbiddenUpgrade>Upgrade_DroneType02</ForbiddenUpgrade> </GameDependency> </UpgradeTemplate> <UpgradeTemplate id="Upgrade_DroneType02" Type="OBJECT" BuildCost="500" BuildTime="30.0s" SkirmishAIHeuristic="IGNORE"> <GameDependency> <ForbiddenUpgrade>Upgrade_DroneType01</ForbiddenUpgrade> </GameDependency> </UpgradeTemplate> Something along those lines should work. This does mean it will replace drones free of charge. Otherwise Like Mjjstral said, you could look into the spawnunit module, but i havent worked with that module myself so dont know if it works. Also i don't think spawnunit behavior links the drone to its master by default. You might have the give it a spawn behavior anyway with a initial burst of 0 and no respawndata etc and a CanReclaimOrphans set to true. Maybe that could work Edited February 10, 2017 by Ravendark Share this post Link to post
Madin 10 Posted February 10, 2017 Is the issue that you want the ability to be able repurchase a drone if it gets destroyed? Because I cannot find a simple method to do that, none of the Generals or BFME spawn watching behaviours work (as you know). Share this post Link to post
Stygs 25 Posted February 12, 2017 Supprisingly, that seems to work fine for me - the drone dies and I can buy a new one easily, just like in Generals. But I kinda noticed that units in the game wont attack the drone on its own, so I guess I still have some work to do. Share this post Link to post
Madin 10 Posted February 13, 2017 Surprisingly, that seems to work fine for me - the drone dies and I can buy a new one easily, just like in Generals. But I kinda noticed that units in the game wont attack the drone on its own, so I guess I still have some work to do. Interesting! I would like to see your method once you have finally ironed out your issues, that would be very useful! Share this post Link to post
Ravendark 43 Posted February 13, 2017 Supprisingly, that seems to work fine for me - the drone dies and I can buy a new one easily, just like in Generals. The spawnunitbehavior module works then? Does it get slaved automaticly or did you do the reclaim orphans thing? Share this post Link to post
Stygs 25 Posted February 13, 2017 (edited) Yes, it gets slaved automaticly - I am basicly using the GDI repair drone, exepct it is spawned by an unit and not a building. Works pretty much the way I wanted it right know. For the unit: <SpawnBehavior id="ModuleTag_SpawnRepairDrones" SpawnNumberData="1" InitialBurst="1" SpawnedRequireSpawner="true" KillSpawnsOnCaptured="true" KillSpawnsOnDisabled="false"> <Die DeathTypes="ALL" /> <SpawnTemplate>ForgottenSapperRepairDrone</SpawnTemplate> <TriggeredBy>Upgrade_ForgottenHoundAmbulance</TriggeredBy> </SpawnBehavior> For the drone (removes the upgrade on death): <UpgradeDie id="ModuleTag_DroneUpgrade" UpgradeId="Upgrade_ForgottenHoundAmbulance"> <DieMuxData DeathTypes="ALL" /> </UpgradeDie> Edited February 13, 2017 by Stygs Share this post Link to post
Ravendark 43 Posted February 13, 2017 Are you using a simple upgrade purchase to spawn the unit with the <Spawnbehavior> or using the <spawnunitBehavior> with its corresponding logiccommand coding? I am wondering because: looking at your code snippet it would seem that either you use a player type upgrade and then loosing the drone would reset that upgrade for each 'master'unit like it (enless your master is a unique unit then it doesnt mather) or you use a object type upgrade and then normaly only the upgrade effecting the drone itself would be cleared on its death and not the masters upgrade? Enless the spawnbehavior or spawnunitbehavior links those 2 together someway? Share this post Link to post
Stygs 25 Posted February 13, 2017 (edited) I am using an simple object upgrade and the Spawnbehavior, pretty much like in Generals, exept with Spawnbehavior instead of ObjectCreationUpgrade. Theres even a comment in the Generals ini files refering to that: From AmericaVehicleBattleDrone: Behavior = UpgradeDie ModuleTag_12 ;This frees the object based upgrade for the producer object. DeathTypes = ALL UpgradeToRemove = Upgrade_AmericaBattleDrone ModuleTag_13 End So yeah, UpgradeDie seems to be a special case and affect the unit and its producer. Edited February 13, 2017 by Stygs Share this post Link to post
Ravendark 43 Posted February 13, 2017 That is interesting! thanks for the clarification. Share this post Link to post