wowgetoffyourcellphone Posted May 23, 2017 Report Share Posted May 23, 2017 (edited) Hi. So, I made a new Victory Condition for DE, called Conquest Civic Centers. Basically, win by destroy or capture the enemy Civic Centers. Here is the code of the script: var cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); cmpTrigger.conquestClassFilter = "CivilCentre"; var data = {"enabled": true}; cmpTrigger.RegisterTrigger("OnOwnershipChanged", "ConquestHandlerOwnerShipChanged", data); cmpTrigger.RegisterTrigger("OnStructureBuilt", "ConquestAddStructure", data); cmpTrigger.DoAfterDelay(0, "ConquestStartGameCount", null); This works fine... until I use an Upgrade feature to upgrade my Civic Center. I made it so I can upgrade my Civic Center to a Fortified Civic Center. The Fortified Civic Center inherits from the Civic Center template, so has all the same classes, etc. There may be a brief moment where the game think I don't have a Civic Center, so it makes me lose. Even though the enemy didn't destroy or capture it. Can I edit something in the script to prevent this? Perhaps that last line that mentions Delay? Edited May 23, 2017 by wowgetoffyourcellphone Quote Link to comment Share on other sites More sharing options...
elexis Posted May 23, 2017 Report Share Posted May 23, 2017 When upgrading an entity, the old one is deleted and a new one is created. So the old one will count as lost (OnOwnershipChanged to -1). That will be initiated from ChangeEntityTemplate from Upgrade.js. As we can see in that function in Transform.js, an EntityRenamed message is sent just before deleting the entity, so the victory condition could listen to that and replace the remembered entityID before it's deleted. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted May 23, 2017 Author Report Share Posted May 23, 2017 Here's the weird thing too. I have 2 CCs. I upgrade them to Fortified CCs separately, 5 mins apart, and I still lose. I swear the FCCs have the CivilCentre class. Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted August 10, 2017 Report Share Posted August 10, 2017 I just felt into the trap with the han civ 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.